Part 8 of 15 · The House That Diligence BuiltNext: Review the Evidence, Not the Diff →

Build Your Evals From Incidents

Evals are the wiring that trips on real faults. Build them from incidents, test the scorer as hard as the model, and let no automation approve a release.

AdminPublished 7 min read

Evals are the wiring of an agent system: the meters that show what's flowing and the breakers that trip when something's wrong. A breaker only helps if it trips on real faults, and the best source of real faults is the incidents you've already had.

I learned how easily that wiring lies from my own repo.

Six weeks of red, reported as green

MetaCaddie is an AI caddie I'm building. It has a weekly job that runs live evals against the model: golden cases where the right club is known, a hallucination suite, and a check that the LLM judge still agrees with human labels.

When I went through the CI history last week, that job had been red for at least six weeks. On the run the day before launch, 16 of 21 golden cases failed, the hallucination suite had 7 failures, and the judge calibration check reported drift. Every run concluded success.

The step had continue-on-error: true, with a comment saying a drift should never block a merge and a red is the signal to look. That intent is reasonable. The weekly job doesn't gate anything. But it also meant a failure turned into a green check, and nobody looks twice at a green check.

The more interesting finding was why it was red. Most of the failures weren't the caddie. They were the scorer. The golden suite checked for clubs with a substring match: does the response contain 7i? A correct answer, "7-iron, center of the green," fails that check. The forbidden-club check flagged "SW" inside the word "swing." A correct grader already existed elsewhere in the same repo, a real parser for club names, and the CI suites didn't use it.

And the prompt under test wasn't the prompt the app sends. The suites used a one-line stand-in, with a comment claiming it matched the client. It didn't. The real prompt is assembled from five files and a remotely served playbook.

So the suite had three problems, one in each part an eval is made of.

An eval is three things

An eval is a prompt, a dataset and a scorer. Each one can be wrong on its own, and improving one without the others doesn't help much.

  • The prompt has to be the one the system actually runs. A stand-in tests a system you don't ship.
  • The dataset has to contain the cases that actually go wrong. Cases you imagined test your imagination.
  • The scorer has to be right, and it's the part people test least. A scorer that misreads "7-iron" makes every score after it meaningless, in either direction.

I keep them in three separate files so they can change independently, and so a diff shows which one moved. The prompt file is a slice of the real skill or the real prompt assembly, not a copy. When the real one changes, the eval sees it.

Your incident log is already a dataset

The bots I run had no evals at all. Every change to a bot's skill went live on its next pass, and production was the only test.

But the raw material was there. Po, the bot that triages user signals, has 160 paragraphs in its skill that start with the word "Measured." Each one records a miss: the issue number, what Po did, and what it should have done. One says Po read a weight of 8 from its dedup store when the issue body said 21, and wrote the 8 over it. Another says Po counted a registered endpoint as evidence of a software integration when the endpoint was an email address.

Each of those is an input, a wrong output and a right output. That's an eval case written as prose. Today the response to each one is more prose in the skill, which every later pass reads in full and nothing checks.

Turning them into cases is mostly sorting:

  • Mechanical rules become tests. "Read the weight from the issue body" is a script with a test that replays the incident. No model needed.
  • Judgment calls become labeled rows. "Is this signal the same theme as an existing issue?" or "Is this CI failure real or a flake?" needs the model, and those are what an eval measures.

The ground truth for those judgment calls is usually sitting in history already. An issue a human relabeled is a labeled case. A CI rerun that passed was a flake. A merged fix means the failure was real. An issue closed as not planned was noise. You don't need a labeling project to start. You need about 30 cases per decision, pulled from what already happened.

Weigh the costly mistakes

Averages hide the one failure you care about. A 95% score can bury the case that costs you a customer.

So each scorer weighs errors by what they cost. For Po, missing a revenue-risk flag counts for more than putting a signal in the wrong class. For the bot that triages CI failures, calling a real failure a flake is the expensive mistake, because it re-runs and moves on and the bug ships. Calling a flake real just costs a few minutes. I report the costly errors as their own count, not folded into a percentage.

Two tiers, both honest

I run evals in two tiers.

The fast tier is deterministic: schema checks, required fields, the club parser, the replayed incidents. It runs on every pull request in a few minutes and it blocks the merge.

The slow tier calls the real model, sometimes several times per case to take a majority, and runs nightly or weekly. It doesn't block merges, because model output drifts for reasons that have nothing to do with the change. But it has to fail out loud. When it goes red, it opens or updates one issue with the failing case IDs and the start of each response. That's the fix I'm making to MetaCaddie's weekly job. It doesn't need continue-on-error. It needs its own job, which goes red, files an issue and stays out of the merge path.

A red that nobody sees is worse than no eval, because it teaches everyone that red means nothing.

Calibrate the judge

Some outputs can't be checked with code. Is this draft reply useful? Does this explanation match what the code does? For those I use an LLM judge, and the judge is a model too, which means it drifts and has biases. It also tends to favor outputs that sound like its own.

So the judge gets its own eval. I keep a small frozen set of transcripts that a person has labeled, and re-score them whenever the judge model, the judge prompt or the rubric changes. If agreement drops below where it was at the last calibration, the judge doesn't get used until it's fixed. MetaCaddie already had this check. It was failing every week, behind the same green check. I wrote more about why the judge lies.

Pairwise judging is often more reliable than scoring. Asking "which of these two is better, and why?" is an easier question than "rate this from 1 to 10." It's cheap, too: a full pairwise ranking of 30 outputs over 500 matchups with a small model costs well under a dollar.

No automation approves a release

The tooling is getting good at proposing changes to all three parts: a better prompt, new cases mined from production, a tighter scorer. I want that. I also want every proposed change shown side by side, prompt beside prompt and case beside case, with a person accepting it.

The rule I hold to for anything that reaches users: evals on, plus one human approval, and no automation counts as that approval. Not a review agent, not a bot that merges on green. If the evals are the breakers, a person still owns the panel.

A miss in production that the suite passed isn't a bad day. It's a missing case. Add it, watch it fail against the old version, then fix the prompt. That loop is the whole job. For getting a first suite off the ground, start with product evals in three steps.

How you know it's working

  • Every pull request gets the fast tier. It's required, and it finishes in minutes.
  • Scheduled runs fail out loud. No continue-on-error on a step that reports quality. A red run files an issue.
  • The judge agrees with people. At least 90% agreement on the frozen labeled set, rechecked on every judge change.
  • Most cases come from incidents. Every case records where it came from. Over half trace to something that actually went wrong.
  • Scorers have tests. A known-good answer passes and a known-bad answer fails, before the scorer grades anything else.
  • Production misses become cases within a day. Each one is added red first, then fixed.
Next in The House That Diligence Built · Part 9 of 15Review the Evidence, Not the Diff →