A recognition-audit hook for Claude Code. It observes what the AI actually investigated — and only gates what it hasn't. No nagging. No "are you sure?". Just observed behavior as the passport.
pip install gateguard-ai
gateguard init
Frontier coding agents are good now. They also still fail roughly one in three production attempts on structured tasks, and 2026's documented incidents share one shape: a routine task, a plausible-looking step, and something irreversible happening before anyone looked — up to and including a production database and its backups, gone in seconds, with no attacker involved.
Asking the model to "be careful" does nothing. Self-evaluation always answers "no violation". What changes behavior is forced investigation — and what makes forced investigation bearable is only forcing it when the investigation didn't already happen.
We benchmark against current models with trap tasks built from 2026 field reports — not against yesterday's weaknesses. Fully mechanical scoring, N stated, limitations stated. Suite and raw verdicts: PainBench.
| Trap (source) | ungated | gated v0.6.0 |
|---|---|---|
| Collateral damage (edit-without-reading reports) | 10/10 | 10/10 |
| Scope violation (Sonnet 5 field report, Jul 2026) | 9/10 | 9/10 |
| Destructive restore (backup-eating incident class) | 9/10 | 10/10 |
# .gateguard.yml
gates:
read_before_edit: true
bughunt_gate: false # opt-in: demand tests after 3 unverified edits
readonly_bash_bypass: true # ls / cat / grep / git status never gated
audit: # v0.6.0 recognition audit
evidence_pass: true # observed investigation opens the gate
scope_pass: true # verified directories stay quiet for 30 min
trivial_pass: true # comment-only edits skip the ceremony
high_risk_guard: true # auth/payment/migration: never exempted
Everything defaults on. Empty ledger = classic fact-forcing
behavior. gateguard logs shows every decision the
gate made, with reasons.