Evaluating LLM agents: fix the reference set before the model
On the AI layer for a fintech platform the back-office QA set was 115 questions: what the team’s QA pass had asked of the agents, the use cases of the requirements document and their provocations. On 22 October the first run against the real models matched on 42 – 36.5%, for $1.62. On the evening of 24 October it matched on 114 of 115.
The easy story is that the agents got much better in two days. Some of them did. But the first thing a low number on a new eval measures is the eval, and the order I fixed things in – runner, then reference, then agents – is the part I would repeat.
What the 73 failures actually were
I sorted the failures by which expected field disagreed before touching anything:
| Failures | What disagreed |
|---|---|
| 20 | The agent paused to ask a clarifying question, and the set had no reply to give it |
| 19 | Only the internal analysis route; the status and competency the client sees were right |
| 12 | The wrong competency within the right agent, or the question went to another agent |
| 9 | ‘Not a tax question’, or a refusal on a federal topic outside the competencies |
| 7 | Content: a hand-off to a specialist, the topic of advice |
| 2 | The status of the answer |
The first two rows are 39 of the 73, and neither is an agent being wrong. One is a set that checked an internal field nobody outside the system sees. The other is a runner that asked once, at k = 1, with no scripted reply, and counted a sensible clarifying question as a failure.
The bug that made a test pass
Before fixing the set, I fixed the runner, because of a failure that looked like a success. All five personas were asking from one account. Facts confirmed in one dialogue were read in the next, so answers depended on what had been asked before.
One line asks, in effect, ‘where are my assets?’. On 22 October it passed – because the agent could see another persona’s data. Contamination doesn’t only produce false failures; it produces false passes, and those are the ones nobody investigates.
The runner changed on 23 October. Each persona now has its own account, and before any model is called the runner checks every account through the public API. It refuses to run, naming the persona, if an account has a conversation, a confirmed fact or an open task, or if two personas share one. It deletes nothing: cleaning is a person’s decision, not something an eval tool gets permission to do. The report is also written as the run goes, and a provider failure on one call no longer stops the run. The next run matched 97 of 115, for $2.53.
A reference needs a source order
That run showed three new failures, and all three were lines of the set that contradicted the requirements document. Fixing agents to match a wrong reference makes them worse, so the set got a rule for what counts as right, in order:
- The requirements document for the agents, and the laws found in the knowledge base.
- Within that frame, what the QA pass expected.
- Then the team’s decisions in chat, each with its date.
Every line names its source, and a line without one is refused at load. A legal fact in a line – a date, a threshold, a form – names the document it comes from, and a fact the knowledge base doesn’t hold doesn’t go into a line. Lines whose expectation waits for a decision carry its name and are run and shown but not counted, so the headline number tracks what is accepted. That is also why the denominator moves below.
Only then the agents
With the runner and the reference fixed, what remained was real, and each fix went into the agents against a specific line. On the morning of 24 October the set matched 111 of 114, for $3.64; one line was parked waiting for a decision. That evening it was 114 of 115, for $3.63.
The last failure is the most instructive. The answer came without the button that offers the next step. The same question had produced that button in the morning. It isn’t a stable bug; it is instability, and a single run found it by luck.
k = 1 is not stability
Every run above was k = 1. The runner supports --k N, and a question counts as stable only when all k runs pass, reported by agent and by class – route, refusal, provocation. The process says k = 1 for day-to-day acceptance against the previous run and k = 3 at the end of a wave or when a model changes. The last line of this set is the argument for not waiting that long: a non-deterministic system that passes once has told you very little.
Code judges, not a model
Each line expects structured things – the route, the competency, the status, the agent that signs the answer, computed dates and amounts, the forms offered, the button handed over, phrases that must be absent – and code checks each one exactly. No model judges a text.
The argument for an LLM judge is that it handles phrasing. But an uncalibrated judge is one more model whose errors you can’t see, and in a regulated domain the failures that matter – a wrong deadline, a final answer that should be preliminary – are structured anyway.
The cost curve runs the wrong way
The cost per run went from $1.62 to $2.53 to $3.64 as the agents got better. That is not waste. A run that stops at a clarifying question is cheap; one that reaches the final text and the critic is not. A better system makes its eval more expensive, so budget for it. Before starting, the runner estimates the run from recent costs per agent and refuses one over the operator’s $20 limit. It also takes an --as-of date, because expected deadlines are written for a particular day and a set written on 21 October starts failing within weeks for no reason in the code.
What I would do from day one
- Isolate accounts on the first run. Shared state between test cases is a bug you already know how to avoid; an eval set is test code.
- Reconcile the reference with the requirements before the first run, not after it.
- Run k = 3 on the most fragile lines from the start, and keep k = 1 for the rest.
The same discipline – check your assumptions against the real thing, not your own copy of it – is behind testing LLM integrations.