fix(sandbox): drop deny rules that file permission checks never match - #1122
Merged
Conversation
`Write(.claude/settings.json)` and `Write(.claude/settings.local.json)` looked like they guarded those two files, but file permission checks only match `Edit(path)` rules — a `Write(...)` deny rule is inert. Both paths are already covered by the `Edit(...)` deny rules immediately above, which apply to every file-editing tool, so removing the dead pair loses no protection and stops the settings block from implying a guard that was not there. Mirrors the removal into the sandbox-lint baseline, as every change to the live sandbox must be (docs/security/threat-model.md mitigation M.29).
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.
Summary
Write(.claude/settings.json)andWrite(.claude/settings.local.json)looked like theyguarded those two files, but file permission checks only match
Edit(path)rules — aWrite(...)deny rule is inert. Both paths are already covered by theEdit(...)deny rulesimmediately above, which apply to every file-editing tool, so removing the dead pair loses no
protection and stops the settings block from implying a guard that was not there.
tools/sandbox-lint/expected.json, as every change to the livesandbox must be (docs/security/threat-model.md mitigation M.29).
Type of change
Test plan
prek run --all-filespassesuv run pytestpasses intools/sandbox-lint— the baseline-vs-live drift check is thegate that catches an unmirrored settings change, and it fails without the
expected.jsonhalf of this commit.
RFC-AI-0004 compliance
already have it.
Notes for reviewers
Write(path)deny rules are honouredsomewhere I have not found, these two should stay and the
Edit(...)pair is the redundantone. The behaviour I relied on is that file permission checks match only
Edit(path), whichcovers all file-editing tools including Write.