How to write verifiers for coding agent tasks

Short answer. A good verifier checks what the code does, not how it looks. It passes every correct solution, fails every wrong one, gives the same result on every run, and cannot be satisfied by editing the test.

By Vision Scale Labs · Updated 2026-11-25

Start from behaviour, not from the reference solution

Write down what a correct result must do in plain words before you write any test. Then turn each statement into a check. If you start from the reference solution, you end up testing its details, and a valid alternative fails.

Run each check against the reference solution and against at least two wrong ones: an empty change and a change that almost works. A verifier that passes the almost-working change is too loose.

Make the result deterministic

A verifier that passes on Monday and fails on Tuesday teaches the agent nothing. Pin dependency versions, fix random seeds, avoid wall-clock time, and stay off the network. Run the check several times on the reference solution before release.

When a check needs timing, use generous limits tied to the work, not tight ones tied to your laptop.

Keep the verifier out of reach

Run the check from a separate location that the agent cannot read or write. Copy in the hidden tests only after the agent has finished. Compare outputs by running the code, not by searching its text for a keyword.

Log what the verifier saw. When a solution passes, you want to be able to say why.

Review it like code

A second person should read each verifier and try to break it. Record what they tried. Disagreements between reviewers are useful data about where a task is ambiguous.

Common questions

Should a verifier use unit tests or end-to-end checks?

Use whichever matches the behaviour you care about. Unit tests are fast and precise. End-to-end checks catch problems where parts do not fit together. Many tasks need both.

How do I know a verifier is too strict?

Write a second correct solution in a different style. If it fails, the verifier is checking details the task did not ask for.

Keep reading