fix(examples/settings): make bash-sandbox example fail closed when sandbox unavailable - #81421
Open
mholovetskyi wants to merge 1 commit into
Open
fix(examples/settings): make bash-sandbox example fail closed when sandbox unavailable#81421mholovetskyi wants to merge 1 commit into
mholovetskyi wants to merge 1 commit into
Conversation
…ndbox unavailable The settings-bash-sandbox.json example is documented as 'Bash tool must run inside of sandbox', but without failIfUnavailable Claude Code falls back to running commands unsandboxed (with a warning) whenever the sandbox cannot initialize - including on all native Windows hosts and Linux hosts without bubblewrap. Add failIfUnavailable: true to match the managed-enforcement configuration recommended in the sandboxing docs, and document the platform constraint in the README. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
examples/settings/settings-bash-sandbox.jsonis documented in the README table as "Bash tool must run inside of sandbox", but the config omitsfailIfUnavailable. Per the sandboxing docs, when the sandbox cannot initialize, Claude Code shows a warning and runs commands without sandboxing — and the sandbox does not run on native Windows at all, nor on Linux hosts missing bubblewrap.So as written, the enforcement example silently fails open exactly where enforcement matters most: an organization deploying this file as managed policy across a mixed fleet gets unsandboxed Bash on every Windows machine, with no policy violation surfaced.
Fix
"failIfUnavailable": trueto thesandboxblock. This matches the managed-enforcement snippet recommended in the sandboxing docs (enabled+failIfUnavailable+allowUnsandboxedCommands: false).examples/settings/README.mddocumenting the macOS/Linux/WSL2 platform constraint and the fail-open default, so admins merging these snippets understand the behavior.Notes
failIfUnavailableand for changes to this example before filing — found none.🤖 Generated with Claude Code