Sandbox Auto-Allow Is Now an Opt-In in Claude Code¶
Since Claude Code 2.1.325, sandbox auto-allow is off by default, so sandboxed Bash commands follow the normal permission flow until you opt in.
The 2.1.325 changelog entry (November 13, 2026) reads "Changed sandboxed Bash commands to follow the normal permission flow by default; set sandbox.autoAllowBashIfSandboxed: true to keep running them without prompts" (changelog 2.1.325). To run sandboxed commands without a prompt, you now set both sandbox.enabled and the auto-allow key (settings reference).
What changed¶
The settings reference says "Default: false. Before v2.1.324, the default was true" (settings reference). The changelog index has no 2.1.324 section and lists the change under 2.1.325. A host on 2.1.325 or later satisfies both.
The key has scope Any file, so a repository's settings file can set it too (settings reference, sandboxing guide).
Anthropic's engineering post says "sandboxing safely reduces permission prompts by 84%" in its internal usage (Beyond permission prompts). The post is dated October 20, 2025 and reports no figure for regular permissions mode. Do not expect 84% from the new default.
Who approves what¶
The flip changes one row. Excluded commands and unsandboxed retries run outside the sandbox, so both modes send them to the regular flow.
| Command | Auto-allow true |
Unset or false |
|---|---|---|
| Runs inside the sandbox | Approved with no prompt, apart from the exceptions below | Regular permission flow |
Matches excludedCommands |
Regular permission flow | Regular permission flow |
| Claude retries it unsandboxed | Regular permission flow; a matching allow rule approves the retry | Regular permission flow |
Sources: settings reference, auto-allow mode, regular permissions mode, and excluded commands.
What the opt-in leaves on the regular flow¶
Setting the key to true does not end every prompt (sandboxing guide):
- Plan mode: "auto-allow doesn't widen approvals".
- Auto mode: the server-side classifier still reviews sandboxed commands.
FOO=bar npm test,make CC=clang, andeval "ls": allow rules and permission mode decide.- Content-scoped ask rules such as
Bash(git push *): they "still force a prompt even for sandboxed commands". - Monitor tool commands: they "aren't approved automatically, though they still run in the sandbox".
Setting CLAUDE_CODE_SUBPROCESS_ENV_SCRUB turns auto-allow off (settings reference).
Managed settings need the key in the source Claude Code reads¶
The same release changed managed settings that turn the sandbox on: "to keep commands running without prompts, set sandbox.autoAllowBashIfSandboxed: true in your highest-ranking managed source" (changelog 2.1.325).
The default first-wins rule explains it. Claude Code "uses the highest-ranked source that delivers at least one policy key and ignores the rest rather than merging them", with no warning for the sources it skips (managed settings). /status names the skipped ones.
My reading: the managed-settings page does not name this key among those it reads from every admin source, so a lower source that sets it has no effect. No page states that for this key.
An admin-required sandbox leaves a gap. The autoAllowBashIfSandboxed value still applies from a repository's files, so "Set the key in managed settings to keep a repository from changing it" (sandboxing guide).
Unattended runs under denyInsteadOfPrompting (my reading, not run by this site)¶
permissions.denyInsteadOfPrompting denies a tool call that would otherwise wait on a prompt, and "A call goes ahead if an allow rule, your permission mode, or auto mode's classifier approves it" (settings reference). Its entry never mentions the sandbox.
My reading of the two entries: with the auto-allow key unset, a sandboxed command that no allow rule covers would prompt, so the deny key denies it. With the key true, the command is approved first and the deny key never sees it. An excluded command reaches the deny key either way. No source states this.
This test is not run by this site. Save this as probe-settings.json in a scratch repository with no mkdir allow rule:
{
"sandbox": { "enabled": true },
"permissions": { "denyInsteadOfPrompting": true }
}
Start claude --settings ./probe-settings.json in the default permission mode and ask it to run mkdir probe-dir. The reading predicts a denial opening "Permission for this tool use was denied. It requires approval, and this session has no approval surface" (settings reference). Add "autoAllowBashIfSandboxed": true to the sandbox block and repeat. The reading predicts the directory appears. If either result differs, discard the reading.
Why it works¶
Auto-allow swaps a prompt for an operating-system boundary: "auto-allow approves Bash commands because the sandbox boundary contains them, while auto mode uses a classifier to review actions" (sandboxing guide). Before the change, setting sandbox.enabled also switched that swap on, because the key defaulted to true. Now drawing the boundary and trusting it as the approver are two settings.
When this backfires¶
- The sandbox has holes. With filesystem isolation off and commands auto-allowed, "a sandboxed command can write files that later commands run or read, such as shell startup files, executables on
$PATH, or~/.claude/settings.json" (sandboxing guide). Opting in removes the prompt in front of each such command. - A repository sets it. A committed settings file can flip the key unless managed settings set it.
- You expect zero prompts. The exceptions above go through the normal permission flow, so they can still prompt. On my reading above,
denyInsteadOfPromptingdenies them unless an allow rule or the permission mode approves them. - You leave it off for an unattended job. The
denyInsteadOfPromptingkey exists "to keep a session running when nobody is there to answer a permission prompt" (settings reference), and the deny-fallback posture covers what a denial costs.
Example¶
The settings reference gives the pair of keys that keep the sandbox on and run its commands without a prompt (settings reference):
{
"sandbox": {
"enabled": true,
"autoAllowBashIfSandboxed": true
}
}
For a fleet, put the sandbox block in the highest-ranked managed source. In a developer's own file it sets one machine.
Key Takeaways¶
- Treat
sandbox.enabledandsandbox.autoAllowBashIfSandboxedas two decisions. The first draws the boundary, the second makes it the approver. - Audit every unattended job and managed policy written before 2.1.325. Each one that relied on the old default now needs the key.
- Check
/statuson a managed machine to see which source Claude Code used. On my reading, the key does nothing in a skipped source. - Pin a managed value if a repository must not change it. An admin-required sandbox still honors the repository's value.
- Test the
denyInsteadOfPromptingreading before you depend on it.
Related¶
- Deny-Fallback Permissions for Unattended Agent Runs — the other half of an unattended posture: what happens to a call that reaches a prompt
- Allowing One Skill to Run in Scheduled Tasks and /loop — a second 2.1.325 change that adds a prompt to unattended runs
- Sandbox Capability Opt-In as a Compatibility Setting — a sandbox key whose grant also runs without a prompt under auto-allow
- Scope Demotion for Repository-Committed Settings — which settings keys a repository's committed file may set
- Working Inside an Enterprise-Managed Agent Sandbox Policy — the managed floor that this key sits beside