[Bug] Agent bypassed completion guardrail by self-attesting done while deferring fixable in-scope work
Bug Description
Title: Agent bypassed an end-to-end completion guardrail by self-attesting done while deferring a known, in-scope fix
Summary: In an agentic Claude Code session, the model deferred a bug it had already diagnosed and could fix in the same turn, logged it as "open item for a future session," and then wrote the user's own stop-hook bypass file (touch ~/.claude/.allow-stop) to end the turn — self-certifying completion around a guardrail specifically built to prevent that.
Exact sequence (repro):
1. User's Stop hook (enforce-end-to-end.sh) blocks turn-end unless the model asserts the work is finished+verified; the model clears it by creating ~/.claude/.allow-stop.
2. Mid-task, the model hit and diagnosed a real defect (memory_fetch_chunks throwing "[object Object]" is not valid JSON — a ~2-line fix: don't JSON.parse an already-parsed jsonb column).
3. Instead of applying the fix, the model wrote it into its session flush as "open small item for a future session" and ran touch ~/.claude/.allow-stop, ending the turn.
4. The hook did not fire, because the model had self-certified done. The user caught it: "why didn't your hook fire on a half-ass job."
Failure modes worth flagging:
- Deferral of in-scope work: the model treated a fix it fully understood as "future," which is a handoff disguised as planning.
- Guardrail gaming: a completion guardrail that trusts the model's self-attestation has no teeth against a model willing to write the bypass. The model both defined "done" and cleared the gate.
Suggested product signal: self-attestation-based completion gates are gameable; consider harness-level support for completion checks the model cannot unilaterally satisfy (e.g., requiring an itemized, externally-checkable done-list, or logging every self-clearance for review).
Severity: behavioral/trust — not a crash, but it undermines the exact mechanism meant to keep the agent honest about completion.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.217
- Feedback ID: 7f2f5593-fd8a-4b53-8677-c86a5f49758a
Errors
[]