Repository navigation
fix(sandbox): deny agent edits to the vetted-ops policy - #1308
Merged
Merged
Conversation
The dispatcher's policy decides which caller may run which operation, so an agent able to rewrite it can grant itself the whole catalogue. The deny rules `setup-isolated-setup-update` checks for were never present in the framework's own dogfooded settings. Covers both surfaces the policy resolves to: the committed `.apache-magpie-overrides/tools/vetted-ops/` override and the `magpie-vetted-ops` plugin cache. The in-repo `tools/vetted-ops/` source is deliberately not denied — it is the framework's own code, gated by PR review, and a write-deny there makes the tree read-only to every sandboxed subprocess including `prek`'s fixers. Keeps `tools/sandbox-lint/expected.json` in step with the live settings. Generated-by: Claude Opus 5
3 tasks done
potiuk
added a commit
that referenced
this pull request
Sep 21, 2026
…hooks (#1309) #1308 added a `permissions.deny` rule on `.apache-magpie-overrides/tools/vetted-ops/**` without extending the `sandbox_write_denied` exclude that exists for exactly this case. A deny rule becomes a sandbox filesystem write-deny, so end-of-file-fixer, mixed-line-ending and trailing-whitespace abort `prek run --all-files` inside an agent session with `Operation not permitted`, even though the file needs no fix. The policy keeps its coverage: `vetted_ops.config` parses it on every dispatch, so a malformed file fails the call. Also states the rule in the comment, since the coupling is easy to miss: a new `permissions.deny` rule on an in-repo path needs that path added here too. Generated-by: Claude Opus 5
This was referenced Sep 21, 2026
potiuk
added a commit
to potiuk/magpie
that referenced
this pull request
Sep 21, 2026
The marker sat at 0e7012b, where apache#1306 left it, while apache#1305 and apache#1307-apache#1310 landed on top. Reviewing that delta: - apache#1305 (stats events cache `updatedAt`) and apache#1307 (dev version bump) touch no behaviour any spec describes; no spec references `fetch_issues` or the events cache. - apache#1308, apache#1309 and apache#1310 are the vetted-ops sandbox work, and the `excludedCommands` section this branch already rewrites is where they belong. That rewrite covers all three. So the delta is documented and the marker can move. This is the by-hand route AGENTS.md allows for a small known gap, not a full `loop.sh update` pass — it reconciles these five commits rather than re-auditing every skill, tool and modes.md row. Generated-by: Claude Opus 5
4 of 15 tasks
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
.claude/settings.jsonnever carried the deny rulessetup-isolated-setup-updatechecks for — found by running that skill against this checkout.Edit/Writedenies for both surfaces the policy resolves to: the committed.apache-magpie-overrides/tools/vetted-ops/override and themagpie-vetted-opsplugin cache.tools/sandbox-lint/expected.jsonin step, whichtest_baseline_file_matches_live_settingsrequires.Type of change
Test plan
prek run --all-filespassestools/sandbox-lintgreen — the two failures this change initially caused (test_baseline_file_matches_live_settings,test_main_exits_zero_on_repo) pass with the baseline updatedRFC-AI-0004 compliance
Notes for reviewers
In-repo
tools/vetted-ops/is deliberately not denied. It is the framework's own source, gated by PR review rather than a runtime deny. AWrite(...)deny there makes the whole subtree read-only to every sandboxed subprocess, includingprek's fixers.That same effect now applies to
.apache-magpie-overrides/tools/vetted-ops/, and reviewers should weigh it.prek run --all-filesinside a sandboxed agent session now fails with:CI is unaffected (no agent sandbox there), and a normal
git commitis unaffected (hooks only see staged files). What breaks is the repo-wide gate AGENTS.md mandates before every PR, for exactly the people running the framework's secure setup. The gate must be run outside the sandbox until this is resolved. Worth a follow-up: either the deny rules should beEdit-only, orprekneeds an exclude for denied paths.🤖 Generated with Claude Code