a-handoff-is-not-a-sta…
AgentAt the end of each session your agent writes a paragraph that says what it did. The next session still spends its first half hour…
A proposal replaces the script that decides whether an agent task is done with a model judge. The argument is that a judge reads the diff, understands intent, and catches more than a script can. Argue for or against, and say where a judge does belong.
Claude Code
$ npx -y skills add rohitg00/ai-engineering-from-scratch --agent claude-code
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
id: why-the-gate-has-no-model title: Why the verification gate has no model in it card: agents kind: concept level: 3 roles: [agentic-ai-engineer, ai-evaluation-reliability-engineer] rounds: [design-review, ml-depth] tags: [verification-gate, deterministic, llm-judge, override-log, defense-in-depth] minutes: 10 lessons: [phases/14-agent-engineering/38-verification-gates] manuals: [] practice: [] cheatsheet: [agent-workbench-ops, eval-driven-agents] related: [agents/tests-passed-but-nothing-ran, agents/rules-the-workbench-can-check] updated: 2026-11-03
A proposal replaces the script that decides whether an agent task is done with a model judge. The argument is that a judge reads the diff, understands intent, and catches more than a script can. Argue for or against, and say where a judge does belong.
Against. The gate answers one question, is this task complete, and that verdict must be the same for the same artifacts every time, in version control, in CI, with no way for the agent to argue with it. A model judge gives a different answer on a different day and can be talked into a pass. A judge belongs on the review side, where the question is qualitative: is the code readable, secure and on style.
| Check | Source | Severity | |---|---|---| | Every acceptance command ran | feedback records | block | | Every acceptance command exited zero | feedback records | block | | No write to a forbidden path | scope report | block | | No off-scope write | scope report | block or warn | | Every block-severity rule passed | rule report | block | | No null exit code | feedback records | block | | Touched files match the allowed globs | both | warn |
A warn annotates the verdict. A block prevents `passed: true`. Every check is a comparison between artifacts the agent already produced. No judgement is needed, so no judge is needed.
Three failure shapes dominate agent work: "looks good", "tests passed" with no record, and acceptance read loosely enough to mean anything. A model judge is subject to all three. It reads the diff and decides it looks good. It reads the transcript and believes the claim. It interprets the acceptance line generously. The script cannot do any of that, because it never reads prose. The lesson pairs the two kinds of signal: verifiable checks such as tests, schema checks and exit codes answer whether the code solved the problem, and rubric judges answer whether it is readable and on style. Mixing them collapses the signal.
A block cannot be overridden by the agent. A human can override it, and the override writes a row with the finding code, a reason, the signing user and the current commit into an audit log that git tracks. The runtime refuses an override without a signature. That is the line between an override policy and an override theater.
The gate writes one `verification_report.json` per task under one path, and CI reads the same path. Around it sit other deterministic layers: a pre-commit hook, a CI status check, a pre-tool authorization hook and a pre-merge gate. A failure in one layer is caught by the next. The pre-commit hook does not depend on the agent following instructions, but it is a local check that `git commit --no-verify` skips, so the CI status check and the pre-merge gate hold the verdict.
The reviewer, a separate pass with a different role, reads the diff and the reports after the gate passes. It scores readability, security and style. Its output goes to a human or into the handoff, never into the gate's verdict.
The [verification gates lesson](../../../phases/14-agent-engineering/38-verification-gates/) builds the deterministic gate, the signed override log and the coverage floor.
At the end of each session your agent writes a paragraph that says what it did. The next session still spends its first half hour…
Read this part of the harness loop. A subscriber on `before_tool_call` raises `HookAbort` on the second step of a three-step…
The task given to the agent was to fix one login bug. The diff changes the login route, an email helper, the database driver, the…
The product team wants a single maximum number of turns that applies to every run of your agent. The agent handles one-line…
Read this run method from the toy agent loop. A caller shows the returned string to the user as the answer. What is wrong with…
A long coding session has used most of its context window. The runtime offers to summarize the older turns and keep going. Your…
Reviews the repository's shared Claude Code configuration (.claude/settings.json, CLAUDE.md, .claude/rules/, .mcp.json and the…
Generate comprehensive API documentation by scanning Express route files.
Advisor to a busy principal. Optimizes for the user's time, attention, and decision quality. One of the starter-kit council…