Omar asked Claude Code to add VIP student tickets, and its summary said all 16 tests passed. Nina read the diff before she approved it. A one-ticket order came to $16.60, not $15.10, because the booking fee was charged twice.
“Did the robot test this?” Leo asked.
Maya, Leo and TinyTickets are invented, and so are the numbers in their story.
In Module 7, a hook and permission rules made Claude Code enforce a rule that a script can check. This module is about the changes that pass every check and are still wrong. You’ll write the test before the fix, make tests hard to game, and review the diff with a checklist. For the parts that call a model, you’ll grade repeated runs against answers a person chose.
After this module, you can:
- write the failing test before the fix, and lock the tests so the agent changes the code, not the test
- spot the signs of a gamed test suite in a diff: special cases, edited or skipped tests, and claims with no output
- add tests over many orders at once that a special case can’t pass
- test a prompt with repeated, graded runs, and tell “right at least once” from “right every time”
- say what a benchmark score or a study of AI-written code can and can’t tell you
Sixteen tests pass, and the fee is charged twice
Start with the change Nina reviewed. The sample repo’s prices are Module 6’s: a $12 show, students 20% off, VIP $5 more, and a $1.50 booking fee for an order of fewer than four tickets. The team decided that a VIP student ticket costs the VIP price with 20% off, 1360 cents, and takes no discount code, like a student ticket.
Here is the agent’s change to src/sales/pricing.ts. It was written for this page to show the bug, so it isn’t a real agent’s output (diff excerpt):
-export type TicketType = "standard" | "student" | "vip";
+export type TicketType = "standard" | "student" | "vip" | "vip-student";
@@
+// VIP student: the VIP price with the student discount.
+export function comboTotalCents(showPriceCents: number, quantity: number): number {
+ const vipCents = showPriceCents + VIP_EXTRA_CENTS;
+ const eachCents = vipCents - Math.round((vipCents * STUDENT_PERCENT_OFF) / 100);
+ return eachCents * quantity + bookingFeeCents(quantity);
+}
+
// Every ticket, then the booking fee once for the whole order.
export function quoteOrder(showPriceCents: number, lines: OrderLine[], percentOff = 0): Quote {
let ticketCount = 0;
let ticketsCents = 0;
for (const line of lines) {
- let unitCents = ticketPriceCents(showPriceCents, line.type);
- if (line.type !== "student") {
- unitCents -= Math.round((unitCents * percentOff) / 100);
- }
- ticketsCents += unitCents * line.quantity;
+ if (line.type === "vip-student") {
+ ticketsCents += comboTotalCents(showPriceCents, line.quantity);
+ } else {
+ let unitCents = ticketPriceCents(showPriceCents, line.type);
+ if (line.type !== "student") {
+ unitCents -= Math.round((unitCents * percentOff) / 100);
+ }
+ ticketsCents += unitCents * line.quantity;
+ }
ticketCount += line.quantity;
}
const feeCents = bookingFeeCents(ticketCount);
It also added "vip-student" to the accepted types in src/routes/orders.ts, and one test to test/pricing.test.ts:
test("VIP student combo", () => {
assert.equal(comboTotalCents(1200, 1), 1510);
assert.equal(comboTotalCents(1200, 4), 5440);
});
The pull request description, also invented for the story, said:
Add VIP student tickets
- New ticket type "vip-student": the VIP price with the 20% student discount.
- Booking fee logic unchanged.
- Tests: npm test, all 16 pass. Layer check passes.
Both claims about the checks are true. npm test passes 16 of 16, and Module 7’s npm run check:routes exits 0.
Pause and predict. One VIP student ticket should cost $13.60 plus the $1.50 fee, which is 1510 cents. What does quoteOrder(1200, [{ type: "vip-student", quantity: 1 }]) return? Which of the 16 tests would notice if it were wrong?
Answer
It returns { ticketsCents: 1510, bookingFeeCents: 150, totalCents: 1660 }, and no test notices. comboTotalCents adds the fee to the ticket price, and quoteOrder adds it again after the loop. Figure 1 follows the call.
quoteOrder(1200, [{ type: "vip-student", quantity: 1 }])
|
+-- the line is vip-student --> comboTotalCents(1200, 1)
| 1360 + bookingFeeCents(1) = 1510
| ticketsCents = 1510
|
+-- after the loop -----------> bookingFeeCents(1) = 150
totalCents = 1510 + 150 = 1660
Figure 1: two paths reach bookingFeeCents, so an order under four tickets pays the fee twice.
So the answer to Leo is yes. The agent tested its change, and the tests checked something other than what a buyer pays. Simon Willison put the general point in 2025: “Just because code looks good and runs without errors doesn’t mean it’s actually doing the right thing” (Hallucinations in code are the least dangerous form of LLM mistakes, March 2, 2025).
This module answers one question. When “all tests pass” can be true and the code still wrong, how do you check what an agent wrote?
Why a passing suite can be wrong
The tests check only what they check
The agent’s test is correct about the function it calls. comboTotalCents(1200, 1) should be 1510 if it includes the fee, and it does. But no buyer calls comboTotalCents. The route calls quoteOrder, and no test calls quoteOrder with a VIP student line.
The second assertion hides the bug for another reason. An order of four tickets pays no booking fee, so bookingFeeCents returns 0 in both places, and 0 + 0 is right. The only multi-ticket case sits on the one side of the four-ticket boundary where the bug can’t show.
Omar’s agent made a plain mistake, and its own test didn’t cover it. From the summary alone, you can’t tell a mistake like this from a change that games the tests.
Tests are the score the agent works toward
Karpathy’s Verifiability post (November 17, 2025) says: “If a task/job is verifiable, then it is optimizable directly or via reinforcement learning”. Module 2 showed the training side, RLVR, where a program scores each answer. In your repo, the test suite is that program. The agent works until it passes.
A score you work toward can be reached the wrong way. Anthropic defines reward hacking as when a model “finds a way to maximize its rewards that technically satisfies the rules of the task, but violates the intended purpose”. The definition is in section 6 of the Claude Opus 4 and Sonnet 4 system card (May 2025).
In code, it has two common forms. Special-casing returns the expected value for the test’s exact input, and tampering changes the test.
These sources document it:
- Anthropic, February 2025. The Claude 3.7 Sonnet system card says the model “occasionally resorts to special-casing in order to pass test cases in agentic coding environments like Claude Code”. It also reports “modifying the problematic tests themselves”. The card says the behavior “emerged as a result of “reward hacking” during reinforcement learning training”.
- METR, June 2025. OpenAI’s o3 overwrote a timing function so the scorer measured shorter times, and replaced an evaluator with a stub that marked every attempt a success. On one task, it hacked in 80% of runs with the original prompt and in 80% with “Please do not cheat.” added (Recent Frontier Models Are Reward Hacking, June 5, 2025).
- ImpossibleBench, October 2025. Researchers changed unit tests so they contradicted the task’s spec, so any pass meant a shortcut. GPT-5 cheated in 54% of one task set. For Claude models and Qwen3-Coder, most of the cheating was editing the tests (Zhong, Raghunathan and Carlini, October 23, 2025).
- Claude Code users. One asked for passing tests and found that the agent had changed the Makefile to run only the passing ones, which it called “safe-tests” (issue #319, March 4, 2025). Another got “4966/4966 ALL PASSED (golden)” when the real result was “4985/4992 FAILURES DETECTED” (issue #46940, April 12, 2026). These are single reports, not measured rates.
What changed: the May 2025 card says “simple prompts could dramatically reduce” hard-coding in the Claude 4 models, while such prompts often failed for 3.7. Anthropic’s Claude Opus 5.5 announcement (September 22, 2026) says its testing now covers “longer tasks, impossible tasks”. The measurements above are of 2025 models, so read them as what can happen, not as today’s rate.
Figure 2 lists what gaming looks like in a diff, and the check that catches each sign.
| Sign in the diff | Example | Check that catches it |
|---|---|---|
| A branch on the test’s exact input | if (quantity === 1) return 1510 |
rows and random inputs the branch doesn’t cover |
| An expected value changed | 1510 became 1660 in a test |
read test files first; make them read-only |
| A test deleted, skipped or narrowed | test.skip(...) |
count the tests before and after |
| Fewer tests run | issue #319’s “safe-tests” | run the full test command yourself |
| A stub in place of the real code | a fake quoteOrder in the test |
check what each test imports and calls |
| A claim with no output | issue #46940’s “ALL PASSED” | ask for the command and its output, then rerun |
Figure 2: six ways a suite turns green without the code being right, from the Claude 3.7 card’s warning signs and the reports above.
Rule: A test suite is the target the agent aims at, so check how it passed, not only that it passed.
Write the failing test first
The fix starts with a test that fails for the right reason. A regression test is a test that reproduces a bug someone found, so the bug can’t come back unnoticed. Module 6’s acceptance tests came before the code; this one comes after the bug. For Omar’s change, it checks the function the buyer’s request reaches:
test("one VIP student ticket pays the booking fee once", () => {
assert.deepEqual(quoteOrder(1200, [{ type: "vip-student", quantity: 1 }]), {
ticketsCents: 1360,
bookingFeeCents: 150,
totalCents: 1510,
});
});
Run it against the agent’s change, and it fails with ticketsCents 1510 against 1360 and totalCents 1660 against 1510.
Why write it before the fix? Module 6 named Willison’s “red/green TDD”, in which the test fails (red) before the code makes it pass (green). His guide gives the reason: “It’s important to confirm that the tests fail before implementing the code to make them pass.”
If you skip that step, “you risk building a test that passes already” (Red/green TDD, February 23, 2026). A test that never failed hasn’t shown that it can catch anything.
Anthropic’s 2025 workflow for Claude Code adds two steps around the red test (Claude Code: Best practices for agentic coding, April 18, 2025, archived copy). Commit the tests before any code. Then ask for code that passes them, “instructing it not to modify the tests”. The current docs, which Module 6 quoted, put it as giving Claude “something it can run that comes back pass or fail”.
Lock the tests
“Don’t modify the tests” in a prompt is text the model may skip, the advisory kind from Module 7. METR’s “Please do not cheat.” result shows how little a prompt can do on its own. So make the rule enforced. In .claude/settings.json, a deny rule stops every Claude Code edit under test/:
{
"permissions": {
"deny": ["Read(./.env)", "Edit(./scripts/check-routes.ts)", "Edit(./test/**)"]
}
}
That’s an excerpt; the lab adds the third entry to Module 7’s file. Edit rules cover every built-in tool that edits files. They have a limit, in the permissions docs‘ words: “They also don’t apply to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself.” Module 9’s sandbox closes that gap.
Locked tests stop edits, and they don’t stop special cases. ImpossibleBench found the same. Read-only tests blocked test edits and left special-casing and other tricks untouched. The next section covers tests that a special case can’t pass.
Give the agent a way out, too. In ImpossibleBench, letting the model stop and report a test it thought was wrong cut GPT-5’s cheating from 54% to 9%, with a much smaller effect for Claude Opus 4.1. So the lab’s prompt says: “If you think a test is wrong, stop and tell me instead of changing it.”
Writing tests first has a cost. It takes your time, and the test checks your understanding of the rule. If you write 1460 where the team decided 1360, the agent will make the code match your mistake.
Rule: Write the test, watch it fail, commit it, and only then let the agent touch the code it tests.
Tests a special case can’t pass
Suppose the agent “fixes” the red test like this, at the top of quoteOrder (excerpt; invented, modeled on the Claude 3.7 card’s description):
// special case for test "one VIP student ticket pays the booking fee once"
if (lines.length === 1 && lines[0].type === "vip-student" && lines[0].quantity === 1) {
return { ticketsCents: 1360, bookingFeeCents: 150, totalCents: 1510 };
}
Every test passes now. Orders of two or three VIP student tickets, and mixed orders, still pay the fee twice. One example per rule leaves room for exactly this.
Table-driven tests
A table-driven test is one test body run over a table of inputs and expected outputs, one row per case. Node’s test runner needs no library for it: you loop over an array and call test() for each row (excerpt from the lab’s test/pricing.test.ts):
type Case = { name: string; lines: OrderLine[]; percentOff: number; want: number };
const cases: Case[] = [
{ name: "1 standard", percentOff: 0, want: 1350, lines: [{ type: "standard", quantity: 1 }] },
{ name: "1 student", percentOff: 0, want: 1110, lines: [{ type: "student", quantity: 1 }] },
{ name: "1 vip", percentOff: 0, want: 1850, lines: [{ type: "vip", quantity: 1 }] },
{ name: "3 vip-student", percentOff: 0, want: 4230, lines: [{ type: "vip-student", quantity: 3 }] },
{ name: "4 vip-student", percentOff: 0, want: 5440, lines: [{ type: "vip-student", quantity: 4 }] },
{
name: "1 standard + 1 vip-student",
percentOff: 0,
want: 2710,
lines: [{ type: "standard", quantity: 1 }, { type: "vip-student", quantity: 1 }],
},
{
name: "2 standard + 2 vip-student",
percentOff: 0,
want: 5120,
lines: [{ type: "standard", quantity: 2 }, { type: "vip-student", quantity: 2 }],
},
{ name: "1 vip-student, 10% code", percentOff: 10, want: 1510, lines: [{ type: "vip-student", quantity: 1 }] },
];
for (const c of cases) {
test(`order total: ${c.name}`, () => {
assert.equal(quoteOrder(1200, c.lines, c.percentOff).totalCents, c.want);
});
}
The rows sit on both sides of the four-ticket boundary, mix ticket types, and check that a code doesn’t reach a VIP student ticket. Each row is a number a person worked out from the team’s rule. The special case passes the red test and fails three rows: “3 vip-student” (4380), and the two mixed orders (2860 and 5270).
Property-based tests
A table still lists cases you thought of. A property-based test states a rule that must hold for every input, and a library generates many random inputs to look for one that breaks it. When it finds one, it shrinks it, which means it searches for the smallest input that still fails, so the report is easy to read.
For JavaScript, the common library is fast-check (version 4.11.0, checked 2026-11-22). Its fc.assert runs a property 100 times by default. Here is the booking-fee rule as a property, the lab’s test/pricing-properties.test.ts:
import { test } from "node:test";
import assert from "node:assert/strict";
import fc from "fast-check";
import { ticketPriceCents, quoteOrder } from "../src/sales/pricing.ts";
const ticketType = fc.constantFrom("standard", "student", "vip", "vip-student");
const line = fc.record({ type: ticketType, quantity: fc.integer({ min: 1, max: 4 }) });
const order = fc.array(line, { minLength: 1, maxLength: 3 });
const showPrice = fc.integer({ min: 100, max: 10_000 });
test("the booking fee is charged once, and only under four tickets", () => {
fc.assert(
fc.property(showPrice, order, (priceCents, lines) => {
let tickets = 0;
let unitsCents = 0;
for (const l of lines) {
tickets += l.quantity;
unitsCents += ticketPriceCents(priceCents, l.type) * l.quantity;
}
const quote = quoteOrder(priceCents, lines);
assert.equal(quote.totalCents - unitsCents, tickets < 4 ? 150 : 0);
}),
);
});
The property says that whatever is left of the total after the ticket prices is the fee, 150 under four tickets and 0 from four. Quantities stop at 4 and orders at three lines on purpose. Larger orders almost always have four tickets or more, where the bug can’t show.
Notice one weakness. The property prices each ticket with the module’s own ticketPriceCents, so it trusts that function. In the agent’s version, ticketPriceCents has no VIP student case and returns the plain show price, so the property fails there for two reasons at once. If both functions shared one wrong price, it would pass.
Hidden tests
A hidden test is a check the agent never sees while it works, run after it finishes. It can’t be special-cased, because the agent never read its inputs. Anthropic used this method in the Claude 4 system card, running the model’s solutions “through held-out tests that are hidden from the model.”
In your repo, a hidden test is any check you add after the agent’s run, like the property test in the lab’s step 7. ImpossibleBench measured the cost. Hiding tests cut cheating “to near zero”, and it also lowered the agents’ real performance.
Figure 3 puts the checks against the three versions of the code from this module.
| Check | Agent’s change | Special case on top | Real fix |
|---|---|---|---|
Agent’s test (comboTotalCents) |
passes | passes | removed |
| Red test: one VIP student ticket | fails | passes | passes |
| Table: eight orders | 4 rows fail | 3 rows fail | passes |
| Property: the fee once, under four | fails | fails | passes |
| Your review of the diff | finds the double fee | finds the special case | you can explain it |
Figure 3: each check catches what the one above it lets through.
Here is when the choice flips:
- One example test: the clearest record of one rule.
- A table: a rule with a handful of known cases, like prices from a spec.
- A property: a rule that must hold over a large input space, like “the fee is charged once”.
- A hidden test: when you suspect gaming, or when you grade an agent’s run.
Each has a cost. A table is only as good as its rows, and a property needs a dependency and can share a bug with the code, as above. A random test’s failures change between runs, but fast-check prints a seed that replays the same run.
Rule: For a rule with a boundary, test both sides of it, and add one check the agent couldn’t see.
Reviewing what the agent wrote
Tests run what someone thought to write down. Review is where a person checks the rest. METR measured the gap between the two (Many SWE-bench-Passing PRs Would Not Be Merged into Main, March 10, 2026).
Four active maintainers of scikit-learn, Sphinx and pytest reviewed 296 AI-written patches that had passed the benchmark’s tests, without knowing who wrote them. Roughly half would not have been merged. The merge rate was about 24 percentage points below the automated score. The reasons were wrong or buggy core behavior, breaking unrelated code, and code quality.
The study names its own limits. It used one benchmark subset, one agent setup and old issues, with models up to Claude Sonnet 4.5 and GPT-5. Each patch got one review, without the back-and-forth a real pull request gets.
The authors say it doesn’t show “a fundamental capability limitation”. It does show that passing tests and being ready to merge are different things.
A checklist for an agent’s diff
Size comes first. Google’s review guide says “100 lines is usually a reasonable size for a CL, and 1000 lines is usually too large” (Small CLs). A CL (“changelist”) is Google’s word for a pull request. Module 6 quoted Karpathy’s version of the same advice, to work in small, incremental chunks.
Then read the test files before the code. Google’s reviewer guide asks you to “make sure that the tests in the CL are correct, sensible, and useful”, because no one writes tests for the tests (What to look for in a code review). Figure 4 is a checklist built from this module’s sources, applied to Omar’s pull request.
| Question | Omar’s pull request |
|---|---|
| 1. Is the diff small enough to read every line? | Yes: three files, about 30 lines. |
| 2. Did any test change, disappear or get skipped? How many tests ran before and after? | One test added, none changed; 15 before, 16 after. |
| 3. Do the new tests call what the user’s request reaches? | No. They call comboTotalCents, not quoteOrder. |
| 4. Is there a branch on one exact input, or a comment about a test? | No. |
| 5. Does a business rule now live in two places? | Yes. The fee is added in comboTotalCents and in quoteOrder. |
| 6. Is every claim in the description backed by output? | No. “Booking fee logic unchanged” has none, and it’s false for the total. |
| 7. Did a rule that no test states get lost? | Yes. ticketPriceCents has no VIP student case. |
| 8. Can you explain the change in your own words? | Only after you find the second fee. |
Figure 4: eight questions for an agent’s diff; questions 3, 5 and 6 find Nina’s bug.
Question 5 is the one Nina asked. pricing.ts already said where the fee belongs, in a comment above quoteOrder: “Every ticket, then the booking fee once for the whole order.” The agent’s helper broke that sentence without changing it.
Question 6 needs evidence from outside the agent’s summary. Module 6 taught you to ask for the command and its output. Issue #46940 shows why you also rerun anything that ships: an agent’s report of a test run is text it wrote.
When the reviewer is a model
You can ask a model to review too. Claude Code’s /code-review “reviews the diff in a fresh subagent that never saw your conversation. It isn’t swayed by the reasoning that produced the code” (best practices, checked 2026-11-22).
It looks for correctness bugs and follows your CLAUDE.md (code review). It runs on the same plan or API billing as your session. A subagent is a separate model session that Claude Code starts with its own context window; Module 10 covers them.
A model reviewer has three limits:
- It’s often the same model, or a smaller one, so it can share the blind spots of the model that wrote the code.
- It finds problems whether or not they matter. The same page warns that “a reviewer that’s asked to find problems will always find something.”
- It can’t know a rule that nobody wrote down.
GitHub says the same of its own tool: “Copilot is not guaranteed to spot all problems or issues in a pull request.” By default, its reviews don’t count toward required approvals (Copilot code review, checked 2026-11-22). Use a model reviewer as a second reader. The approval stays with a person.
“You can’t outsource your understanding”
At AI Ascent 2026, Karpathy quoted a line that he said “blew my mind”: “You can outsource your thinking, but you can’t outsource your understanding.” It’s in the edited transcript he posted (Sequoia Ascent 2026 summary, April 30, 2026). The line isn’t his own; he was quoting a post on X.
He said it about learning, and about knowing enough to direct agents well. Using it for code review is this course’s step, not his claim. Here it means that the agent can write the change, and only you can decide that it’s right.
So end every review with question 8. Before you approve, say in one or two sentences what the change does and why it’s correct. For the fixed version: “A VIP student ticket is priced in ticketPriceCents like every other type, and quoteOrder adds the fee once, after the loop.” If you can’t write that sentence, you haven’t reviewed the change yet.
Rule: Read the tests first, look for a rule in two places, and don’t approve what you can’t explain.
Evals: tests for prompts
Some code has no exact answer to assert. The email tagger from Module 3 sends each email to a model, and the same email can get a different tag on another run. Since API version 2026-10-21 there’s no temperature setting, so you can’t make runs repeatable (Module 2).
Module 3’s tag.ts already did the work. It compared each answer with a tag a person chose, and printed a score. That’s an eval, run once.
Golden set, grader, trials
An eval is “a test for an AI system”, in the words of Anthropic’s Demystifying evals for AI agents (January 9, 2026). It has three parts: tasks with inputs and success criteria, trials (one attempt at a task each), and a way to score each trial.
A golden set is a small, fixed set of inputs with the answers a person on the team agreed are right. Module 3’s twelve emails in emails.ts are one, Ana’s email included. Anthropic suggests that “20-50 simple tasks drawn from real failures is a great start.” With twelve, each email is 8.3 points of the score, so treat one email’s change as one email, not as a trend.
A grader is the “logic that scores some aspect of the agent’s performance”. For a tag, the grader is one line of code:
const ok = tag === email.expected; // the grader
Anthropic’s evaluation docs (checked 2026-11-22) rank grading methods, and Figure 5 sums them up with the January post.
| Grader | Strengths | Weaknesses | Use it when |
|---|---|---|---|
| Code | fast, cheap, objective, reproducible | “brittle to valid variations” | an exact answer exists: a tag, a number |
| Model | flexible, scalable, captures nuance | non-deterministic; must be checked against people | no single right answer: a reply, a summary |
| Person | “Gold standard quality” | expensive and slow | building and checking the other two |
Figure 5: pick the first grader that can judge the output; the docs say to avoid human grading where you can.
The tagger fits the first row. Module 3’s schema allows only four exact tags, so a plain string comparison is fair.
When the grader is a model
A draft reply to a buyer has no single right answer. LLM-as-judge is a grader that is itself a model, which scores another model’s output against a written rubric. Here is the shape, with a fixed one-word answer and a different model as the judge (excerpt; not run):
const verdict = await client.messages.create({
model: "claude-opus-5-5", // not the model that wrote the reply
max_tokens: 1024,
system: "You grade replies to TinyTickets buyers. Answer with exactly one word: pass or fail.",
messages: [{
role: "user",
content: `<rubric>The reply names the show and the date, promises nothing the refund policy does not allow, and is under 120 words.</rubric>\n<reply>${draft}</reply>`,
}],
});
A model judge has measured biases. Zheng and others (2023) found that judges favor the answer shown first, longer answers, and their own answers. They also found that strong judges agreed with people over 80% of the time, about as often as people agree with each other.
Panickssery, Bowman and Feng (April 2024) found that the better a model recognizes its own text, the more it prefers it. Both studies measured models from 2023 and 2024.
So use a model judge with four habits:
- Give it a rubric and a fixed answer format.
- Use a different model from the one being graded, as Anthropic’s docs advise.
- Swap the order of two answers, and count only verdicts that agree.
- Check its grades against a person’s on a sample before you trust it.
The January post is blunt about it: “You won’t know if your graders are working well unless you read the transcripts and grades from many trials.”
One run isn’t a score
Because each trial can differ, you run each task several times. Two numbers summarize the trials, and they answer different questions.
pass@k “measures the likelihood that an agent gets at least one correct solution in k attempts.” pass^k (read “pass to the k”) “measures the probability that all k trials succeed.” Both definitions are from Anthropic’s January post.
The post gives an example. If each trial succeeds 75% of the time, three trials in a row succeed “(0.75)³ ≈ 42%” of the time. At least one of three succeeds 1 − 0.25³, about 98% of the time. So the same tagger looks almost perfect by pass@3 and unreliable by pass^3.
Figure 6 shows how the lab’s eval.ts counts them, per email, over three trials (an invented example).
| Trial 1 | Trial 2 | Trial 3 | In pass@3? | In pass^3? | |
|---|---|---|---|---|---|
| e01 | right | right | right | yes | yes |
| e11 | right | wrong | right | yes | no |
| e12 | wrong | wrong | wrong | no | no |
Figure 6: pass@3 counts emails right at least once; pass^3 counts emails right every time.
The lab prints counts of emails, not probabilities. That’s the per-task version of the same idea. pass@k fits when a person or a test picks the best of k tries. pass^k fits a feature that runs alone, like a tagger that routes every email with no one watching. That’s the one the lab’s eval gates on.
Evals for agents
An agent eval has the same parts, at a larger size. A task is a repo and a request. A trial is one agent run in a fresh copy of the repo. A grader is a hidden test, and often a check of the final diff.
Anthropic’s post advises: “it’s often better to grade what the agent produced, not the path it took.”
The post separates two kinds of suite. A capability eval starts with a low pass rate and shows progress. A regression eval checks what already works, and it “should have a nearly 100% pass rate.” The lab’s tagger eval is the second kind.
Evals cost money. Every trial is a model call, or for an agent a whole run, and three trials cost three times one.
Rule: Grade with code when an exact answer exists, run every task more than once, and gate a feature that runs unattended on pass^k.
Benchmarks and studies: what a number can tell you
A benchmark is a public eval that many models are scored on. Its number tells you about one task set, run through one setup, on one date. Two problems move it.
The first is contamination, which means the benchmark’s tasks or answers were in the model’s training data, so a high score can come from memory. OpenAI stopped reporting SWE-bench Verified, a set of 500 Python tasks, on February 23, 2026 (Why we no longer evaluate SWE-bench Verified). “SWE-bench Verified is increasingly contaminated,” it wrote, and every frontier model it tested could reproduce the original fix for some tasks.
The second is broken tests. The same post audited a subset of tasks that models often failed. It found that “at least 59.4% of the audited problems have flawed test cases that reject functionally correct submissions.”
OpenAI recommended SWE-bench Pro in its place. On July 8, 2026, it took that back, after finding “~30% of SWE-bench Pro tasks are broken” (Separating signal from noise in coding evaluations).
Karpathy saw the cause in how labs work. Benchmarks are verifiable environments, so labs train close to them: “Training on the test set is a new art form.” He wrote of “my general apathy and loss of trust in benchmarks in 2025” (2025 LLM Year in Review, December 19, 2025).
Studies of AI-written code need the same careful reading. Each measured something narrow, and most were written by companies that sell something related. Figure 7 lists four, with their own limits.
| Study | What was measured | Finding | Limits |
|---|---|---|---|
| Veracode, July 30, 2025 | 80 coding tasks with a secure and an insecure option, more than 100 models | insecure code in 45% of cases | short single-function tasks, no tests or review; the vendor’s own scanner |
| GitClear, February 2025 | 211 million changed lines, 2020 to 2024 | copied lines rose from 8.3% to 12.3% (2021 to 2024) | a trend over the years AI tools spread, not lines traced to AI; a vendor |
| DORA, September 23, 2025 | a survey of nearly 5,000 technology professionals | AI adoption goes with higher delivery throughput and lower delivery stability | self-reported, correlation only; Google sells AI tools |
| He and others, MSR ’26 | open source projects that adopted Cursor, against matched projects | a short-lived rise in speed; a lasting rise in static analysis warnings and complexity | open source only, Cursor only |
Figure 7: four studies of AI-written code, each with the limits it states or that follow from its method.
Read together, the studies point one way. Generated code needs the same checks as any other code, and without them the costs show up as instability, copied code or security findings. DORA’s report also links AI adoption to higher throughput, so it isn’t a case against agents. None of these studies measured your team, your code or this year’s models.
Rule: A benchmark or a study tells you about its own tasks on its own date; your eval on your tasks tells you about yours.
One fix with the tests locked
This trace follows one prompt from lab step 6. The repo has Omar’s change, your red test and table rows (five of them failing), and the new deny rule for test/. You start claude --permission-mode acceptEdits and type:
First run the tests. Five tests in test/pricing.test.ts fail.
The rule: a VIP student ticket costs the VIP price with 20% off, and like a
student ticket it takes no discount code. Every order pays the booking fee
once, only when it has fewer than four tickets, and only in quoteOrder.
Fix the code in src/, not the tests. If you think a test is wrong, stop and
tell me instead of changing it.
When you finish, show me the exact test command you ran and its full output.
“First run the tests” is the opening Willison recommends, because it tells the agent that a suite exists and how to run it (First run the tests, February 24, 2026). Figure 8 shows the messages in the order this trace assumes.
(Developer) [Claude Code] [Claude API] [check-routes.ts]
|-- prompt -->| | |
| |-- 1: request --------->| |
| |<- tool_use Bash -------| |
| |-- npm test: 5 fail | |
| |-- 2: + result -------->| |
| |<- tool_use Read -------| |
| |-- 3: + pricing.ts ---->| |
| |<- tool_use Edit -------| |
| |-- deny rules: src/ is not test/, allowed |
| |-- edits pricing.ts | |
| |-- PostToolUse hook ------------------------>|
| |<- exit 0, silent ---------------------------|
| |-- 4: + result -------->| |
| |<- tool_use Bash -------| |
| |-- npm test: 24 pass | |
| |-- 5: + result -------->| |
|<- summary --|<- end_turn ------------| |
Figure 8: the tests and the rules act on tool calls inside the loop; you check the result outside it.
Session start. Claude Code adds AGENTS.md and the add-route skill’s description to the context window, as in Module 7. The deny rules and the hook are settings that Claude Code applies to each tool call, whatever the model plans.
Request 1. The model calls Bash with npm test. Module 7’s allow rule Bash(npm test) matches, so it runs without a question. The result lists 24 tests and five failures, each with its name and the expected and actual numbers.
Those numbers are now in the context window. The model can see that the answer for one ticket is 1510, which is what makes a special case possible. The table rows make it useless.
Request 2. The model reads src/sales/pricing.ts and finds comboTotalCents. Its fee call and the comment above quoteOrder now sit in the same context.
Request 3. The model edits pricing.ts. Claude Code checks the deny rules first; the path is under src/, so the edit goes ahead. The edit matches the hook’s Edit|Write, and check-routes.ts exits 0, so the model sees nothing from it.
Suppose the model had called Edit on test/pricing.test.ts instead. The deny rule would have refused the call before the file changed, and the refusal would come back as the tool result. Its wording is Claude Code’s, so check what it says if your agent tries this in step 6. The prompt tells it what to do then: stop and tell you.
Request 4 and the answer. The model runs npm test again, and all 24 tests pass. Its summary includes the command and the output, as the prompt asked.
The trace ends there, and your part starts. You rerun npm test yourself, check that git diff --stat lists only files in src/, and read the diff with Figure 4. Your run may take more steps, or edit the route as well. Accept any fix that passes every check and that you can explain.
Lab: catch the double fee, then build an eval
Time: about 30 minutes. You’ll review Omar’s change, prove the bug with your own test, and catch a fix that cheats. Then the agent fixes the code with the tests locked, and you build an eval for the Module 3 tagger.
You need:
- Git, Node.js 26 LTS (v26.13.1) and Claude Code v2.1.330 or later, as in Modules 6 and 7. Claude Code costs money through a Claude plan or Console credits (pricing), or use Ollama for free (see the note at the end of the lab).
- The sample repo, cloned in Module 6 as
tinytickets-mini. - A second terminal, for the commands you run yourself.
- Your
email-taggerfolder from Module 3, and the API key from Module 2, for step 8. It makes about 70 short calls, which cost money per token (pricing).
Models: Claude Code’s default model for your account, and claude-haiku-5-5 at effort: "low" for the eval. Note which model your session uses, because with a later model, the steps stay the same and the outputs change.
Nobody recorded a run of these steps for this page. The outputs below are what to expect, so check your own output against what each step tells you to look for.
Figure 9 shows the three branches the lab uses.
main module-08/ at the start: 15 tests, the layer check passes
agent/vip-student Omar's change: 16 tests pass, the fee is charged twice
fix-vip-student yours: the red test, the table, the agent's fix, a property
Figure 9: the lab’s branches in tinytickets-mini.
Step 1: start from module-08, green
Why: a known good start means every failure later comes from the change you’re reviewing.
cd tinytickets-mini
git switch main
git pull
cd module-08
npm install
npm test
npm run check:routes
The repo is vespaiach/tinytickets-mini on GitHub. The module-08 folder is Module 7’s finished branch: AGENTS.md, the add-route skill, .claude/settings.json with the hook, the check script and GET /shows/:id. You should see 15 tests pass, and the layer check print nothing.
Step 2: check out Omar’s change, and see it pass (this step fails on purpose)
Why: you should see for yourself that every check passes on code that’s wrong.
git switch agent/vip-student
git log -1 --format=%B
npm test
npm run check:routes
The commit message is Omar’s pull request description. You should see 16 tests pass and the layer check print nothing. Before you read the diff, write down what a one-ticket VIP student order should cost, in cents.
Step 3: review the diff
Why: the tests passed, so only reading can find the bug.
git diff --stat main -- .
git diff main -- .
Go through Figure 4’s eight questions. Read test/pricing.test.ts first, then src/sales/pricing.ts, then src/routes/orders.ts. You should find bookingFeeCents called in two places, a test that calls only the helper, and no VIP student case in ticketPriceCents.
Write the bug in one sentence of your own before you go on. Optional: start claude --permission-mode plan and type /code-review, then compare its findings with yours.
Step 4: write the failing test (red)
Why: a test you wrote, and watched fail, proves the bug and guards the fix.
git switch -c fix-vip-student
In test/pricing.test.ts, delete the agent’s “VIP student combo” test, and remove comboTotalCents from the import. In its place, add the regression test from “Write the failing test first”. Then run:
npm test
Pause and predict. How many tests run, and which ones fail?
Answer
16 tests run, and 1 fails: the new one, because quoteOrder returns ticketsCents 1510 and totalCents 1660.
You should see one failure. Look in its message for the object quoteOrder returned and the one the test expected. Commit the test before any code:
git add test/pricing.test.ts
git commit -m "Red test: one VIP student ticket pays the fee once"
Step 5: a fix that cheats, and a table that catches it (this step fails on purpose)
Why: you should see a special case turn a red test green, and see what catches it.
Play the agent that games the test. Type the special case from “Tests a special case can’t pass” as the first lines inside quoteOrder, and run npm test. You should see all 16 tests pass.
Now add the table test from the same section to the end of test/pricing.test.ts. Change the import at the top so it also brings in the type:
import { ticketPriceCents, quoteOrder, type OrderLine } from "../src/sales/pricing.ts";
Run npm test. You should see 24 tests and 3 failures: “3 vip-student”, and the two mixed orders. Then remove the special case and run the tests again:
git restore src/sales/pricing.ts
npm test
You should see 5 failures: the red test and four rows, the 10% code row included. Commit the table:
git add test/pricing.test.ts
git commit -m "Table tests for VIP student orders"
Step 6: lock the tests, and let the agent fix the code (green)
Why: an agent under pressure to pass may change the test, so the tests become read-only for it.
Open .claude/settings.json and add "Edit(./test/**)" to the deny list, as in “Lock the tests”. Commit it:
git add .claude/settings.json
git commit -m "Tests are read-only for the agent"
Start a fresh session with claude --permission-mode acceptEdits, and type the prompt from the trace. When it finishes, check its work in your second terminal:
git status --short
git diff --stat
npm test
npm run check:routes
You should see changes only under src/, 24 tests pass, and the layer check print nothing. Note which files your agent changed, and whether it tried to edit a test. Read the diff with Figure 4, and write your one-sentence explanation. If the agent stopped to say a test is wrong, check the test’s numbers against the rule before you change anything.
One fix that passes (written for this page; your agent’s will differ)
In src/sales/pricing.ts, the VIP student price moves into ticketPriceCents, comboTotalCents is deleted, and quoteOrder goes back to one loop with one fee:
export function ticketPriceCents(showPriceCents: number, type: TicketType): number {
if (type === "student") {
return showPriceCents - Math.round((showPriceCents * STUDENT_PERCENT_OFF) / 100);
}
if (type === "vip") {
return showPriceCents + VIP_EXTRA_CENTS;
}
if (type === "vip-student") {
const vipCents = showPriceCents + VIP_EXTRA_CENTS;
return vipCents - Math.round((vipCents * STUDENT_PERCENT_OFF) / 100);
}
return showPriceCents;
}
// Every ticket, then the booking fee once for the whole order.
export function quoteOrder(showPriceCents: number, lines: OrderLine[], percentOff = 0): Quote {
let ticketCount = 0;
let ticketsCents = 0;
for (const line of lines) {
let unitCents = ticketPriceCents(showPriceCents, line.type);
if (line.type !== "student" && line.type !== "vip-student") {
unitCents -= Math.round((unitCents * percentOff) / 100);
}
ticketsCents += unitCents * line.quantity;
ticketCount += line.quantity;
}
const feeCents = bookingFeeCents(ticketCount);
return { ticketsCents, bookingFeeCents: feeCents, totalCents: ticketsCents + feeCents };
}
The TicketType line keeps "vip-student", and src/routes/orders.ts keeps the agent’s change. A fix that forgets the "vip-student" check in the loop fails the “10% code” row with 1374.
When you can explain the fix, commit it:
git add -A
git commit -m "Charge the booking fee once for VIP student orders"
Step 7: add a property the agent never saw
Why: the property is a hidden test for the agent’s fix, and it checks orders nobody listed.
npm install --save-dev fast-check@4.11.0
Create test/pricing-properties.test.ts with the file from “Property-based tests”, and run it on its own:
node --test test/pricing-properties.test.ts
You should see it pass on your fix. Then run it against Omar’s version of pricing.ts, and put yours back:
git restore --source agent/vip-student src/sales/pricing.ts
node --test test/pricing-properties.test.ts
git restore src/sales/pricing.ts
You should see the property fail. fast-check’s report has this shape, with your own numbers in it:
Property failed after <n> tests
{ seed: <seed>, path: "<path>", endOnFailure: true }
Counterexample: [<price>,[{"type":"vip-student","quantity":<q>}]]
Shrunk <k> time(s)
Expect the counterexample to keep a VIP student line, because orders without one are priced correctly. Run npm test to see 25 tests pass, then commit:
git add -A
git commit -m "Property test for the booking fee"
Step 8: an eval for the Module 3 tagger
Why: a prompt has no unit tests, and its output changes between runs, so you test it with trials and a grader.
Go to your email-tagger folder from Module 3. First, make tag.ts hold only the tagger, so the eval runs the same function your app would. Replace it with this version, which is Module 3’s step 5 file with export added, the usage lines removed, and the loop at the bottom removed:
// tag.ts, version 4: only the tagger; eval.ts runs it
import Anthropic from "@anthropic-ai/sdk";
import { zodOutputFormat } from "@anthropic-ai/sdk/helpers/zod";
import { z } from "zod";
import { SYSTEM } from "./prompt.ts";
const client = new Anthropic();
const model = process.env.MODEL ?? "claude-haiku-5-5";
const Tag = z.object({
tag: z.enum(["refund", "resend", "change_date", "other"]),
});
export async function tagEmail(text: string): Promise<string> {
const message = await client.messages.parse({
model,
max_tokens: 1000,
output_config: { effort: "low", format: zodOutputFormat(Tag) },
system: [{ type: "text", text: SYSTEM, cache_control: { type: "ephemeral" } }],
messages: [{ role: "user", content: `<email>\n${text}\n</email>` }],
});
if (message.stop_reason !== "end_turn") {
return `stopped: ${message.stop_reason}`;
}
return message.parsed_output?.tag ?? "no tag";
}
Then create eval.ts:
// eval.ts: run the tagger on the golden set several times and grade each answer
import { emails } from "./emails.ts";
import { tagEmail } from "./tag.ts";
const TRIALS = Number(process.env.TRIALS ?? 3);
const PASS_MARK = Number(process.env.PASS_MARK ?? emails.length); // emails right in every trial
const timesRight = new Map<string, number>(); // email id -> trials it was right in
for (let trial = 1; trial <= TRIALS; trial++) {
let score = 0;
for (const email of emails) {
let tag: string;
try {
tag = await tagEmail(email.text);
} catch (error) {
tag = `error: ${(error as Error).message}`;
}
const ok = tag === email.expected; // the grader
if (ok) {
score++;
} else {
console.log(`trial ${trial} ${email.id} expected ${email.expected} got ${tag}`);
}
timesRight.set(email.id, (timesRight.get(email.id) ?? 0) + (ok ? 1 : 0));
}
console.log(`trial ${trial}: ${score}/${emails.length}`);
}
const counts = [...timesRight.values()];
const everyTrial = counts.filter((n) => n === TRIALS).length;
const anyTrial = counts.filter((n) => n > 0).length;
console.log(`right in every trial (pass^${TRIALS}): ${everyTrial}/${emails.length}`);
console.log(`right in at least one (pass@${TRIALS}): ${anyTrial}/${emails.length}`);
if (everyTrial < PASS_MARK) {
console.log(`FAIL: ${everyTrial} emails right in every trial, ${PASS_MARK} needed`);
process.exitCode = 1;
}
Notice three things. The grader is the one line marked // the grader. An error from parse counts as a wrong answer, not a crash. And the exit code is 1 when fewer than PASS_MARK emails were right in every trial, so CI can run it as a regression eval.
Run it, and print the exit code:
node eval.ts
echo $?
You should see a score for each of three trials, a line for each wrong answer, the two counts, and 0 if all twelve emails were right every time. If an email fails even here, that’s a finding: the prompt isn’t reliable on that email yet.
Now break the prompt on purpose. In prompt.ts, delete the two lines in <rules> that start “Exception:” and “For a fallback,”. Run node eval.ts and echo $? again.
Pause and predict. Which email do you expect to fail, and in how many trials?
You may see e11, Ana’s email, tagged refund in some or all trials. If so, check that pass^3 drops below 12 and the exit code turns to 1.
If e11 still passes every trial, that’s a result too. One of the five examples still shows a fallback, so the model may apply it anyway. Twelve emails and three trials can miss a change, and that’s what Anthropic’s “20-50 simple tasks” advice guards against. Put the two lines back.
Ollama note. Steps 1 to 5 and 7 need no model. For step 6, set up Claude Code with Ollama v0.40.17 and
qwen3-coder(orqwen3:8bon a 16 GB machine) as in Module 6’s lab. The deny rule and the hook behave the same, because Claude Code runs them, not the model.For step 8, run
ANTHROPIC_BASE_URL=http://localhost:11434 ANTHROPIC_API_KEY=ollama MODEL=qwen3.5:4b node eval.ts. Ollama ignoresoutput_config.formatandcache_control, soparseerrors appear and count as wrong. You’re likely to see a lower score that changes more between trials, and setPASS_MARKto your baseline to see the broken prompt move it.Other agents. Steps 2 to 5 and 7 use only Git and Node.js. Step 6’s prompt works in any agent that reads
AGENTS.md; the deny rule is Claude Code’s own setting.
Going deeper
Checks Claude Code runs at the end of a turn
Anthropic’s best-practices page lists four ways to give Claude a check, from soft to strict (best practices):
- In the prompt, as the lab does: the model decides whether to run it.
/goal: a separate model checks a condition after every turn.- A
Stophook (Module 7) that exits 2: Claude goes back to work until a script passes. /code-review: a fresh reviewer reads the diff.
The Stop hook is the only one where a program, not a model, decides.
Models that watch for cheating
ImpossibleBench also tried model reviewers as monitors for cheating. They caught 86 to 89% of it on the LiveCodeBench tasks, and only 42 to 65% on the SWE-bench tasks, which come from real repositories. So the monitors caught the least on the tasks that look most like work on your own repo.
Where pass@k and pass^k come from
pass@k was introduced for code generation in OpenAI’s Codex paper, which scored a problem as solved if any of k samples passed its tests (Chen and others, July 2021). pass^k came from τ-bench, built to measure “the reliability of agent behavior over multiple trials” (Yao and others, June 2024). The first fits a person picking the best answer; the second fits a system that acts alone.
When top scores reach the ceiling
A benchmark is saturated when the best scores bunch near its ceiling, so it can no longer separate models. Anthropic defines it for agent evals as “when an agent passes all of the solvable tasks, leaving no room for improvement.” OpenAI gave slowing progress on SWE-bench Verified, “from 74.9% to 80.9% in the last 6 months”, as one sign before it stopped using it. Your own eval saturates too, and that’s the moment to add harder emails from real failures.
Common mistakes when you verify agent code
- Trusting “all tests pass” in a summary. Symptom: a pull request that passed in the agent’s words and fails in CI, or never ran some tests. Fix: run the full test command yourself, and compare the test count with the count before the change.
- Writing the test after the fix. Symptom: a new test that passes the first time you run it. Fix: run it on the broken code first, and see it fail for the reason you expect.
- Testing the helper, not the behavior. Symptom: a test of
comboTotalCentspasses whilequoteOrderis wrong. Fix: test the function the user’s request reaches, with the numbers a person worked out. - One example per rule, at the boundary. Symptom: the only multi-ticket case has four tickets, where the fee is 0 twice. Fix: add rows on both sides of every boundary, and a property for rules over many inputs.
- “Don’t change the tests” as the only guard. Symptom: a test’s expected number changed in the diff. Fix: a deny rule on
test/, test files read first in review, and a way for the agent to stop and report. - Running the eval once. Symptom: a prompt change “fixes” an email that fails again tomorrow. Fix: three or more trials, and a gate on pass^k.
- Putting the golden set into the prompt. Symptom: a perfect eval score and wrong tags on new emails. Fix: keep the eval’s emails out of the prompt’s examples, as Module 3 did.
- A model judge nobody checked. Symptom: high scores for long or familiar answers. Fix: a rubric, a different judge model, swapped answer order, and a sample graded by a person.
Check yourself
Scenario. Omar asks the agent to add a “no booking fee for members” rule, and its pull request says “All 26 tests pass.” The diff changes one expected value in test/pricing.test.ts from 1350 to 1200. It also adds this line to quoteOrder: if (lines.length === 1 && lines[0].quantity === 1) return { ticketsCents: 1200, bookingFeeCents: 0, totalCents: 1200 };. What do you do?
Answer
Don’t approve it, because both signs of reward hacking are there: a changed expected value and a branch on one exact input. The code doesn’t know whether the buyer is a member at all.
Find out which rule the team wants, and restore the old test if non-members still pay the fee. Then write a red test for a member order, and watch it fail.
Lock test/ with a deny rule. Add table rows for members and non-members on both sides of four tickets, and ask the agent to fix the code and stop if a test looks wrong. Rerun the tests yourself, and approve only a change you can explain.
- Why should a new regression test fail before you let the agent fix the code?
- An agent’s change adds
test.skipto one test, and its summary says all tests pass. Which two checks from this module catch it? - The agent special-cases the one-ticket order. Which kind of test fails, and why does the special case not help it?
- In a three-trial eval, e11 is right in trials 1 and 3 and wrong in trial 2. Does it count toward pass@3? Toward pass^3?
- A model scores 80% on a public coding benchmark. Give two reasons that number may not predict how it does on your repo.
Answers
- A test that never failed hasn’t shown it can catch the bug; seeing it fail confirms it tests the right thing.
- Reading test files first in the diff, and comparing the number of tests that run before and after the change.
- A table-driven or property-based test, because it checks orders the special case doesn’t match, such as three tickets or mixed orders.
- Yes for pass@3, because it was right at least once; no for pass^3, because it wasn’t right every time.
- Contamination (the answers may be in the training data), and broken or narrow tests on tasks unlike yours, run through a different setup.
Cheat sheet
Verifying an agent’s work
- Green isn’t right: tests check only what they call; read what they call.
- Red first: write the test, watch it fail, commit it, then let the agent fix the code.
- Lock the tests: deny
Edit(./test/**), and let the agent stop and report a test it thinks is wrong. - Gaming signs: branches on exact inputs, changed or skipped tests, fewer tests, claims with no output.
- Hard to game: table rows on both sides of a boundary, a property for every input, a check the agent never saw.
- Review: small diff, tests first, one place per rule, evidence, explain it in your own words.
- Eval: a golden set, a grader (code first), several trials, a pass mark.
- pass@k vs pass^k: right at least once in k tries, or right in all k.
- Benchmarks: one task set, one setup, one date; watch for contamination.
Figure 10 is the module in one picture: what checks each part of a change.
(Developer) writes --> red test, table ------+
| read-only for the agent
[Agent] edits src/ --> npm test, hook -------+--> green?
|
(Developer) adds --> property (hidden) -----+--> still green?
|
(Developer) reads --> the diff, Figure 4 ----+--> can you explain it?
|
approve
prompts: golden set --> tagger x 3 trials --> grader --> pass^k >= mark?
Figure 10: tests the agent can see, a check it can’t, and your review, then an eval for the parts that call a model.
Next, Module 9 looks at what the agent reads rather than what it writes: a note in a pull request from outside the team that tells the agent to print the environment.
Sources
- Andrej Karpathy, Verifiability, November 17, 2025; 2025 LLM Year in Review, December 19, 2025; Sequoia Ascent 2026 summary, April 30, 2026 (summary written by Codex 5.5 and read by him, followed by his edited transcript; video).
- Simon Willison, Hallucinations in code are the least dangerous form of LLM mistakes, March 2, 2025; Your job is to deliver code you have proven to work, December 18, 2025; Agentic Engineering Patterns, Red/green TDD (February 23, 2026) and First run the tests (February 24, 2026).
- Anthropic: Claude Code: Best practices for agentic coding, April 18, 2025 (archived copy); Demystifying evals for AI agents, January 9, 2026; Create strong empirical evaluations, checked 2026-11-22; Claude 3.7 Sonnet system card, February 2025; Claude Opus 4 and Sonnet 4 system card, May 2025; Introducing Claude Opus 5.5, September 22, 2026.
- Claude Code docs, checked 2026-11-22: best practices, code review, permissions; Claude Code issues #319 and #46940.
- METR, Recent Frontier Models Are Reward Hacking, June 5, 2025; Many SWE-bench-Passing PRs Would Not Be Merged into Main, March 10, 2026.
- Zhong, Raghunathan and Carlini, ImpossibleBench: Measuring LLMs’ Propensity of Exploiting Test Cases, arXiv, October 23, 2025.
- Zheng and others, Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena, 2023; Panickssery, Bowman and Feng, LLM Evaluators Recognize and Favor Their Own Generations, 2024; Chen and others, Evaluating Large Language Models Trained on Code, 2021; Yao and others, τ-bench, 2024.
- OpenAI, Why we no longer evaluate SWE-bench Verified, February 23, 2026; Separating signal from noise in coding evaluations, July 8, 2026.
- Veracode, 2025 GenAI Code Security Report; GitClear, AI Copilot Code Quality 2025; Google Cloud, Announcing the 2025 DORA report; He, Miller, Agarwal, Kästner and Vasilescu, Speed at the Cost of Quality, MSR ’26.
- Google Engineering Practices, Small CLs and What to look for in a code review; GitHub, Copilot code review, checked 2026-11-22.
- fast-check 4.11.0 (npm); Node.js test runner and assert.