---
title: "Sandbox Auto-Allow Is Now an Opt-In in Claude Code"
term: "Sandbox Auto-Allow Opt-In"
description: "Since Claude Code 2.1.325, sandboxed Bash commands follow the normal permission flow unless sandbox.autoAllowBashIfSandboxed is true. Set it in the managed source Claude Code reads."
tags:
  - agent-design
  - security
  - automation
  - claude
aliases:
  - sandbox auto-allow default change
  - autoAllowBashIfSandboxed default
  - regular permissions mode sandbox
applies_to: "claude-code@2.x"
last_reviewed: 2026-12-03
maturity: emerging
status: current
---

# 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](https://code.claude.com/docs/en/changelog#2-1-325)). To run sandboxed commands without a prompt, you now set both `sandbox.enabled` and the auto-allow key ([settings reference](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed)).

## What changed

The settings reference says "Default: `false`. Before v2.1.324, the default was `true`" ([settings reference](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed)). 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](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed), [sandboxing guide](https://code.claude.com/docs/en/sandboxing#repository-settings-under-an-admin-required-sandbox)).

Anthropic's engineering post says "sandboxing safely reduces permission prompts by 84%" in its internal usage ([Beyond permission prompts](https://www.anthropic.com/engineering/claude-code-sandboxing)). 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](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed), [auto-allow mode](https://code.claude.com/docs/en/sandboxing#auto-allow-mode), [regular permissions mode](https://code.claude.com/docs/en/sandboxing#regular-permissions-mode), and [excluded commands](https://code.claude.com/docs/en/sandboxing#run-commands-outside-the-sandbox-with-excludedcommands).

## What the opt-in leaves on the regular flow

Setting the key to `true` does not end every prompt ([sandboxing guide](https://code.claude.com/docs/en/sandboxing#auto-allow-mode)):

- 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`, and `eval "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](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed)).

## 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](https://code.claude.com/docs/en/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](https://code.claude.com/docs/en/managed-settings#how-claude-code-combines-managed-sources)). `/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](https://code.claude.com/docs/en/sandboxing#repository-settings-under-an-admin-required-sandbox)).

## 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](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting)). 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:

```json
{
  "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](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting)). 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](https://code.claude.com/docs/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes)). 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](https://code.claude.com/docs/en/sandboxing#disable-filesystem-isolation)). 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, `denyInsteadOfPrompting` denies them unless an allow rule or the permission mode approves them.
- You leave it off for an unattended job. The `denyInsteadOfPrompting` key exists "to keep a session running when nobody is there to answer a permission prompt" ([settings reference](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting)), and the [deny-fallback posture](deny-fallback-unattended-permissions.md) 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](https://code.claude.com/docs/en/settings-reference#sandbox-autoallowbashifsandboxed)):

```json
{
  "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.enabled` and `sandbox.autoAllowBashIfSandboxed` as 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 `/status` on 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 `denyInsteadOfPrompting` reading before you depend on it.

## Related

- [Deny-Fallback Permissions for Unattended Agent Runs](deny-fallback-unattended-permissions.md) — 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](unattended-skill-allow-rule.md) — a second 2.1.325 change that adds a prompt to unattended runs
- [Sandbox Capability Opt-In as a Compatibility Setting](../anti-patterns/sandbox-capability-opt-in-as-compatibility-setting.md) — a sandbox key whose grant also runs without a prompt under auto-allow
- [Scope Demotion for Repository-Committed Settings](../../security/repo-committed-settings-scope-demotion.md) — which settings keys a repository's committed file may set
- [Working Inside an Enterprise-Managed Agent Sandbox Policy](../../security/enterprise-managed-agent-sandbox.md) — the managed floor that this key sits beside
