Evals are just unit tests for agents

Every few weeks I change something in my agent setup. A new model, a different system prompt, a tool I wrote on a Sunday. And every time, I used to “check” the change by running the agent on whatever I happened to be working on and deciding it felt better. That’s not checking. That’s weather.

So I built the smallest eval harness that could possibly work, and it has already saved me from two changes that felt great and scored terribly.

The harness is a folder

No framework. The harness is a folder of task files. Each task is a markdown file with three parts: the request I’d give the agent, the setup (a git repo at a known commit, or a fixture directory), and the checks. The checks are shell commands. Exit code zero or not. pytest passes, mypy is clean, the output file contains this string, the diff touches fewer than five files.

A runner script walks the folder, spins up the agent against each task in a clean copy of the fixture, runs the checks, and prints a table. Twenty tasks takes about half an hour of machine time. I run it before I change anything, so I have a baseline, and after, so I have a comparison.

What the scores taught me

The first surprise was which tasks my favorite setup failed. It aced the hard refactor and flubbed the boring ones, like “add the missing test for this function using the pattern in the neighboring file.” It would invent a new pattern instead. The expensive reasoning wasn’t failing on reasoning. It was failing on obedience to local convention, which a vibes check never would have caught because I’d only ever tested it on interesting work.

The second surprise was prompt changes. A paragraph I added to my system prompt made the scores on mechanical tasks measurably worse. It was a good paragraph. It sounded wise. The eval said otherwise, so the paragraph is gone and the eval is why I can say that without superstition.

The rules I follow now

Keep the tasks boring and representative, not clever. A task suite made of impressive demos measures demo performance. Mine is mostly maintenance work, because maintenance is most of the work.

Never tune to the suite. The minute I catch myself writing a prompt line that exists to pass task 14, I stop. The suite is a smoke detector, not a target.

Keep the baseline. A score without the previous score is a number. A score next to last month’s is information.

This is all obvious in retrospect, which is exactly what everyone said about unit tests in 2004. The tooling will get fancier. The folder-of-tasks version already answers the only question I actually ask, which is: did that change make things better, or did it just make things different?


← back to all posts