Plan 0014
Guards as typed policy
One typed policy layer for command and git guards, replacing scattered regex hooks. Thirty-plus issues of guard false positives, guard gaps, and tool-permission drift become declarative rules with tests, versioned next to the prompt policy they enforce.
- Status
- Sketch
- Ambition
- 4 replaces regex accretion with one policy layer; the concept exists elsewhere
- Impact
- 7 guard false positives block real work daily; gaps let footguns through
- Effort
- 5 one evaluator, a typed rule set, and migration of every existing guard
- Risk
- 4 a bad rule blocks work loudly rather than corrupting anything
- Maturity
- 2 guards exist as scattered patterns; the policy layer does not
- Leverage
- 7 every new footgun becomes one declarative rule, not a new hook
- Taste
- 5 deciding what to block is policy taste; the evaluator is mechanical
- Authors
- Created
- Updated
- Tracking issue
- -
- Supersedes
- -
- Superseded by
- -
Summary
Command guards accreted as regex hooks: each footgun got a pattern, each
pattern got false positives, and the set drifted from what agent tool
declarations promise. The issues split evenly between “the guard blocked
legitimate work” and “the guard missed the thing it existed to stop”. This
plan replaces the pile with one policy layer: typed rules (command shape,
path scope, repo state) evaluated in one place, tested like code, and
rendered into whatever hook or permission surface each runtime needs, the
same way policy/permissions.nix already renders deny lists.
Non-goals
Changing what is forbidden; existing policy migrates as-is, then rules get tightened one PR at a time with the false-positive corpus as tests.
Absorbed issues
#3042, #3032, #3023, #2955, #2956, #2938, #2936, #2880, #2908, #2825, #2882, #2804, #2798, #2796, #2789, #2788, #2787, #2771, #2799, #2758, #2744, #2722, #2675, #2673, #2667, #2447, #2748, #2448, #2730, #2676, #3176, #3171, #3142, #3106, #3099, #3130, #2421, #2395, #2367, #2362, #2764, #2729, #2735, #2731, #2461, #2602, #2597, #2546
Drafted by Claude Code (Fable) from the open-issue corpus; scores are seed estimates.
andrewgazelka