# Sandbox ladder

> OS-level Bash sandboxing cut Anthropic's permission prompts ~84%, but /sandbox only wraps Bash. Climb to sandbox-runtime, container, or VM for a boundary.

URL: https://bartlomiejkrupa.dev/notes/sandbox-ladder/
Category: concept | Updated: 2026-10-07
Summary: OS-level Bash sandboxing cut Anthropic's permission prompts ~84%, but /sandbox only wraps Bash. Climb to sandbox-runtime, container, or VM for a boundary.

The **sandbox ladder** is the set of isolation tiers around Claude Code. `/sandbox` (Seatbelt on macOS, bubblewrap on Linux/WSL2) wraps Bash and its children at the OS level and cut permission prompts ~84% in Anthropic's measurements - but Read, Edit, MCP, and hooks stay on the host until you climb higher.

| Approach | What is isolated | When |
| --- | --- | --- |
| Sandboxed Bash (`/sandbox`) | Bash + children only | Everyday local work |
| `@anthropic-ai/sandbox-runtime` | Whole Claude process | Unattended runs; untrusted MCP |
| Dev / custom container | Full environment | Team standard; skip-permissions with firewall |
| VM | Full OS separation | Untrusted repos; compliance |
| Claude Code on the web | Anthropic-managed VM | No local setup |

## Scope gap

| Mechanism | Bash children | Read / Edit | MCP / hooks |
| --- | --- | --- | --- |
| Permission rules | Pattern-matched | Yes | Yes (per tool) |
| `/sandbox` | Yes (OS) | No | No |
| Runtime / container / VM | Yes | Yes (inside boundary) | Yes |

Defaults under `/sandbox`: write to working directory + a per-user temp directory (`$TMPDIR`); read nearly the whole machine (including `~/.aws` and `~/.ssh` unless denied); no network domains pre-allowed. Close the credential hole with `sandbox.credentials` and matching `permissions.deny` for `Read(~/.ssh/**)` and `Read(./.env*)`. `--dangerously-skip-permissions` needs a container, VM, or sandbox-runtime - Bash sandbox alone is not that boundary.

Full playbook: [Claude Code security in 2026](/articles/claude-code-security-sandboxing-2026). Pair with [permission rules](/notes/permission-rules-block) and the [read/mutate split](/notes/read-mutate-permission-split).

Sources:
- Configure the sandboxed Bash tool: https://code.claude.com/docs/en/sandboxing
- Choose a sandbox environment: https://code.claude.com/docs/en/sandbox-environments
- Making Claude Code more secure and autonomous with sandboxing: https://www.anthropic.com/engineering/claude-code-sandboxing
