Strands Box vs Claude Code Sandbox vs Docker Sandboxes
The short answer
The built-in sandboxes in Claude Code and Codex limit shell commands; Strands Box and Docker Sandboxes wrap the whole agent. That difference decides most choices. As of December 4, 2026:
- Claude Code sandbox — free, built in, off by default. Good first step; shell commands only.
- Codex sandbox — on by default locally: writes limited to the workspace, network off.
- Strands Box — wraps any coding agent; one policy for shell, network and MCP calls; keys never enter the box. Preview.
- Docker Sandboxes — microVM per agent, local or cloud, with paid team-wide policy management.
Compared
| Claude Code sandbox | Codex sandbox | Strands Box | Docker Sandboxes | |
|---|---|---|---|---|
| What is inside the boundary | Shell commands and their children | Model-generated commands | The whole agent process | The whole agent, in a microVM |
| Default state | Off; enable with /sandbox | On locally | Opt in (box run claude) | Opt in (sbx) |
| Network | Proxy with allowlist that starts empty | Off by default | Default-deny policy per host and per call | Per-sandbox network policies |
| File reads | Most of the machine, incl. ~/.ssh, unless denied | Typically the workspace | Only what you grant | Mounted workspace |
| MCP tool calls | Run outside the sandbox | Governed by approvals | Checked against policy | Via Docker’s MCP gateway |
| Secrets | Inherited env unless scrubbed | Per environment | Placeholder; real key injected on egress | Credential handling per sandbox |
| Platforms | macOS, Linux, WSL2 | CLI, IDE extension, desktop app | macOS 15+ Apple silicon, Linux ARM64/x86-64 | Local and Docker cloud |
| Price | Included | Included | Free, Apache-2.0 | Local free; cloud and org policies paid |
| Works with | Claude Code | Codex | Claude Code, Codex, Kiro CLI, pi | Several coding agents |
Read from each vendor’s documentation and the Strands Box repository on December 4, 2026.
Claude Code’s sandbox
Claude Code’s sandbox is an OS-enforced boundary around the shell commands Claude runs, built on Anthropic’s open-source @anthropic-ai/sandbox-runtime. It is off by default; turn it on with /sandbox or sandbox.enabled: true. Writes are limited to the working directory, a temp directory and added directories. Network goes through a local proxy that checks each host against allowed domains, which start empty. Two caveats from the documentation: reads cover most of the machine, including ~/.ssh and ~/.aws/credentials, until you add denyRead rules; and file tools, MCP servers and hooks run outside it. Native Windows runs unsandboxed; use WSL2.
Codex’s sandbox
Codex combines a sandbox mode (what it can technically do) with an approval policy (when it must ask). Locally it uses an OS-enforced sandbox that by default keeps writes to the active workspace and turns network access off. Note that approval_policy = "untrusted" is retired (per OpenAI’s docs, read December 4, 2026) and can stop Codex from starting; use trust_level = "untrusted" per project instead.
Strands Box
Strands Box comes from AWS’s open-source Strands Agents project and was presented with the Strands toolkit at re:Invent 2026. You create a profile once (box profile create claude --with bedrock) and start the agent with box run claude from any project. The agent runs in an OS sandbox; every shell command, network request and MCP tool call is checked against a policy before it runs, outside the model, so nothing the agent reads can change the decision. Policies are written in Dogwood and can depend on history, for example forbidding git push unless npm test passed in the last hour, or capping a server at 60 calls an hour. Keys stay outside: the agent sees a placeholder and Box inserts the real key as the request leaves. The underlying Box Core engine runs on a cloud host or embeds in Rust. It is in preview (v0.3.3, November 27, 2026); read its Limitations page before trusting it with important work.
Docker Sandboxes
Docker Sandboxes run coding agents in microVMs on your machine or on Docker-managed cloud compute, managed with the sbx CLI, with an API and SDK for creating cloud sandboxes from your own app. Local use is free, including commercially; cloud compute is pay-as-you-go, and organisation admins can centrally manage network, filesystem and MCP policies on a separate paid subscription.
Which to pick
- Solo developer, interactive use → enable the built-in sandbox, add
denyReadfor credential folders. - Unattended or permission-prompts-off runs on a laptop → Strands Box.
- A team that needs the same policy on every machine → Docker Sandboxes with org policies.
- Long jobs that should not run on a laptop at all → a remote sandbox; see best AI agent sandboxes and Docker vs process vs remote sandboxes.
Last verified: December 4, 2026.