Repository navigation
fix(permissions): skip user/managed-only claudecode sandbox keys at project scope - #2694
Merged
Merged
Conversation
dyoshikawa
force-pushed
the
resolve-issue-2664-claudecode-sandbox-scope
branch
2 times, most recently
from
August 17, 2026 10:06
ff333d9 to
9f72367
Compare
…roject scope Part of #2664
dyoshikawa
force-pushed
the
resolve-issue-2664-claudecode-sandbox-scope
branch
from
August 17, 2026 10:34
9f72367 to
8f769a9
Compare
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.
Background
claudecode.sandboxwas deep-merged into whateversettings.jsonwas being written, with no key inspection and no scope check — the same subtree for project and global. But Claude Code honors a subset ofsandbox.*only from user settings, managed settings and--settings, and ignores it in a repository's.claude/settings.json/.claude/settings.local.json.Net effect before this change: a user who authors
claudecode.sandbox.network.strictAllowlist: trueand runs a project-scope generate gets a committed.claude/settings.jsonthat reads as though it enforced a sandbox policy and does nothing. ForstrictAllowlistand the credential keys that is a security-relevant silent no-op.Verified against primary sources rather than the issue text — which is why the shipped list is narrower than the one proposed there:
filesystem.disabled("Project settings in.claude/settings.jsonand.claude/settings.local.jsoncan't"),network.strictAllowlist("Setting it in a repository's ... has no effect"),network.tlsTerminate+credentials.allowPlaintextInject("all ignored in a repository's ..."),credentials.awsPairsandcredentials.sigv4("honored only from user settings, managed settings, and the--settingsCLI flag"),allowAppleEvents("Project settings cannot enable it").sandbox.ripgrepto be honored only from user, managed, and--settingssettings".Two corrections to the issue's proposed list, both recorded in a code comment:
bwrapPath/socatPathare not included. The v2.1.232 entry puts them in the managed-settings approval dialog ("requires approval for server-managed sandbox binary overrides"), which is a consent prompt, not a project-scope rejection.credentials.maskis not a settings key. What the docs scope ismaskentries insidecredentials.files, i.e. a per-entrymode. The same list carriesdenyentries that project settings do honor, so dropping it would remove real restrictions.Changes
CLAUDECODE_GLOBAL_ONLY_SANDBOX_PATHS+stripGlobalOnlySandboxPaths, applied to the override copy only when generating project scope, warning once per dropped path. A value already hand-written in the target file is left untouched — theqwencodesecurity.allowPrivateNetworkHooksprecedent.docs/reference/file-formats.md;bwrapadded tocspell.json.deniedDomainsrestriction surviving beside the droppedstrictAllowlist), global-scope passthrough, and hand-written-value preservation. The existing deep-merge test now usesnetwork.allowedDomains, a key project settings do honor, so it still tests the merge rather than the new filter.e2e-permissions.spec.tsre-run locally (85 passed). This is the only gap the 2026-08-17 re-check added to #2664; the dynamic-workflows and scheduled-task items are unaffected, so the issue stays open.Part of #2664