skip to content

In Claude Code's sandbox auto-allow mode, which Bash commands still prompt, and how does regular permissions mode differ?

level: seniorimportance: should knowfreq 11%

answer

  1. same boundary, different approval
  2. autoAllowBashIfSandboxed defaults to true
  3. deny and content-scoped ask still bite
  4. leaving the sandbox means the normal flow
  5. not the same as auto mode

basics

~20 s

Auto-allow (autoAllowBashIfSandboxed, default true) runs sandboxed commands without a prompt, but deny rules, content-scoped ask rules, critical-path rm and anything running outside the sandbox still go through the normal flow. Regular mode prompts as usual inside the same boundary.

solid answer

~50 s

Both sandbox modes enforce the same filesystem and network limits; they differ only in approval. **Auto-allow**, the default because `sandbox.autoAllowBashIfSandboxed` is `true`, approves a command automatically when it runs inside the sandbox, even in Manual mode, where the Edit tool would still prompt. What still applies: deny rules, content-scoped ask rules such as `Bash(git push *)`, and `rm` or `rmdir` aimed at a critical path. Any command that leaves the sandbox, through `excludedCommands` or an unsandboxed retry, also goes through the regular permission flow. A bare `Bash` ask rule is skipped for sandboxed commands, except in plan mode. **Regular permissions mode** (`autoAllowBashIfSandboxed: false`) sends every Bash command through the normal flow, so your allow rules and permission mode decide, and the sandbox still limits what approved commands can reach. Auto-allow is not auto mode: auto mode uses a classifier, while auto-allow trusts the OS boundary.

go deeper

for a junior

Recall that both modes enforce the same limits, and that auto-allow only skips the prompt for commands that run inside the sandbox.

for a middle

List what still prompts under auto-allow: deny rules, content-scoped ask rules, critical-path removals and anything that leaves the sandbox.

for a senior

Point out the Manual-mode asymmetry, where Bash edits run silently while Edit prompts, and add ask rules for the commands a team must always see.

for a principal

Decide where the boundary is a good enough substitute for review, and where a human must still see the command whatever the sandbox contains.

## Two modes, one boundary When the sandbox is on, the `/sandbox` panel's **Mode** tab offers two choices, backed by a single setting: | Mode | Setting | What decides whether a sandboxed command runs | | --- | --- | --- | | Auto-allow | `sandbox.autoAllowBashIfSandboxed: true` (the default) | The sandbox boundary; no prompt for a command that runs inside it | | Regular permissions | `sandbox.autoAllowBashIfSandboxed: false` | Your allow, ask and deny rules and your permission mode, as if there were no sandbox | In both modes the **operating system enforces the same filesystem and network limits**. The choice changes only who approves a command *before* it runs. Regular mode gives you more control and more prompts; you would pick it when you want to read every command but still want a hard limit on what an approved command can do. ## What auto-allow approves Auto-allow approves a command because the sandbox contains it. Once you pick it, a build, a test run or a `sed -i` on a project file runs without a prompt. That is true **even in Manual mode**, where the file-editing tools would still ask. So auto-allow works mostly independently of your permission mode. A Bash command that modifies files inside the boundary runs silently, while the same change made with the Edit tool prompts. Keep that asymmetry in mind before turning it on for someone who expects Manual mode to mean "ask before every change". The exceptions to that independence are plan mode, auto mode commands that name their own network hosts, and server-side classifier review in auto mode. ## What still prompts or blocks in auto-allow Auto-allow does not switch off the rest of the permission system: - **Deny rules** always apply. A denied command is refused whether or not it is sandboxed. - **Content-scoped ask rules** still force a prompt. With `Bash(git push *)` in `permissions.ask`, a sandboxed `git push origin main` still asks. - **`rm` and `rmdir` aimed at a critical path** go through the regular permission flow. - **Commands outside the sandbox** go through the regular flow: anything matching `sandbox.excludedCommands`, and any retry Claude makes with the `dangerouslyDisableSandbox` parameter. In Manual mode their prompt is titled "Bash command (unsandboxed)". - **Network access to a host that is not allowed** is a separate decision. The command stays in the sandbox and waits, and your permission mode decides: a prompt in Manual mode, a refusal in `dontAsk` mode. One rule is deliberately relaxed. A **bare `Bash` ask rule**, or its `Bash(*)` equivalent, is skipped for sandboxed commands, because the boundary stands in for that whole-tool prompt. It still applies to commands that fall back to the regular flow. ## Plan mode is the exception In plan mode, auto-allow does **not** widen approvals. Read-only commands from the built-in set still run, other shell commands go through the regular flow while you plan, and a bare `Bash` ask rule prompts even for sandboxed read-only commands. ## Auto-allow is not auto mode The names are close, and candidates often mix them up: 1. **Auto-allow** is a sandbox setting. It approves Bash commands because an OS boundary contains them, and it does nothing for other tools. 2. **Auto mode** is a permission mode. A classifier model reviews actions across tools before they run. 3. The two are independent and can be combined. In auto mode with the sandbox on, Claude can attach the hosts a command needs to the command itself, and the classifier reviews them together. A command that carries hosts goes to the classifier instead of being auto-allowed. ## Choosing between them - Use **auto-allow** on your own machine to cut prompts during build-and-test loops, with deny and ask rules for the few commands you always want to see, such as pushes or deploys. - Use **regular permissions** when you need to see each command, for example while reviewing what an unfamiliar workflow runs, but still want an OS limit behind each approval. - Keep `permissions.deny` entries for commands that must never run. Auto-allow honours them, and they hold whichever sandbox mode a developer picks. - Remember that auto-allow does nothing for Read, Edit or WebFetch. Those tools follow permission rules and modes, which are configured separately.

  • Your settings have a bare `Bash` ask rule, and sandboxed commands run without asking. Is that a bug?
    No. With `autoAllowBashIfSandboxed` at its default of `true`, the sandbox boundary stands in for a bare `Bash` (or `Bash(*)`) ask rule, so sandboxed commands skip it. Commands that run outside the sandbox still hit it, and in plan mode it applies to sandboxed commands too. For a prompt on specific commands, use a content-scoped ask rule such as `Bash(git push *)`, or switch to regular permissions mode.
  • Which setting turns auto-allow off, apart from the Mode tab?
    Set `sandbox.autoAllowBashIfSandboxed` to `false` in a settings file; the `/sandbox` Mode tab writes the same key. Setting `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` also turns auto-allow off. A repository can change this value even when an administrator has made the sandbox admin-required, so an organization that cares should set it in managed settings.

Auto-allow is like a fenced yard: inside the fence nobody has to approve each step, but some gates stay locked regardless (deny rules), some still need a word first (pushes), and leaving through the gate always needs permission.

  • Auto-allow and auto mode are the same feature under two names.
  • Deny rules are skipped for sandboxed commands in auto-allow mode.
  • Regular permissions mode turns off the sandbox's filesystem limits.
  • Auto-allow only takes effect in acceptEdits mode.
  • A Bash(git push *) ask rule stops applying once commands are sandboxed.
  • Excluded commands are auto-approved because the sandbox is on.