convez.ai
AgenteDevOps & InfraestruturaIntermediário
aktech

AI Sandbox

aktech/ai-sandbox

Sandbox Docker por projeto para agentes IA com isolamento de segurança

Ver no GitHub
InicialPluginScore · de 0 a 100

Cria contêineres Docker isolados por projeto para executar agentes de codificação IA (Claude Code, Pi) com segurança. Cada projeto roda em seu próprio sandbox, impedindo que falhas afetem sua máquina local. A ferramenta oferece controle fino sobre mounts, recursos e portas via CLI simples.

Instalação

$npx convez-ai aktech/ai-sandbox

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
3
Forks
2
Acompanhando
1
Saúde
42%
Último commit
há 1 semana
Versão
v0.6
Issues abertas
3
Contribuidores
3

Casos de uso

  • Executar agentes de IA sem risco à máquina host
  • Isolar projetos com dependências conflitantes
  • Testar código gerado por IA em ambiente controlado
  • Expor portas de desenvolvimento de forma segura

Veredito

Ferramenta prática para quem trabalha com agentes IA e quer isolamento sem overhead. Implementação clara em Go, documentação direta. Útil especialmente para times que executam code-gen frequentemente.

README

A tradução para o português deste README ainda está na fila.

ai-sandbox

ci image release

Run AI coding agents (Claude Code, pi, etc.) in a Docker container instead of directly on your laptop. Each project gets its own container, and the container can only see the folders you explicitly mount in. If the agent goes wrong, you lose the container — not your home directory.

The CLI is called psb. One command spins up (or re-enters) a sandbox for the current project and drops you into a shell where claude and pi are already installed.

architecture

Install

make build       # builds ./bin/psb — put it on your $PATH
psb build        # builds the Docker image (one-time, ~5 min)

You need Docker running. On macOS, colima works well (colima start).

Use it

cd ~/dev/my-project
psb              # first run: creates a container, drops you into zsh
                 # next runs: re-enters the same container

Inside the container, run claude or pi like you normally would.

CommandWhat it does
psbEnter the sandbox for the current project.
psb stopStop the current project's container.
psb rmDelete the current project's container.
psb lsList all sandboxes.
psb statusShow one container's status.
psb buildRebuild the image.

What gets mounted

By default the container only sees the project directory. Anything else you want available — your .gitconfig, dotfiles, a shared library — you list in a config file:

~/.config/ai-sandbox/config.json

{
  "default": {
    "mounts": [
      "{{HOME}}/.gitconfig",
      "{{HOME}}/.claude/settings.json",
      "{{CWD}}"
    ]
  },
  "projects": {
    "/Users/me/dev/my-project": {
      "extra_mounts": ["~/dev/shared-lib"],
      "memory": "8g",
      "cpus": 4,
      "ports": ["3000:3000", "8000:8000"]
    }
  }
}
  • mounts — the full list. Each entry becomes a -v bind mount. Write src to mount a host path at the same path inside the container, or src:dest to mount it at a different path (e.g. a repo-local gitconfig at ~/.gitconfig inside the sandbox).
  • extra_mounts — appended to mounts. Use for per-project additions.
  • memory, cpus, image — optional per-project overrides.
  • ports — each entry becomes a -p host:container publish, so a server you start inside the sandbox is reachable from your laptop browser. With "3000:3000", a dev server on :3000 inside shows up at http://localhost:3000 on the host.

Two sandboxes can both serve :3000 inside, but the host side of a publish is shared: if two projects map to the same host port (e.g. both "3000:3000"), only the first container binds and the second fails with port is already allocated. Give each project a distinct host port for the same container port: "3001:3000", "3002:3000", and so on. Ports are fixed when the container is created, so changing them needs psb rm followed by psb.

Placeholders: {{HOME}}, {{CWD}}, {{SHARED_DIR}}. Shell-style ~/ and $VAR also work, on both sides of a src:dest entry. Paths that don't exist on the host are skipped with a warning.

Environment overrides

VarDefault
PSB_IMAGE_NAMEai-sandbox-pi:latest
PSB_MEMORY4g
PSB_CPUS2
PSB_SHARED_DIR~/sb-shared
PSB_CONFIG_FILE~/.config/ai-sandbox/config.json
ANTHROPIC_API_KEYpassed through to the container

What's in the image

Debian slim with claude, pi, Node, Go, uv, pixi, git, zsh. The container runs as a non-root user whose UID/GID matches your host, so files you create inside stay writable from outside.

Ver o original no GitHub

Bom para

Relacionados