AI agents · OpenClaw · self-hosting · automation

Quick Answer

Strands Box vs Claude Code Sandbox vs Docker Sandboxes

Published:

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 sandboxCodex sandboxStrands BoxDocker Sandboxes
What is inside the boundaryShell commands and their childrenModel-generated commandsThe whole agent processThe whole agent, in a microVM
Default stateOff; enable with /sandboxOn locallyOpt in (box run claude)Opt in (sbx)
NetworkProxy with allowlist that starts emptyOff by defaultDefault-deny policy per host and per callPer-sandbox network policies
File readsMost of the machine, incl. ~/.ssh, unless deniedTypically the workspaceOnly what you grantMounted workspace
MCP tool callsRun outside the sandboxGoverned by approvalsChecked against policyVia Docker’s MCP gateway
SecretsInherited env unless scrubbedPer environmentPlaceholder; real key injected on egressCredential handling per sandbox
PlatformsmacOS, Linux, WSL2CLI, IDE extension, desktop appmacOS 15+ Apple silicon, Linux ARM64/x86-64Local and Docker cloud
PriceIncludedIncludedFree, Apache-2.0Local free; cloud and org policies paid
Works withClaude CodeCodexClaude Code, Codex, Kiro CLI, piSeveral 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

  1. Solo developer, interactive use → enable the built-in sandbox, add denyRead for credential folders.
  2. Unattended or permission-prompts-off runs on a laptop → Strands Box.
  3. A team that needs the same policy on every machine → Docker Sandboxes with org policies.
  4. 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.

Sources