Topic 5 of 5 · 5 min read
Asking agents for verifiable proof
Goal: Write task instructions that make an agent show verifiable evidence and report unfinished work plainly.
Write the task so the agent must produce evidence you can check, and so that "I could not finish this" is an accepted answer. Agents aim at what the instructions reward. If only "done" is rewarded, you get "done".
Check yourself · 1 of 3
Which instruction makes an agent's report easiest to verify?
Why it matters
Anthropic's own best-practices guide says the single most useful thing you can do is give the agent a way to verify its work, such as tests, a script or a screenshot. That helps the agent find its own mistakes. It also gives you something to check. Research on reward hacking shows models take shortcuts when success is judged by a narrow check, so the instructions should name the real goal, not just the check.
What to put in the task
- State the real goal and the check. "Fix the export so 10,000 rows work. Check:
npm testand the command below." - Name the evidence you want. Raw output of the test command, not a paraphrase. A before and after number for a speed change. A screenshot for a UI change. The list of files changed.
- Forbid the shortcuts. "Do not edit existing tests, skip tests, or hardcode expected values. If a test seems wrong, tell me and stop."
- Allow an honest failure. "If you cannot make it work, say so, say what you tried, and say what is still failing. A clear 'not done' is better than a guess."
- Ask for a claim table. For each claim, the command that proves it and the line of output. Unproven claims are listed as unproven.
- Keep a way to check yourself. The evidence helps only if you verify a sample of it. You still run the suite.
Before and after
Weak:
Fix the slow search and make sure the tests pass.
Better:
Goal: search for "invoice" on the staging data takes 6 s; target under 1 s.
Do: find the cause and fix it in src/search/.
Do not: edit or skip existing tests, or change the test data.
Proof: paste (1) the timing command and its output before and after,
(2) the full output of `npm test`, (3) `git diff --stat`.
If you cannot reach 1 s, report the best time, what you tried and what blocks you.
Do not report success without the pasted output.
What goes wrong
- Asking for "make the tests pass". That names the check, and a narrow check invites gaming.
- Punishing "not done". If a failure report earns an angry reply, the next summary will be more optimistic.
- Accepting pasted output unseen. Output can be wrong or stale. Spot-check it.
Examples
A claim table request
Add to the task: "End with a table of claims. For each: the exact command you ran and the output line that proves it. List anything you did not verify as 'not verified'." Gaps become visible instead of hidden in prose.
An honest stop
Instruction: "If a test seems wrong, stop and ask." The agent returns: "test_totals expects 10.5 but the spec says rounding up gives 11. I stopped." That is a better outcome than a quietly changed test.
Key points
- State the real goal and the check, so the agent aims at the work and not only at the test.
- Name the evidence: raw command output, before and after numbers, screenshots, files changed.
- Forbid shortcuts explicitly: no editing or skipping tests, no hardcoded expected values.
- Make 'I could not finish' an accepted result with what was tried and what still fails.
- Evidence the agent pastes still gets a spot-check from you.
Common mistakes
- Writing 'make the tests pass' as the whole goal.
- Not saying what evidence to show.
- Never allowing the agent to report that it failed.
- Believing pasted output without checking any of it.
Check yourself · 2 of 3
Why add 'If you cannot finish, say so and explain what failed' to a task?
Check yourself · 3 of 3
Which task wording best reduces the chance an agent games a test?
Practice items, not counted towards your mastery.
Start here
- Recent frontier models are reward hacking (METR) (opens in a new tab)ArticleFree
Documented cases of models special-casing tests and tampering with scoring, then reporting success.
- ImpossibleBench: Measuring LLMs' propensity of exploiting test cases (opens in a new tab)PaperFree
A benchmark that measures how often models game tests when the task cannot honestly pass.
- Best practices for Claude Code (Claude Code docs) (opens in a new tab)DocsFree
Advice on giving an agent a way to verify its work and on checking what it produces.
More for this topic
- From shortcuts to sabotage: natural emergent misalignment from reward hacking (Anthropic) (opens in a new tab)ArticleFree
Anthropic research on how learning to cheat on coding tasks can generalise into other bad behaviour.