Part 03›
✎

Part 3 — Evaluation: Knowing Whether It Works#

You built a small agent in Part 2. This part answers the question that follows: does it work, where does it fail, and how do you stop it from getting worse?

Evaluation is treated here as a software engineering activity. A harness is test infrastructure. A dataset is a set of fixtures. A judge is a flaky oracle that must be calibrated before you trust it. The part draws on UC Berkeley's LLM-agent MOOCs of 2024 and 2025, on Christian Kästner's Machine Learning in Production (MIT Press, 2025), and on the papers those lectures assign.

The chapters#

# Chapter Level Read After it you can
01 Evaluation Is the Product Practitioner 20 min Place any "does it work" question at one of four levels and run a development loop driven by evidence
02 A Minimal Evaluation Harness Practitioner 25 min Run a 170-line Python harness with no API key and read its report
03 LLM-as-a-Judge and Rubrics Practitioner 20 min Write a rubric, turn it into a judge prompt, and calibrate the judge against human labels
04 Evaluating Agents: Trajectories and Environments Practitioner 25 min Grade an agent on its route and on the state it leaves behind, in a resettable fake environment
05 Statistics for Evals: Error Bars and Significance Practitioner 25 min Compute a standard error and a paired comparison, and recognize a difference that is not evidence
06 Evaluating Capabilities and Risks Professional 15 min Explain a dangerous-capability evaluation and a responsible scaling policy, and write capability tiers
07 Evals in Production Practitioner 20 min Trace every attempt, choose online metrics, gate changes, and feed failures back into the dataset
08 Case Study: Berkeley's Green Agent and White Agent Project Practitioner 15 min Describe a course project that asks students to build the evaluator first

How to read this part#

Read the chapters in order the first time. Each one assumes the harness of chapter 02.

You need to be comfortable with Python, Git and the terminal. You do not need a machine-learning background. Part 2, the anatomy of an agent, is the only real prerequisite.

One running example#

The same customer-support agent that refunds orders appears in every chapter. It is asked for a refund on order #1042. It has to authenticate the customer, look the order up, and refund once. It also has to refuse order #9999, which does not exist.

That one task shows every idea in the part:

Code you can run#

File Chapter Needs
eval_harness.py 02 Python 3.8 or newer, standard library only
eval_stats.py 05 The same
A fake environment with an end-state check 04 The same
A trace reader and a regression gate 07 eval_harness.py in the same folder

The harness and the statistics file print the numbers shown in their chapters. Run them with python3 -I <file> so that nothing from your machine interferes. The two snippets that call a model are marked as illustrative.

What this part does not cover#

Where it leads#

The case study in chapter 08 is the basis of two capstone projects in Part 11: integrate an existing benchmark as an evaluator, with a quality analysis, or build a new small benchmark with its own rubric and validation. Everything in this part is preparation for those.

Lecture guides for this part#

Each guide maps one lecture from its first minute to its last and says where this book teaches each piece. Where no chapter teaches a part of the lecture, the guide explains it itself; the table counts those parts.

Lecture Lecturer Length Parts no chapter teaches Guide
Agent Evaluation & Project Overview Berkeley course staff 1:36:00 2 of 12 open guide
Practical Lessons from Deploying Real-World AI Agents Clay Bavor (Sierra) 48:00 8 of 16 open guide
Measuring Agent capabilities and Anthropic's RSP Ben Mann (Anthropic) 46:00 2 of 6 open guide

Sources#