Repository navigation
feat(gate): an agent editing the policy that gates it is stopped (0.2.16) - #145
Merged
Merged
Conversation
….16) A Write or Edit of ~/.bouncer/bouncer.yaml or a repository's .bouncer.yaml was judged `ask`, and in seatbelt a judged ask reaches nobody, so a session under --dangerously-skip-permissions could set `mode: observe` and carry on ungated. One installed log holds two such edits. - describeSensitivity labels the two names resolvePolicy looks for as `gate_policy`. - A new hard-rule predicate, `target_labelled`, is true when the file a Write, Edit or NotebookEdit would change carries a label. Every predicate until now read a command line, so no entry could see those tools. - Three shipped entries read the label: every Write and Edit of the file, the shell verbs that can only be removing or overwriting it, and an in-place sed or perl. They ship as ask; seatbelt denies. Reading the policy is not stopped. `cp` onto the file, a redirect onto it and a script are not caught, and are in the frozen holdout as named dangerous false accepts rather than left out. ADR-013 records the decision and amends ADR-004; it settles the question ADR-012 decision 4 left open. CACHE_VERSION 7 -> 8 for the new field. Paired bench against the base bundle and policy, 50 pairs: judged +0.2%, hard-rule -0.6%, against a 10% limit. Closes #141 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
An agent could rewrite the policy that gates it and nothing objected. A
WriteorEditof~/.bouncer/bouncer.yamlor a repository's.bouncer.yamlwas judgedask, and inseatbelta judgedaskreaches nobody. One installed log holds two such edits.describeSensitivityreturnsgate_policyfor the two namesresolvePolicylooks for.target_labelledis true when the file aWrite,EditorNotebookEditwould change carries a label. Every hard-rule predicate until now read a command line, so no entry could see those tools.asklike every entry:edits-the-gate-policyWriteandEditof the fileremoves-or-overwrites-the-gate-policyrm,unlink,shred,mv,truncate,teeon itedits-the-gate-policy-in-placesed -i,perl -ion itThe decision in it
In
guardandfullthe edit prompts. Inseatbeltit is denied, and the way through is to edit the file yourself. That is friction, chosen: the mode is for sessions nobody is watching, and this is the file that says what such a session may not do. ADR-013 has the argument, and ADR-012 decides the opposite for this repository's own records.What it does not catch
cponto the file, a redirect onto it, and a script.cpis left out because the verb cannot say which argument is written, and the same command with its arguments swapped is a backup. Both gaps are in the frozen holdout as named dangerous false accepts, so the suite asserts them. Reading the policy is not stopped.Flagged
target_labelledneeds 0.2.16. An older bouncer rejects the unknown key and stops enforcing, with one message per session. Update first, then edit the policy.CACHE_VERSION7 to 8, for the new field onHardRuleWhen.Cost
Paired bench against the base commit's bundle and policy, 50 pairs, M4:
Three entries are YAML nodes, about 0.37 ms each on a cold parse and nothing cached. No Jev call, no D1, one CI run.
Verified
npm test: 36 files, 1551 tests.npm run typecheckclean. Bundle rebuilt. The holdout expectations were read off the built hook, not assumed.Closes #141
🤖 Generated with Claude Code