claude-code - 💡(How to fix) Fix [DOCS] Sandboxing docs overstate auto-allow behavior for dangerous `rm`/`rmdir` paths

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

The current docs describe sandbox auto-allow as if sandboxed Bash commands always run without prompting, with no documented exception for destructive rm/rmdir targets. That is now outdated and can mislead users or administrators into thinking autoAllowBashIfSandboxed suppresses all prompts for sandboxed filesystem deletions. Update the sandboxing and related permission docs to explicitly document this exception.

Root Cause

The missing nuance is that dangerous-path safety checks still apply to destructive rm/rmdir commands even in sandbox auto-allow mode, so these commands are not silently auto-approved just because sandboxing is enabled.

RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/sandboxing

Section/Topic

Sandbox modesAuto-allow mode

Current Documentation

The docs currently say:

Auto-allow mode: Bash commands will attempt to run inside the sandbox and are automatically allowed without requiring permission. Commands that cannot be sandboxed (such as those needing network access to non-allowed hosts) fall back to the regular permission flow. Explicit deny rules are always respected. Ask rules apply only to commands that fall back to the regular permission flow.

Auto-allow mode works independently of your permission mode setting. Even if you're not in "accept edits" mode, sandboxed bash commands will run automatically when auto-allow is enabled. This means bash commands that modify files within the sandbox boundaries will execute without prompting, even when file edit tools would normally require approval.

Related permission docs also say:

When sandboxing is enabled with autoAllowBashIfSandboxed: true, which is the default, sandboxed Bash commands run without prompting even if your permissions include ask: Bash(*). The sandbox boundary substitutes for the per-command prompt.

What's Wrong or Missing?

Changelog v2.1.116 documents a security change: sandbox auto-allow no longer bypasses the dangerous-path safety check for rm/rmdir targeting /, $HOME, or other critical system directories.

The current docs describe sandbox auto-allow as if sandboxed Bash commands always run without prompting, with no documented exception for destructive rm/rmdir targets. That is now outdated and can mislead users or administrators into thinking autoAllowBashIfSandboxed suppresses all prompts for sandboxed filesystem deletions.

The missing nuance is that dangerous-path safety checks still apply to destructive rm/rmdir commands even in sandbox auto-allow mode, so these commands are not silently auto-approved just because sandboxing is enabled.

Suggested Improvement

Update the sandboxing and related permission docs to explicitly document this exception.

Suggested addition near the Auto-allow mode description:

Even in auto-allow mode, Claude Code still applies dangerous-path safety checks to destructive rm and rmdir commands. Targets such as /, $HOME, and other critical system directories are not silently auto-approved just because the command is sandboxed.

Also add a short cross-reference from the autoAllowBashIfSandboxed setting/reference docs so readers do not interpret it as a blanket bypass for destructive filesystem commands.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/sandboxingAuto-allow mode says sandboxed Bash commands are automatically allowed and run without prompting
https://code.claude.com/docs/en/permissionsSays sandboxed Bash commands run without prompting when autoAllowBashIfSandboxed: true
https://code.claude.com/docs/en/settingsautoAllowBashIfSandboxed setting description says "Auto-approve bash commands when sandboxed"
https://code.claude.com/docs/en/agent-sdk/typescriptSandboxSettings.autoAllowBashIfSandboxed description says "Auto-approve bash commands when sandbox is enabled"
https://code.claude.com/docs/en/agent-sdk/pythonSandboxSettings.autoAllowBashIfSandboxed description says "Auto-approve bash commands when sandbox is enabled"

Total scope: 5 pages affected

Source: Changelog v2.1.116

Exact changelog entry:

Security: sandbox auto-allow no longer bypasses the dangerous-path safety check for rm/rmdir targeting /, $HOME, or other critical system directories

extent analysis

TL;DR

Update the documentation for sandboxing and related permissions to reflect that dangerous-path safety checks still apply to destructive rm and rmdir commands in auto-allow mode.

Guidance

  • Review the current documentation for Auto-allow mode and autoAllowBashIfSandboxed to identify areas where the language implies that sandboxed Bash commands always run without prompting.
  • Add explicit documentation to clarify that dangerous-path safety checks apply to destructive rm and rmdir commands, even in auto-allow mode, to prevent misleading information.
  • Cross-reference the updated documentation with the autoAllowBashIfSandboxed setting to ensure consistency and clarity.
  • Verify the changes by reviewing the affected pages (listed in the Additional Context section) to ensure the updated information is accurately reflected.

Example

No code snippet is necessary for this issue, as it pertains to documentation updates.

Notes

The suggested improvement aims to clarify the behavior of sandbox auto-allow mode regarding destructive rm and rmdir commands, which is essential for user understanding and security.

Recommendation

Apply the suggested documentation updates to ensure accurate information and prevent potential misunderstandings about the feature's behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] Sandboxing docs overstate auto-allow behavior for dangerous `rm`/`rmdir` paths