pablo formoso FUTURE / DATA & AI
ES EN Streaming –:–:– UTC

Wax on, wax off: evals are how a software factory trains

Everybody wants the crane kick and almost nobody wants to wax cars. What to evaluate in an AI agent, with what and how many times, and why in a software factory evals are not the final exam but the daily training.

Dos espirales de trazos circulares, una en negro y otra en rojo, sobre una fila de cuadrados que pasan de vacíos a rellenos: el gesto de dar cera y pulir cera

In the previous article I said that, in a dark software factory, agents earn their autonomy with evidence. I never said where that evidence comes from. It comes from the least glamorous move in the trade: look, write it down, repeat, and repeat again. This article is about AI agent evals (what you evaluate, with what, and how many times) and about why, in a factory, they are not the final exam but the daily training.

Listen in my own voice · 17 min

Speed:

In The Karate Kid (1984), Daniel wants to learn how to fight and Mr. Miyagi puts him to work waxing cars. “Wax on, wax off.” In the Spanish dub I grew up with, the line is “dar cera, pulir cera”: give wax, polish wax. Then comes sanding the floor, painting the fence and painting the house. Whole days of it. Daniel ends up convinced he is being played, and that he is free labour.

Then Miyagi throws a punch. And Daniel’s arm blocks it on its own, with the same circle he had spent days rubbing into a car hood.

I have been turning that scene over for weeks, because it is the best explanation I know of what is missing in almost every agent project I see. Everybody wants the crane kick: the demo, the agent that solves a task live in front of the steering committee. Almost nobody wants to wax cars. And waxing cars, in this trade, is called evals.

The perfect answer that was wrong

Take a support agent for a made-up vinyl record shop. A customer writes: “I want a refund for order P-1003.” The agent replies in seconds: done, your €27.50 refund will arrive in a few days.

Polite, fast, decisive. And it has just given away twenty-seven euros fifty. That order was delivered 80 days ago and the shop only refunds within 30. The agent looked up the order, calculated the amount and replied. What it never did was check the returns policy. Nobody would spot it by reading the answer.

That is the whole problem in miniature: what an agent says and what an agent did are two different things. Anthropic makes the point with a travel agent in its guide to agent evals: it doesn’t matter that the agent claims the flight is booked; what counts is whether the reservation exists in the database.

Now swap the record shop for a software factory that works at night. The agent says “done, tests are green”. Did it run them? Did it touch them so they would pass? Did it do what the task asked for, or what was easiest to get approved?

Why you can’t test an agent like software

A classic test has a fixed input, a single output and a result that doesn’t change. An agent breaks all three. It doesn’t answer the same way twice, there is almost always more than one good answer, and it picks its own path, so it can reach a correct answer through a flawed route. LangChain sums it up well in its round-up of common questions on the topic.

On top of that, errors multiply. If each step goes right 95% of the time and the task needs ten steps, the whole task goes right about 6 times out of 10. The arithmetic is mine (0.95 to the power of 10, assuming the steps don’t depend on each other), but the idea holds: an agent that looks nearly perfect step by step can be a coin toss end to end.

The body solved this problem a long time ago. It is called proprioception: the sense that tells the brain where each arm actually is, not where it was told to be. Without it, the order goes out, the muscle does something, and nobody checks whether the two match.

In the previous article I split the factory into skin, skeleton, spinal cord, muscle and immune system. I was missing this sense. Evals are the factory’s proprioception: the measured difference between what was ordered and what happened.

What you polish: outcome, path and step

The first thing is knowing where to look. An agent has three planes, and it pays not to mix them:

  • The outcome. Was the request solved without breaking any rule? In the shop: it doesn’t promise a refund outside the window. In the factory: the change does what the task asked for and the test battery passes.
  • The path, which the jargon calls the trajectory. Did it check the policy before calculating the refund? Did it run the battery before saying “done”?
  • The step. Did it pick the right tool and pass it the right arguments?

Two more things sit around those: the whole conversation, when there are several turns, and the cost metrics, such as steps, tokens and latency. The latter inform, but they don’t pass or fail anyone.

The line I would write down is this: the outcome tells you whether the agent is any good; everything else tells you why it fails.

What you evaluate in an agent: the outcome, the path and the step, with the question each plane answers and an example in the record shop and in the software factory

A warning about the path. Anthropic recommends grading what the agent produced rather than demanding an exact sequence of calls, because that punishes valid routes nobody had foreseen. I agree. I use the path for two things: to diagnose, and for narrow business rules such as “if you calculate a refund, you checked the policy first”. Never to say “the path has to be exactly this one”.

What you polish with: code, judge and person

There are three kinds of grader, and each has its price:

GraderGood forProsCons
CodeWhat can be verified: tool order, format, exact valuesFast, cheap and reproducibleBrittle with valid variations; doesn’t understand meaning
LLM judgeWhat has to be understood: does the answer respect the policy?Flexible and scales wellNon-deterministic, costs money and needs calibrating
PersonSetting the standard and calibrating the judgesThe reference standardSlow and expensive

The preference is clear: code whenever you can, an LLM judge where you must, and people, sparingly, to validate.

And for LLM judges, four rules I don’t skip:

  1. Binary verdict. On a 1-to-5 scale nobody can explain what separates a 3 from a 4. Pass or fail forces a decision. That is the recommendation Hamel Husain and Shreya Shankar give in their evals FAQ.
  2. One criterion per judge. A judge that tries to catch five failures at once catches none of them well.
  3. An explanation next to the verdict. Without it, the score can’t be debugged.
  4. Validated against human labels. This is the one everybody skips. A judge that always passes is right 95% of the time if only 5% of the answers fail. Don’t look at how often it is right: look, separately, at how many real failures it catches and how many good answers it passes.

A judge that hasn’t been validated is not a measurement. It is an opinion with an API.

In the factory from the previous article I put adversarial reviewers on a different model from the one that implements, and I said the judge holds no pen. Today I add the other half: the judge sits an exam too.

Once is not training

Miyagi doesn’t ask Daniel to wax one car. He asks him to wax all of them.

It is the same with agents: a task that goes well once can fail the next time, so every case is run several times. And there are two ways of summarising the result that tell opposite stories.

Picture an agent that gets it right 75% of the time on each attempt, and give it three attempts. The chance that it gets it right at least once is 98%. The chance that it gets it right all three times is 42%. The second number is the example Anthropic gives; the first one I worked out with the same logic (1 minus 0.25 to the power of 3). The jargon calls them pass@k and pass^k.

An agent with 75% success per attempt and three attempts: it succeeds at least once 98% of the time and succeeds all three times 42% of the time

The second metric comes from τ-bench, a 2024 benchmark that was already making the same point: the best agents of the time solved fewer than half the tasks and, when asked to succeed eight times in a row in the retail domain, stayed below 25%.

Which of the two numbers matters to a factory that launches the same kind of task a hundred times a night? The second. Always the second.

The whole move: wax on, wax off

The method has two movements, like Miyagi’s.

Wax on is looking and collecting:

  1. Instrument the agent and keep real traces of what it does.
  2. Read traces by hand and note the first failure you see in each one. Husain and Shankar call this error analysis and consider it the most important activity of all, because it decides which graders are worth writing.
  3. Group the failures by type and count them. Fix the obvious before you measure anything.
  4. Turn real failures into cases in a dataset. Between 20 and 50 is enough to start, according to Anthropic. And with cases in both directions: one refund that is due and one that isn’t. With only one of the two, the agent would learn to refund always or never, and the score wouldn’t even notice.

Wax off is repeating and tightening:

  1. Write code graders for everything that can be verified.
  2. Add LLM judges only for what code can’t decide, and calibrate them.
  3. Run every case several times and check whether it passes all of them.
  4. Run the suite on every change, as a gate. What must never happen gets asserted and breaks the build. The quality you want to watch gets logged and tracked over time.
  5. Watch production. Every new failure goes back to step 4.
The whole move in two movements. Wax on: traces, error analysis and dataset. Wax off: graders, repetitions and quality gate. Production sends back new traces and the cycle starts again

The dataset is the piece that builds up value. Every lap adds cases and makes it a little harder for a change to make the agent worse without anybody noticing. It is the factory’s muscle memory.

And there is a second, smaller cycle hanging off the first one. Graders get polished too: you measure them against human labels, read the disagreements and adjust. One cycle improves the agent; the other improves whoever grades it.

The whole eval cycle around the agent: traces, error analysis, dataset, graders, repetitions and quality gate, with production sending back new traces. A second, smaller cycle hangs off the graders: measure against human labels, read the disagreements and adjust

I built all this as a toy demo with the record shop: the agent in LangGraph, and the traces and experiments in Phoenix, which is open source and runs locally. That is where my favourite lesson comes from. There was another refund, for order P-1002, that ended well: it was within the window and the refund was due. A person, looking at the result, marked it as good. The code grader failed it, because the agent hadn’t checked the policy there either. The path was identical to order P-1003. Only the date was different.

Before you correct the grader, you have to decide who is right. Here the grader is. The outcome was correct by chance, and chance doesn’t scale.

In a factory, the exam can’t sit on the student’s desk

So far, this applies to any agent. A software factory adds one more twist, and the StrongDM team tells it very well: in February they published how their Software Factory works.

At first, their agents made no progress until there were tests. And once there were tests, the shortcuts showed up: a return true passes a narrow test without solving anything. Worse still: a test that lives in the same repository as the code can be rewritten to match the code.

Their answer was to take the exam off the desk. They replaced tests with what they call scenarios: end-to-end user stories that are often kept outside the codebase, where the coding agent can’t see them, the same way you set aside a holdout set when training a model. And they swapped “the suite is green” for a measure they call satisfaction: what fraction of the observed runs is likely to leave the user satisfied.

Simon Willison, who visited the team, frames it as the most consequential question in software development today: how do you prove something works when agents write both the implementation and the tests.

Here is my reading for a factory:

  • Whoever does the work doesn’t keep the exam. If the agent can see the test, it will pass the test. In the previous article, the battery ran in a second sandbox for this very reason.
  • There are two suites, not one. Anthropic separates capability evals, which start with a low score and mark the hill to climb, from regression evals, which should sit close to 100% and protect what already works. The former, once they mature, become the latter.
  • A suite that always passes no longer tells you anything. Husain and Shankar say it plainly: if you pass everything, you are most likely not demanding enough.
  • You control cost with size. Cases times repetitions times judges. On every change, a few cases and cheap judges; the full suite, at night.

And the one I find most important. I wrote that autonomy is earned per class of action and with evidence, never by configuration. The eval is the unit of that evidence. A component that works in shadow mode, noting what it would have done while a person does it for real, is an eval by another name: every night it produces a case, with its human label next to it. The day the two agree often enough, and not before, that light goes off.

This costs. Husain and Shankar report that in their projects between 60% and 80% of development time has gone into error analysis and evaluation. More wax than kicks. That is the trade.

The fine print

Three discomforts, as usual.

The experts don’t agree on everything. Anthropic recommends writing evals before the agent when the success criterion is clear. Husain and Shankar advise against it as a general rule: an LLM’s failures can’t be predicted, they have to be seen. I think the two are compatible. Tasks can be defined early; failure graders come out of real traces.

The judge and the judged are too much alike. Eran Kahana, writing for CodeX at Stanford, put his finger on the sore spot of StrongDM’s factory: the same class of technology that writes the code decides whether the code works. If the builder and the inspector share blind spots, adding more tests doesn’t remove the risk that both miss the same thing. Calibrating judges against people reduces it, but doesn’t eliminate it. That is why I still believe some classes of action keep the light on, always.

My demo is a toy. I built it with a simulated, fixed-rule model. With the weak prompt, 4 of the 6 cases pass the trajectory rule; with the fixed one, all 6 do, and the script that acts as the gate fails with the first and passes with the second. Those figures show the mechanism. They don’t measure the quality of any real agent.

And a fourth, on the house: the eval is software too, and it fails too. When a score surprises you, read the trace before you blame the agent. Anthropic’s guide closes with that same advice.

What I would do on Monday

  1. Read thirty traces by hand and note the first failure in each one. Husain and Shankar ask you to get to a hundred; thirty is for starting on Monday. No new tool needed: a spreadsheet will do.
  2. Write three questions about your agent: which outcome is non-negotiable, which step can’t be skipped, and which tool it should never touch in a given case. Those are your first three graders.
  3. Build a dataset of twenty cases, with cases where the behaviour must happen and cases where it must not.
  4. Run every case three times and count how many pass all three.
  5. Put up a single gate: one check on something that must never happen, and that breaks the build when it does.

What I take away

The crane kick lasts three seconds of film. Waxing cars lasts days. And Daniel doesn’t make it to the tournament because of the kick: he makes it because his arms already know how to move without asking his head for permission.

A factory that works at night needs the same thing. Reflexes that were trained with the lights on, case by case, repetition by repetition, until the right move comes out on its own and there is a record to prove it.

There will be factories that turn the lights off without having waxed a single car. They will work fine for a while, which is the worst thing that can happen to them: nobody will be able to say why they work, or why they stopped on the day they do.

Polishing is not the finish. It is the training.

Ideas over codebases; evidence over hype.


Sources

Pablo Formoso
author

Pablo Formoso

Field notes from the intersection of data, AI, and applied philosophy.

posts
76
since
2024

Leave a Reply

Your email address will not be published. Required fields are marked *