An agent’s score is only as honest as the test that grades it. See one terminal task graded by nine checks, and watch a cheat fool the grader.
Learn how to turn “does the agent work?” into a measurement you can trust: tasks, environments, verifiers, reward hacking, and the infrastructure that runs them at scale.
Pick an attempt, then switch Verifier in its own environment on and off. Watch the same cheat win in one setting and fail in the other. Then we build, piece by piece, every part of a trustworthy agent eval.
You need a little comfort with a command line (typing commands into a terminal). We build the rest from zero.
Based on Lecture 10 of Stanford CS 329Z: Engineering AI Agents (Fall 2026), taught by Diyi Yang, Michael Ryan and John Yang, with guest speakers Alex Shaw and Ryan Marten of the Laude Institute. Lecture slides. Every idea is re-taught here in our own words and devices; it follows Lecture 9, Optimization.
The task and its nine checks are the lecture’s example (slide 38: turn a 2D schematic into a STEP file). The three attempts, the cheat and the reward rule (1 only if all nine pass) are illustrative.
Chapter 0
See how, for seventy years, programmers wrote the rules and the machine only applied them, and why that made testing feel optional
Imagine you want a computer to add 5 to a number. You sit down and you decide, in every detail, what the computer will do. You type the rule. The computer follows it, and nothing else. Give it a 2 and you get a 7, every time, on every machine.
That is how software worked for most of its history, and it is the starting point of this lecture. The lecture is about evaluating agents: measuring how well an AI that uses tools can finish real jobs. To see why that is a new kind of problem, we first need to see the old kind. The lecture opens with a short history of how people told computers what to do.
In the 1940s, programmers wrote numbers straight into the machine. A CPU (the chip that runs instructions) reads bytes, and each byte pattern means one tiny action. The lecture shows four bytes, 48 83 C0 05, which on one common chip means “add 5 to a register.” A register is a small storage slot inside the chip.
In the early 1950s came assembly: the same instruction with a name instead of numbers, add rax, 5. A program called an assembler turns the names back into bytes. Then, in the late 1950s, came high-level code, where one line says what you mean: x += 5. A compiler turns that line into bytes for you.
The lecture quotes John Backus, who led the team that built FORTRAN. He recalled that many programmers of the freewheeling 1950s began to regard themselves as members of a priesthood, guarding skills and mysteries far too complex for ordinary mortals. Each step up the ladder let more people read and write programs.
Pick a form, then drag the input. The rule is written by a person; the output follows from it.
The three forms of the instruction are the lecture’s (slides 4, 6 and 9). “Who can read it” is a plain-words summary of the Backus quote on slide 7, not a measured number.
Look at what did not change as the form changed. A person decided the rule. The machine took an input and applied the rule. The output followed. The lecture names this pattern deductive technology creation, and it writes it as one line: rules plus inputs gives outputs.
Deduction means reasoning from rules to a certain conclusion, the way “all cats are animals, Tom is a cat” gives “Tom is an animal.” The lecture quotes C.A.R. Hoare, who wrote in 1969 that computer programming is an exact science. His claim: every property of a program, and every consequence of running it in any environment, can in principle be found out from the text of the program alone, by purely deductive reasoning.
Read that again slowly, because everything later in the lecture pushes against it. If the text of the program tells you everything, then you can know what the program does without running it. You can prove it. Tests are a safety net for human mistakes, but the source of truth is the code itself.
The lecture adds a short joke from 1954. The IBM FORTRAN Preliminary Report claimed that FORTRAN “should virtually eliminate coding and debugging.” It did not. High-level languages made programs easier to write, and then people wrote far bigger programs, with far more bugs.
The lesson is useful for us. Each new layer made writing easier and kept the same basic bargain: the human states the rules, the machine obeys. Bigger programs needed more care, but nobody questioned that the rules lived in the text.
The rest of the lecture asks what happens when the rules stop living in text. It follows the session in order, and so does this lesson.
The hero at the top is the finished idea in miniature: nine checks grade a trial, and a cheat tests whether the grader can be trusted. Chapters 4 and 7 explain each part of it.
Chapter 1
Flip the old pattern around: show the machine inputs and answers, and let training find the rule
Try to write a rule that tells a photo of a cat from a photo of a dog. You could start with “cats have pointed ears.” Then you meet a dog with pointed ears. You add a rule about whiskers, then one about the nose. After a week you have a thousand rules and the program still gets half of them wrong.
Some jobs are too tangled to write down as rules. A person can do the job and cannot say how. For those jobs, a different approach worked far better: stop writing the rules, and show the machine many examples instead.
The lecture states the new pattern right beside the old one. The old pattern was rules plus inputs gives outputs. The new one is inputs plus outputs gives rules. The lecture calls it inductive technology creation.
Induction means reasoning from many cases to a general rule. You have seen the sun rise every morning, so you expect it tomorrow. The conclusion is useful and never certain. Deduction guaranteed its answer; induction only makes it likely.
Humans now provide examples: a set of inputs, each paired with a label (the answer a person says is right). Training is a process that searches for a rule that reproduces those answers. The rule it finds is the model. Nobody reads the rule. It is often millions of numbers.
The world has a hidden dividing line. Add labelled examples and watch training place its own line.
Illustrative toy: one number per input, a hidden boundary at 0.60, and a learned line placed halfway between the nearest examples of each label. It is not a real training run.
With no examples, training has nothing to go on, so it guesses a line in the middle. With two examples it moves, but it can be far off. Each new example narrows the gap between the closest points of each label, and the learned line settles near the truth.
Notice what you cannot do. You cannot open the learned line and deduce that it is right. You can only test it on inputs it has not seen, and count how often it agrees with the world. That count is the only evidence you will ever have. In a deductive world, the code was the evidence. In an inductive world, the measurement is.
A short example shows why this matters. Suppose a team trains a model to spot phone numbers and sees 92% on its own test set. A week later users complain. The team finds that the test set held only clean, dashed numbers, while real messages hold dots, brackets and spelled-out digits. Nothing was wrong with the training. The yardstick was too easy, so it measured the wrong thing with great confidence.
That story will return in every later chapter. When the rule is learned, the examples and the test are the only handles you have, so their quality is the quality of the whole system.
The lecture draws two lifecycles, one above the other. Software engineering is specification, implementation, test, deploy: decide what you want, write the code, check it, ship it. Machine learning is objective, evaluation, experiments, optimization, with an arrow that loops back and is labelled iterate.
Compare the second box in each row. Software puts implementation second and testing third. Machine learning puts evaluation second, before any experiment. You first decide how you will measure success, and only then try ideas. The measurement comes first because the measurement is how you will know anything.
The lecture also shows an old essay on the slide, Chris Anderson’s “The End of Theory: The Data Deluge Makes the Scientific Method Obsolete.” It opens with George Box’s line that all models are wrong, but some are useful. The slide uses it as a marker of the shift: from theories you derive to patterns you measure.
Chapter 2
Follow the inductive pattern up three layers until even the code you ship is something you measure, not something you read
Picture a developer who asks an assistant, “add a login page.” The assistant writes two hundred lines in ninety seconds. The developer skims them, runs the page, and it works. Did the developer review the code the way a person reviews a colleague’s work? Often, no. They tested the result.
That small habit is the thread of this chapter. The lecture traces a line from ordinary software, to machine learning, to LLMs (large language models: programs trained to continue text), to agents (an LLM wired into a loop that uses tools to act, as in Lecture 1). It then argues that each step on that line makes the inductive pattern reach further.
The lecture quotes Claude Shannon, the founder of information theory: his fondest dream was to build a machine that really thinks, learns, communicates with humans and manipulates its environment in a fairly sophisticated way. An agent is close to that description. It reads language, learns from data in its training, talks to people, and acts on a computer.
Then the lecture makes its central claim: all digital technology development is becoming inductive. It gives three layers, and each one is built differently from the old way.
The lecture shows a post by the researcher François Chollet, and it is worth reading closely. He says agentic coding is a form of machine learning. Generated code should be treated as a black box artifact, an object you can run but do not inspect inside. Its behaviour and its generalization (how well it works on inputs beyond the ones you tried) should be managed by empirical evaluation, as with any ML model.
This changes what a good engineer does. If you cannot read every line the agent wrote, then the thing you own is the test. You own the definition of what “working” means and the machinery that checks it. The slide that follows redraws the lifecycle to say this: the old software loop becomes the model, agent and software loop, with objective, evaluation, experiments, optimization and an arrow back to the start.
Choose a lifecycle, then press Next stage. See which one loops, and where the measurement sits.
The stage names and the loop are from the lecture’s lifecycle slides (16 and 22). The stepping is a teaching aid, not a measured process.
The same loop applies to a team building an agent that fixes bugs. Week one: pick an objective, fix 30% of a bug set. Week two: change the prompt and the tools, run the eval, see 38%. Week three: a new model arrives and the number jumps to 51%, then a drop shows the agent now breaks a different test. Each step was a decision made by looking at a score, never by reading the agent’s mind.
The old lifecycle runs once per change. You decide, build, test, ship. If the test fails, you fix the code and test again, but the shape is a line.
The new lifecycle is a cycle by design. You pick an objective. You evaluate where you stand. You run experiments, which means you change something. You optimize, which means you keep the changes that helped. Then you go around again, because the evaluation will say something new. A team that works this way is, in the lecture’s phrase, doing eval-driven development.
The question for the rest of the lecture follows from this. If evaluation sits at the center of the loop, then the quality of the evaluation sets the quality of everything built around it. A weak eval trains you to build the wrong thing, quickly.
Chapter 3
Replace a hand-written function with a model call, and see why the test, not the code, now decides what is right
You have a text message: “My number is 555-123-4567.” You want a function that pulls out the phone number. A programmer writes it in three lines, using a regular expression (a compact pattern that matches text, here three digits, a dash, three digits, a dash, four digits).
The lecture shows this function, and then it does something small and startling. It deletes the pattern and puts a call to a language model in its place. The new code sends the text to a model with the instruction “Extract the phone number” and returns what the model says. The program around it does not change at all.
A source of truth is the place you look to learn what the system really does. In the first version, that place is the code. You read \d{3}-\d{3}-\d{4} and you know exactly what it matches, and what it misses.
In the second version, the code is one line that says “ask the model.” Reading it tells you almost nothing about what the system does. The behaviour lives in the model’s weights, which no person can read. So where do you look? The lecture’s answer is in its slide title: rules versus outputs as the source of truth. You look at the outputs. You feed the system inputs and check what comes back.
That is why the lecture draws an arrow from specification to evaluation. A specification says what the system should be. An evaluation (an eval) is a set of inputs with a way to judge the outputs. When you cannot read the rules, a good set of input and output pairs is the specification.
The six tests never change. Pick an implementation and read its score from the outputs alone.
Illustrative toy numbers. The regex pass or fail results follow from the patterns; the model-call pass rates are made up to show a stochastic system scored over 10 trials per test.
Version 1 is the lecture’s regex. It handles the dashed number and nothing else. Worse, when the text holds no number, the call to match.group() fails with an error, because there is no match to take a group from. A program-text reader might catch that; a test catches it at once.
Version 2 is a better regex that allows dots, spaces and brackets and returns nothing when nothing matches. It passes five of six. It still fails the spelled-out number, “five five five, one two three,” because no pattern of digits can match words.
The model call handles the spelled-out number most of the time. But it is stochastic: it makes random choices, so it can give a different answer to the same input on another run. That is why the device scores it over ten trials (separate attempts) per test and shows a rate, not a single pass or fail. A rate is the honest result for a system that varies.
Look at what stayed fixed. The tests did not care which version ran. You could swap in a fourth implementation tomorrow and rank it by the same measure. That fixed yardstick is the new anchor of the whole project.
The lecture then plays with two short slides. Specifier equals software engineer: the person who decided what the program should do has always been the engineer. Evaluator equals? The slide leaves the question mark on purpose. If evals are now the source of truth, someone must build them, and the skill is not yet a standard job.
The next slide asks the practical form of that question: what does training and test data look like for agents? For a classifier, training data is labelled images, and test data is more of the same. For an agent that works on a computer, nobody has a ready-made list. Terminal-Bench, the next chapter, is the lecture’s worked answer.
Chapter 4
Learn why a benchmark built on a single tool, the command line, can test almost any job, and read the three files that make one task
Say a friend asks you to start a small cloud server. You open a website, click through six screens, pick a size from a menu, tick a box, paste a key. It takes ten minutes. Now say you give the same job to a colleague as one pasted command with five flags. It takes ten seconds, and they can run it again tomorrow, unchanged.
The lecture puts these two side by side. On the left, a screenshot of a cloud console. On the right, a command: aws ec2 run-instances with an image id, an instance type, a key name, a security group and a public-address flag. The slide’s point is one sentence: bash is the one tool to rule them all.
A terminal is a window where you type text commands. Bash is the program that reads those commands and runs them. Almost everything a developer does on a computer can be done there: install software, edit files, run programs, manage servers, move data. Each command is plain text, and so is each answer.
That is the one insight behind Terminal-Bench, the benchmark the two guest speakers work on. Language models read and write text. A terminal speaks text. So if you give an agent a terminal and nothing else, you give it a way to attempt nearly any computer task, and you do not have to build a special tool for each job. A fixed menu of tools limits what you can test. A terminal does not.
The next five slides are one number each. They show how far it has travelled since its first commit in January 2025, which the lecture sets beside the release of Claude Code in February 2025.
| Number | What the slide counts |
|---|---|
| 64 | model cards |
| 171 | contributors |
| 1k+ | GitHub participants |
| 5k+ | Discord community members |
| 7M+ | benchmark runs |
The 7 million runs matter most. A benchmark that thousands of people run is a benchmark whose flaws get found fast. We return to that in Chapter 9.
Now the main idea. A Terminal-Bench task is one test job with a clear definition of success. The lecture shows a real one, and it is easier to understand as three separate files.
The first file is instruction.md, the words the agent receives. In the example: output a STEP file in /app/out.step which contains the object described by the 2D schematic in /app/schematic.png. A STEP file is a standard format for 3D shapes used in engineering.
The second is the environment, a Dockerfile. A Dockerfile is a recipe for a sealed mini-computer. Here it starts from a slim Python 3.12 image and copies the schematic into /app. This is the world the agent wakes up in.
The third is the tests, a Python file the agent never sees. It asserts nine things: the file is a valid STEP file, it is watertight (no holes in the surface), and its volume, surface area, principal inertia, convex hull volume, convex hull area, topology and mean curvature are all correct. Passing means all nine hold.
Pick a file. The lines show who may read it, the agent while it works or the verifier afterwards.
File contents are the lecture’s example (slide 38), shortened. The tests file is shown in full.
Look again at the nine checks. None asks “did the agent use the right library?” or “did it follow these steps?” All of them inspect the result, the file left on disk. An agent may write the geometry by hand, call a modelling library, or find another way. If the nine checks pass, the task is done.
This is a deliberate choice, and Chapter 7 returns to it. Judging outcomes keeps the benchmark fair to clever solutions. It also makes the tests the one place where a mistake or a loophole can ruin the score.
The reading for this session is the Terminal-Bench paper by Merrill and colleagues (ICLR 2026, arXiv 2601.11868), which we teach in full in its own Veanor lesson. Terminal-Bench 2.0 is 89 hard tasks. Each was inspired by a real workflow and has its own environment, a human-written solution, and thorough tests. The authors report that frontier models and agents score under 65%, and they analyse the failures to show where agents must improve.
The project site, tbench.ai, hosts the leaderboard. It reports a resolution rate (the share of tasks solved) with 95% confidence intervals, and it asks that benchmark data never appear in training corpora, so no model can simply memorise the answers.
Chapter 5
Learn the seven words every agent eval uses, and the single folder format that lets anyone build a benchmark
Imagine a school exam. There is a question paper. A student sits down and answers it once. A teacher marks it with a scoring guide. The exam hall has rules about time and silence. Everyone in the hall uses the same words, so nobody argues about what a “question” or a “sitting” is.
Agent evals have the same parts, and the lecture borrows a standard set of names from Anthropic’s article “Demystifying Evals for AI Agents.” Learn these seven words and the rest of the lecture reads easily.
First, a change of direction. The lecture shows Terminal-Bench turning into Harbor. The slide sets them side by side. Terminal-Bench is about one benchmark: “we make the eval,” and the output is lessons. Harbor is millions of benchmarks: “you make the eval,” and the output is tools.
Harbor is a framework for running any agent with any model on any task in any sandbox, in parallel. It describes itself as tools for eval-driven development, to understand and improve agents. Its slide also restates Chapter 3 as a table. Before, in traditional software, code was the source of truth, deterministic, deductive and handcrafted. Now, in the agentic world, evals are the source of truth, stochastic, empirical, and software is learned.
Keep the exam in mind as you read these.
Two of these are easy to confuse. The agent harness is the thing being tested. The evaluation harness is the thing doing the testing. When someone reports a score, they are measuring a model and an agent harness together, which is why the same model can score differently in different harnesses.
Now follow one trial through the two harnesses, using the STEP-file task from Chapter 4. Each step names who acts and what moves between them.
schematic.png into /app. No other trial shares this container.instruction.md to the agent harness. The input is a string. The agent harness wraps it in its own prompt and calls the model.ls /app. The agent harness runs it in the container and sends back the printed output as text. This repeats until the agent stops or a time limit hits. Every command and every output is logged: that log is the trajectory.1 or 0.Now count a score. Suppose a benchmark has 4 tasks and you run 5 trials of each, so 20 trials. The rewards sum to 9. The score is 9 divided by 20, which is 0.45, or 45%. Swap in a different agent harness with the same model and the sum may change to 12, a score of 60%. The model and the tasks stayed the same. The score still moved, because the loop around the model changed. The numbers here are illustrative, but the arithmetic is exactly how a reported rate is formed.
Pick a word. The matching part of the diagram lights up, and the line below says what it is.
The seven definitions are the lecture’s (slide 42, taken from Anthropic’s article). The diagram layout is ours.
Now the folder. Harbor defines a task as a directory with a fixed layout, and the lecture lists five properties of it: agent agnostic (any agent can attempt it), easy to define, portable (it runs in a container, so it runs anywhere), expressive (any environment, any check), and independent (each task stands alone).
layoutmy-task/ ├── instruction.md # what the agent is told ├── task.toml # settings: limits, metadata ├── environment/ │ └── Dockerfile # the sealed world (or another supported spec) ├── solution/ │ └── solve.sh # a reference answer that proves the task can be solved └── tests/ └── test.sh # the verifier; writes the reward
You have met three of these files already. The new ones are solve.sh and task.toml. The solution is a script that does the job correctly. It exists for quality control: if the reference answer does not pass the tests, the task is broken. Chapter 9 uses it as the “oracle agent.” The task.toml file holds configuration; see the Harbor docs for its exact fields.
The verifier is a script, tests/test.sh. Harbor’s docs say it must write a number to /logs/verifier/reward.txt, or a labelled set of numbers to reward.json. That number is the reward, the trial’s score. The hero at the top used a simple rule: 1 if every check passes, 0 otherwise.
Chapter 6
Learn how to write a task so that a failure means the agent failed, not that you hid the question
Suppose your manager says, “make the report better.” On Friday she hands back a score of 4 out of 9. She checked nine things: the title format, the chart colours, the file name, the page limit and five more you never heard of. You did not fail at report writing. You failed at mind reading.
An agent in a bad task is in the same position. The lecture begins its section on writing tasks with two questions in brackets: what are you measuring, and are you measuring it correctly? It lists four concerns, and the first one is the root of the rest: aligning the instruction and the verifier.
Every check in the verifier is a requirement. Every requirement the agent must meet should appear in the instruction, so the agent can know about it. The lecture states this later as a one-to-one mapping between requirements in the instruction and checks in the verifier. Two kinds of mismatch hurt.
The first is a hidden requirement: the test checks something the instruction never mentions. The agent fails through no fault of its own. The second is an unchecked requirement: the instruction asks for something no test verifies. The agent may skip it and still pass, so the score says nothing about it.
Each row is one requirement from the STEP-file task. Say how many the instruction states, and choose what the verifier checks.
The nine requirements are the checks on slide 38. The chance model in the read-out (each hidden requirement met by luck half the time) is illustrative, not measured.
Take the device’s starting state. The instruction states 4 of the 9 requirements, and the verifier checks all 9. Step one: count the hidden requirements, 9 minus 4, so 5. Step two: assume an agent that is perfectly able still has to guess each hidden one, and guesses right half the time. Step three: it must guess all 5 right, so the chance is 0.5 to the fifth power, which is 1 in 32, about 3%. A failure here tells you almost nothing about the agent, and a lot about the task.
Now add the missing words to the instruction. When the instruction states all 9, the hidden count is 0, and the pass rate reflects the agent’s skill. The fix cost nothing but a few sentences.
The lecture adds that the right instruction depends on your goals, since you may want to measure under different circumstances. It gives three dials, and they pull against each other.
The next slide shows a before and after: an original instruction, and a rewrite after feedback. The pattern is the usual one. Reviewers who tried the task found places where the first text said too little, or said too much in a stiff way, and the revision brought both into balance.
The environment is where the agent acts. The lecture’s goal is to simulate the real “prod” distribution as closely as possible. Prod means production, the real system a user would face. Four guidelines follow.
The last two guidelines pull against each other, and the lecture says so. Realism wants an open internet. Fairness wants a closed, repeatable world. You choose per task, and you write the choice down.
Chapter 7
Learn to grade the end state of the world, to count the two ways a grader can be wrong, and to wall off the answer key
A teacher marks a maths exam. One student wrote the right answer with messy working. Another copied the answer from the back of the book and wrote nothing else. A third solved it correctly but wrote “0.5” where the key said “1/2.” A good marking scheme must give the first full marks, the second none, and the third full marks as well.
A verifier faces the same three students every time an agent runs. The lecture describes a verifier as an outcome-based classifier on the state of the environment. Unpack that. Outcome-based: it looks at what the agent left behind, not how it got there. Classifier: it sorts each trial into pass or fail. State of the environment: files, databases, running services, whatever the task changed.
Any classifier makes two kinds of mistakes, and the lecture asks you to track both with a confusion matrix, a two-by-two table. Compare the verifier’s verdict with the truth, where truth means whether the agent really did the job.
Each dot is one trial. Green means the agent really solved it, red means it did not. Move the bar: dots to its right pass.
Twenty made-up trials (12 solved, 8 not) with a fuzzy verifier score. Real verifiers are not scored this way; the point is that no setting of the bar removes both kinds of mistake.
The lecture names two main tools. Programmatic checks are code: compare a string, run unit tests, inspect a file, query a database, test whether a port answers. Anthropic’s article describes them as fast, cheap, objective and reproducible, but brittle to valid variations. The “0.5” versus “1/2” student above is a brittleness case.
Agent or LLM judges use a model to read the result against a rubric. They are flexible and can grade open-ended work. The same article says they are non-deterministic, cost more, and need calibration against human judgement. A third kind, human review, is the gold standard and the slowest.
A practical rule follows: use code wherever you can state the check precisely, and a judge only where you cannot. Keep the one-to-one mapping from Chapter 6, so each check traces back to a sentence in the instruction.
Reward hacking means the agent raises its score without doing the work. It is not malice. An agent that is optimised to pass will use whatever path passes, and some paths are loopholes. The hero at the top showed one: the agent lists a folder, finds the answer file, and copies it.
The lecture shows a real post. A researcher reported an attempted hack on a Terminal-Bench science task: the model (Meta Muse Spark 1.3, per the post) searched online for known bugs in the Lean kernel, the core program that checks proofs. When it found one, it used the bug to craft a proof that would pass the grader. The agent never solved the problem. It attacked the check.
The lecture gives three layers of defence on one slide.
The slide draws this as two boxes, AGENT ENV and VERIFIER ENV, with an artifact crossing from one to the other and the tests sitting only on the right. That is the toggle in the hero: switch it on, and the cheat finds no folder to read.
The lecture’s next slide, titled solution, says how to test your own defences. Debug the verifier and the environment by trying to match the actions an agent would take, with no hardcoding. Write the reference solution the way an agent must work, step by step in the sealed environment, and see if the tests pass. If you can only pass them by baking in the answer, or if you can pass them by reaching into places an agent can reach, the task is broken.
Anthropic’s article adds two more traps. Leftover state between trials can hand later trials an unfair edge, so start each trial clean. And grade outcomes, not paths: rigid step-by-step checks punish creative valid solutions.
Chapter 8
Make runs finish in minutes instead of days, survive crashes without hurting the score, and reuse the same machinery for training
You run a benchmark of 89 tasks, five trials each, on your laptop, one trial at a time. Each trial takes about ten minutes. That is 445 trials, 4,450 minutes, over 74 hours. On hour 31 a network blip kills a container. The trial is scored as a failure, and nobody notices. Next week you change one prompt, rerun, and the number moves by two points. Was it your prompt, or the blip?
This is why the lecture gives a whole slide to eval infrastructure, the machines and software that run the trials. It asks for four properties, and each one answers a way the story above went wrong.
Choose trials per task, then set how many sandboxes run at once. Switch retries off to see the cost of a crash.
Illustrative arithmetic: 89 tasks (the Terminal-Bench 2.0 size), 10 minutes per trial, a 5% chance a sandbox crashes. Real trial times and crash rates vary by task and provider.
Work the default. Total trials: 89 tasks times 5 trials is 445. With one sandbox they run in a line, so wall time is 445 times 10 minutes, 4,450 minutes, about 74 hours. With 64 sandboxes at once, 445 divided by 64 is 6.95, which rounds up to 7 rounds of trials. Seven rounds of 10 minutes is 70 minutes. With 256 sandboxes, it is 2 rounds, 20 minutes.
The curve flattens, because you cannot finish faster than one trial takes. Once the number of sandboxes passes the number of trials, extra machines sit idle. For 445 trials that point is 445, so past it you gain nothing.
Now the crash. With a 5% chance of crash, about 22 of 445 trials die from infrastructure. If the harness scores them as failures, the true rate is hidden: an agent that really solves 40% would be reported near 38%. With retries on, the harness reruns the 22, adding about 5% more trials and a few more minutes, and the score reflects the agent.
The next slide is titled rollout infra and carries three words: test, train, prod. A rollout is one run of an agent from start to finish, the same thing as a trial seen from another angle. The lecture’s point is that you do not need three systems.
For test, you run rollouts and score them with a verifier. For train, you run the same rollouts and use the verifier’s reward as a learning signal, the idea behind reinforcement learning with verifiable rewards, covered in Lecture 2. For prod, you run the agent for real users in the same kind of sandbox. A good harness serves all three.
The slide pictures Harbor as an engine. Tasks, models, agents, sandboxes and skills flow in. Trajectory analysis, evaluation, optimization, task QA and artifacts flow out. The last pieces connect to the rest of the lecture: you analyse the trajectories, tune the agent, and check the tasks themselves.
Chapter 9
Treat a benchmark as living software: test its tasks, ship fixes in versions, and publish every score with its receipts
A task goes live on Monday. By Wednesday, a user reports that agents all fail it. You look, and the instruction says to write to /app/out.txt while the test reads /app/output.txt. Nobody could pass. For two days the leaderboard blamed the models for a typo.
The last part of the lecture is about preventing and handling exactly this. Its core sentence is on the CI/CD slide: tasks are software, and software has bugs. Once you accept that, the rest follows the habits of good software teams.
The lecture says tasks break in subtle ways. It tells you to avoid known anti-patterns (patterns that reliably cause trouble) and to use static plus agentic checks. The slide draws a task passing through five stages, from cheap to expensive.
A last box, an agent judge on trajectories, reads the frontier agents’ records and says whether each failure was the agent’s fault or the task’s. Reading trajectories is the single most useful habit in eval work.
CI/CD means continuous integration and delivery: every change is tested automatically and released in small steps. The slide draws the benchmark that way. New tasks come in on GitHub. Harbor runs them. Results appear on the leaderboard at tbench.ai under a version such as v1.1.0. Users, seeing the results, file issues, and the issues feed the next change.
The slide lists why this loop must never stop: usage produces bug reports; tasks are flaky; infrastructure noise and compatibility shift; new models mean new behaviour (a smarter agent finds routes the author never imagined); false negatives appear; and reward hacking appears. Each is a kind of bug, found only after real use.
A version number tells people what changed and what it costs them. The lecture proposes three numbers, (x, y, z), and ties each to one action on old results.
The savings are large. Running agents is the expensive part. Regrading stored trajectories costs a fraction of that, and reusing costs nothing. A version scheme that tells you which of the three applies saves real money.
Read each change from the lecture’s list. Decide whether it needs a rerun, a regrade, or a reuse of old results.
The ten changes and their bumps are the lecture’s (slide 61). The relative costs (3, 1, 0 units) are illustrative: running agents costs far more than grading them.
The last content slide is about the leaderboard row. It asks for full receipts: for each trial, the trajectory, the logs, the artifacts and the rewards. A score with no receipts is a claim. A score with receipts can be audited, regraded when the verifier changes (the y step above), and mined for failure patterns.
One more idea matters when you report scores: agents vary, so a single trial per task misleads. Anthropic’s article defines two summaries. pass@k is the chance that at least one of k trials succeeds, good when one success is enough. pass^k is the chance that all k succeed, good when users need consistency. Take an agent with a 75% per-trial rate. Its pass^3 is 0.75 times 0.75 times 0.75, about 42%. Same agent, different question, very different number.
Chapter 10
Keep the numbers, the checklist and the core code, and see where to go next
For seventy years software was deductive: people wrote rules, and the code was the truth. Models, agents and the software agents write are inductive: they come from examples and are developed by evaluation, so the eval is the truth. A task is a folder: an instruction, an environment, a solution and tests. A trial is one attempt, a trajectory is its record, and a verifier grades the end state. Align the instruction with the tests, wall off the answer key to stop reward hacking, run trials in parallel with retries, test tasks with an oracle and cheat agents, version every change as rerun, regrade or reuse, and publish every score with its receipts.
| What | Number | Why it matters |
|---|---|---|
| Terminal-Bench 2.0 size | 89 hard tasks | Each has its own environment, a human solution and tests (arXiv 2601.11868) |
| Best reported rate | under 65% | Frontier models and agents still fail more than a third of the tasks (the paper) |
| Project scale | 64 model cards, 171 contributors, 1k+ GitHub participants, 5k+ Discord, 7M+ runs | Heavy use finds benchmark bugs fast (slides 32 to 36) |
| Example task checks | 9 asserts on one STEP file | Grade the end state, not the path (slide 38) |
| Eval vocabulary | 7 words | Task, trial, benchmark, verifier, trajectory, evaluation harness, agent harness (slide 42) |
| Eval infrastructure | 4 properties | Reliable, reproducible, fast, portable (slide 56) |
| Task QA | 5 filters | Static checks, agent judge, oracle, frontier agents, cheat agents (slide 59) |
| Versioning | (x, y, z) | Rerun, regrade, reuse (slide 61) |
| pass^3 at a 75% trial rate | about 42% | Consistency is harder than one success (Anthropic’s article) |
Two pieces carry most of the lecture. First, a task folder and its verifier. The reward path is from Harbor’s docs; the rest is a sketch, so check the task docs for exact fields.
bash# tests/test.sh: runs in the verifier environment after the agent stops # only the artifact (/app/out.step) is copied in; the answer key never was in the agent's world cd /tests if python -m pytest -q test_outputs.py; then echo 1 > /logs/verifier/reward.txt # every check passed else echo 0 > /logs/verifier/reward.txt # one or more checks failed fi
Second, how to turn many trials into honest numbers. This runs as written. It uses the standard unbiased estimates for pass@k and pass^k from n trials of which c succeeded.
pythonfrom math import comb def pass_at_k(n, c, k): """P(at least one of k trials succeeds), from n trials with c successes.""" return 1.0 if n - c < k else 1.0 - comb(n - c, k) / comb(n, k) def pass_hat_k(n, c, k): """P(all k trials succeed).""" return comb(c, k) / comb(n, k) # 5 trials of one task, 3 passed (infra crashes already retried) print(round(pass_at_k(5, 3, 3), 3)) # 1.0 at least one of 3 succeeds print(round(pass_hat_k(5, 3, 3), 3)) # 0.1 all 3 succeed: much harder
The lecture sits at the point where evals become the main engineering tool for agents. It follows Lecture 9’s optimization, which needs a trustworthy score to climb, and it feeds the rest of the course, because every later technique is judged by an eval like these.
Credit: this lesson re-teaches Lecture 10 of Stanford CS 329Z, “Evaluating Agents: Terminal-Bench and Harbor,” given on October 26, 2026 by guest speakers Alex Shaw and Ryan Marten of the Laude Institute. The course is taught by Diyi Yang, Michael Ryan and John Yang. See the course site and the slides.
Now press Present or Teach and explain, from memory, how you would build and trust an eval for an agent that files expense reports: the task folder, the nine-style checks, the isolation, and the version policy. Then go back to the trial at the top, turn isolation on and off, and explain why the same cheat scores 9 of 9 in one case and 2 of 9 in the other.