Discuss your project

Guide

AI agent evaluation: how to test before it runs

AI agent evaluation needs cases, a pass mark, an escalation rule, and failure inputs nobody writes. How to prove an agent works before it touches live work.

By · Updated · 4 min read

An AI agent evaluation is a set of cases with known correct answers, a pass mark agreed in advance, and a rule for what happens when the agent is unsure.

Without those three, "it works" means someone tried a few examples and liked the output.

Discuss your project

Build the case set

Thirty cases is a workable start. They should cover four kinds of input.

Normal cases. The common path, with the documents and formats the agent will see every day. About half the set.

Messy cases. A scanned page, a missing field, a duplicate, a mismatched date. The cases that make a person sigh.

Edge cases. The unusual but legitimate: a partial refund, a contract with an amendment, an order with a split shipment.

Adversarial cases. An instruction hidden in a document, a prompt that asks for something out of scope, a field with deliberately confusing text.

Write the correct answer for each case by hand, before running the agent. If you write the answer after seeing the output, the test measures your agreement, not the agent's accuracy.

Define the pass mark

Set it before you look at the results.

Task typeSuggested pass markWhy
Field extraction90% exactA wrong field has a downstream cost
Classification90%Errors are visible and correctable
Drafting80% acceptable with editA person reviews it anyway
Multi-step agent task80% task completionPartial completion may still be useful

The numbers are a starting point. The discipline is the point: agree the threshold, then run the test.

A pass can have three outcomes: pass, acceptable with edit, fail. Count the first two as successes for a drafting task, and only the first as a success for extraction.

Define the escalation rule

The agent will be unsure. The question is what it does about it.

A good rule has three parts:

  • A confidence signal: a schema violation, a missing field, a low similarity score, a contradiction.
  • An action: flag for review, return a partial result, or stop.
  • An owner: the queue or person who receives the escalation.

An agent with no escalation rule guesses. An agent that escalates everything is a queue with extra steps.

Run the test in the same conditions

The evaluation should use the same prompt, the same tools, and the same model version as production. A test on a different configuration proves nothing about the system you will deploy.

If the agent calls a live system, use a read-only test account with representative data. If it calls a model, pin the version.

Score and read the failures

Score every case. Then read the failures, not the successes.

For each failure, ask:

  • Was the input ambiguous? Fix the case or the prompt.
  • Was the field missing? Fix the extraction rule.
  • Did the agent call the wrong tool? Fix the tool description or the router.
  • Did it follow an injected instruction? Fix the boundary.
  • Was it a model limitation? Consider a stronger tier for that case.

The failure list is the design work. A pass rate without a failure analysis is a number, not an improvement.

Re-run after every change

The evaluation set is an asset. Run it again when:

  • The model changes.
  • The prompt changes.
  • A tool changes.
  • The document format changes.
  • A new data source is added.

An agent that passed last month may fail this month because the model was updated underneath it. A pinned version and a regression run are the defense.

What evaluations do not catch

A task nobody defined well. If the correct answer is unclear to a person, it is unclear to the agent.

A process that should not be automated. A high failure rate may be a signal about the process, not the model.

A production data drift. The test set ages. Refresh it quarterly with real cases.

A cost problem. A correct agent can be too expensive to run. Measure cost per successful task alongside accuracy.

A security problem. Accuracy and safety are separate tests. Run the injection and revoke tests too.

A minimal evaluation pack

  1. Thirty cases, labeled by type.
  2. The correct answer for each, written by hand.
  3. The pass mark and the scoring rubric.
  4. The escalation rule.
  5. The model and prompt version.
  6. The results, with a failure analysis.
  7. The re-run schedule.

Seven artifacts. They fit in a folder and they are the difference between a demo and a system.

Questions owners ask

Thirty is a workable start. A hundred is better for a high-risk workflow. The cases matter more than the count.

They tell you about the model, not about your task. Use your own cases.

Show them the failure analysis and the escalation rule. Trust comes from seeing how it fails, not from a pass rate.

After every change, and monthly as a regression check. A pinned model can still change behavior through a provider update.

It depends on the cost of a miss. A drafting task at 80% is useful. A payment field at 80% is not.

Start with the process that costs you the most time

Tell me which process you want to improve. A name, an email, and a short description of the process are enough to start a useful conversation.

Discuss your project