Independent Verifier
Check agent work in a fresh session that never saw how the code was written, so no agent grades itself.
Problem
The agent that writes a change usually also tests and judges it. It carries its own assumptions into the tests, writes tests that confirm what it built, and reads its own diff charitably. Checks in the same session catch typos and obvious slips, but not a wrong assumption, because the checker shares it.
- The author’s context biases its own checks.
- A fresh context also lacks useful background.
- A second session costs tokens and time.
- Author and verifier can share blind spots if they share a model and prompt.
Solution
When the coding agent finishes, start a separate verifier session with a clean context. Give it only the spec or acceptance criteria, the diff, and the ability to run the code and tests, not the author’s conversation or reasoning. Its job is to write or extend tests from the spec, try to break the change, and report findings with evidence. The author agent fixes what it finds, and the verifier checks again. For risky changes, use a different model family or a different prompt for the verifier. Attach the verifier’s report to the pull request so human reviewers start from evidence rather than from the raw diff.
Diagram
The verifier sees only the spec and the diff. It can't inherit the author's assumptions, so it catches the ones that are wrong.
When to use
Use it when
- Agent changes merge with little human reading
- Logic where a wrong assumption is costly
- AI first-pass review is in place and you want stronger evidence
- Long agent sessions where context may have drifted
Avoid it when
- Tiny mechanical changes already covered by existing tests
- No spec or acceptance criteria to check against
- Low-risk repos with a tight token budget
Trade-offs
Gains
- Agent work is never graded only by its author
- Reviewers get evidence, not just a diff
- Tests are written from the spec, not from the code
Costs
- Extra tokens and wait time for every checked change
- The verifier misses context the author legitimately had
- Back-and-forth between agents can stall without a cap
Worked example
The Linkwatch team adds a per-user limit of 60 link checks per minute.
- Author agentImplements the limit with a fixed one-minute window and 4 tests. All tests pass.
- VerifierA fresh session gets the spec and the diff only. It writes 6 tests from the spec, including bursts that span a minute boundary.
- Finding119 checks get through in 2 seconds across a minute boundary. The author’s tests never crossed a boundary.
- FixThe author agent switches to a sliding window. The verifier reruns its 6 tests and all pass.
- Pull requestThe verifier’s report is attached. The reviewer reads the report and the window logic instead of the whole diff, and approves in 10 minutes.
Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
| Shared context | Verifier repeats the author's assumptions | Pass only the spec and the diff, never the author's session |
| Rubber stamp | Verifier says "looks good" with no evidence | Require tests run and outputs shown in every report |
| Shared blind spots | Same model misses the same class of bug | Use a different model or prompt for high-risk changes |
| Endless back-and-forth | Author and verifier loop without converging | Cap the rounds, then escalate to a person |