What this thread does
Do first: Run /sandbox to inspect dependencies and resolved settings; set sandbox.enabled to true.
Short answer
As of November 2026, the OS boundary covers shell commands and their children on macOS, Linux and WSL2. File tools, web tools, hooks and MCP servers use separate controls.
What to do
| Control | Accepted value / default / action |
|---|---|
sandbox.enabled | Boolean; default false; set true |
sandbox.allowUnsandboxedCommands | Boolean; default true; set false to ignore dangerouslyDisableSandbox retries |
sandbox.failIfUnavailable | Boolean; default false; true exits if startup cannot support sandboxing, and refuses later sandboxed commands if initialization fails |
sandbox.autoAllowBashIfSandboxed | Boolean; default false since v2.1.324, previously true; false retains regular permissions, true selects auto-allow |
sandbox.filesystem.allowWrite | Path-string array; unset by default; adds writable paths such as /tmp/build |
sandbox.filesystem.denyWrite | Path-string array; unset; blocks writes even under writable paths; examples /etc, /usr/local/bin |
sandbox.filesystem.denyRead / allowRead | Path-string arrays; unset; block reads / reopen a narrower part of a blocked region |
sandbox.network.allowedDomains | Domain, wildcard or IP strings with optional :port; unset, initially no preallowed hosts |
sandbox.network.deniedDomains | Same syntax; unset; a matching deny wins over an allow |
sandbox.network.strictAllowlist | Boolean; default false; true blocks unlisted hosts instead of asking, from v2.1.219 |
For one session, use claude --settings '{"sandbox":{"enabled":true,"allowUnsandboxedCommands":false,"failIfUnavailable":true,"network":{"strictAllowlist":true}}}', then admit required hosts through trusted settings. strictAllowlist accepts user, managed or CLI settings; repository .claude/settings.json and .claude/settings.local.json cannot set it. The effective allowlist also includes WebFetch(domain:...) allow rules.
Default writes cover the working directory, a per-user temporary directory and directories added with --add-dir, /add-dir or permissions.additionalDirectories. Reads otherwise cover most of the machine: sandboxing does not make reads workspace-only. Path arrays merge across loaded scopes; narrower read rules take precedence. A . path resolves to project root in project settings.
The /sandbox panel saves project choices in .claude/settings.local.json. Strict retry mode appears on Overrides. A user/CLI/managed false holds against a project true from v2.1.285; CLI or managed strict retry mode also makes the sandbox admin-required.
macOS uses Seatbelt. Linux and WSL2 require bubblewrap and socat; Ubuntu/Debian install command: sudo apt-get install bubblewrap socat. Restart after installing dependencies.
Limits and open questions
sandbox.excludedCommands entries run outside the boundary. User-entered ! shell commands usually also run outside it. A shell denyRead does not block the Read tool; allowedDomains does not limit WebFetch.
Proxy-aware TCP tools can reach admitted hosts; plain SSH and typical database clients ignore proxy variables and cannot connect merely because a host is listed. UDP, QUIC and ICMP cannot leave. A domain without a port permits every port. Host filtering does not inspect encrypted request contents. No release date is given for the cited version changes.
Not for: native Windows sandboxing; use WSL2.
Sources
- Sandboxing documentation, Anthropic.
- Sandbox settings reference, Anthropic.
Checked
2026-11-16; read Sandboxing documentation; Sandbox settings reference; no command was run.
Started from a post by @Anthropic, packaged by the editor. Original post