What runs where#
One request leaves the sandbox#
Sandbox lifecycle#
| Task | Code |
|---|
| Create on a repository | sbx create shell <path> --name <name> |
|---|
| Attach again | sbx run --name <name> |
|---|
| Run a command as root | sbx exec -u root <name> sh -c '<cmd>' |
|---|
| Copy a file in | sbx cp <host-file> <name>:/tmp/in.txt |
|---|
| Publish a port | sbx ports <name> --publish 18081:8080 |
|---|
| Stop and keep state | sbx stop <name> |
|---|
| Remove stopped sandboxes | sbx prune --force |
|---|
Secrets, MCP and health#
| Task | Code |
|---|
| Bind a secret to hosts | sbx secret set-custom --host <host> --env <VAR> --value <value> |
|---|
| Find keys in host env | sbx secret import --dry-run |
|---|
| Register an MCP server | sbx mcp add <name> --url <url> |
|---|
| Attach it to a sandbox | sbx mcp load <name> --sandbox <sandbox> |
|---|
| Run the 13 checks | sbx diagnose |
|---|
| Save a template | sbx template save <name> <tag> --output <file>.tar |
|---|
| Run an agent file in a sandbox | docker-agent run --sandbox --exec <agent-file> '<prompt>' |
|---|
Clone mode round trip#
sbx create --clone shell <repo> \private clone, host repo read-only
--name <name>source at /run/sandbox/source
sbx exec <name> sh -c '<edit and git commit>'agent commits in the clone
git -C <repo> remote -vsbx added sandbox-<name>
git -C <repo> fetch sandbox-<name>bring the commits back
sbx rm --force <name>VM, state and scoped secrets go
What the agent sees inside#
| Command | What it does |
|---|
HTTPS_PROXY=http://gateway.docker.internal:3128 | Forward proxy for HTTP and HTTPS |
|---|
ANTHROPIC_API_KEY=proxy-managed | Sentinel. The real key stays on the host |
|---|
M101_RECV_KEY=sbx-cs-<rand> | Custom secret placeholder |
|---|
SSH_AUTH_SOCK=/run/ssh-agent.sock | Host SSH agent, forwarded by default |
|---|
forward-bypass | Log proxy type. Tunnel, no inspection |
|---|
transparent | Log proxy type. Other TCP, no injection |
|---|
"deny_kind": "explicit" | A rule denied it. implicit means no allow |
|---|