Skip to content

How to choose evaluation metrics for your AI agent

Pick a small set of LLM evaluation metrics that match what your user came for: task success first, then tool use, grounding, safety, cost and latency. Score them on live runs as well as on a test set, because real traffic differs from anything you wrote in advance.

By Arun Prasad · Published · Last updated

On this page

Why evaluation metrics matter

The metrics you choose decide which failures you can see. An agent can pass every step and still miss what the user wanted.

AI agents don't fail like normal software. A tool can return a 200 and the task can still fail. Standard monitoring shows the request went through, not whether the answer was right. If your only metrics are error rate and latency, a wrong answer delivered quickly looks like a success.

Good metrics measure the outcome against the user's goal. They also measure the parts that explain a bad outcome, such as which tool the agent chose, whether the answer matched the source, and what the run cost. The steps below cover how to pick them. They apply to any LLM agent, whatever tooling you use.

Step 1: Define what a good outcome is for your users

Write down what success looks like for each thing users ask your agent to do. Every later metric depends on this definition.

List your main intents, such as "change a booking" or "answer a policy question". For each one, write a sentence that a reviewer could check against a conversation: "The booking was changed and the user was told the new date." If two reviewers would disagree about whether a run met the sentence, rewrite it until they wouldn't.

This gives you a task-success metric. It is usually a yes/no or a short category, and it is the metric to look at first.

Step 2: Pick a few metrics from each family

Choose a handful of metrics across a few families, not 20. Start with task success and add others only when they explain a failure you have seen.

For agents, add metrics about behavior across steps, such as task completion, tool correctness and trajectory (whether the sequence of steps was reasonable). A practical starting set:

FamilyExample metric
Task successDid the user get what they came for (yes/no)?
Tool useWas the right tool called with the right parameters?
GroundingDoes the answer match the source it was given?
SafetyDid the reply expose personal data or follow an injected instruction?
OperationalCost and time per run

Tone and style can be added if your users notice them. Leave them out until then.

Step 3: Choose how each metric is scored

Use a code check where a rule can decide the answer. Use an LLM judge where meaning matters. Then pick a score type that fits: yes/no, a category, or a number.

Concrete examples:

  • Code check, boolean: is the output valid JSON?
  • Code check, boolean: did the agent call the refund tool at all?
  • LLM judge, boolean or category: is the answer grounded in the retrieved source? Did the agent complete the task?
  • Continuous: latency in milliseconds, cost per run.

Code checks give the same verdict for the same input, so they are cheap to trust. A judge is a model, so it can be wrong. Check any judge against examples a person has labeled (see Step 4).

Step 4: Use classification counts where the answer is a label (TP, FP, TN, FN)

When a check says yes or no, every result falls into one of four counts: true positive, false positive, true negative or false negative. Precision and recall are built from them.

Take the check "did the agent complete the task?" and compare it with the true answer:

  • TP (true positive): the check said yes, and the task was completed.
  • FP (false positive): the check said yes, but the task was not completed.
  • TN (true negative): the check said no, and the task was not completed.
  • FN (false negative): the check said no, but the task was completed.

From these, precision is TP / (TP + FP): when the check says yes, how often is it right? Recall is TP / (TP + FN): of the tasks that really were completed, how many did the check find?

This is most useful for scoring your own judges. Have a person label 50 or so real runs, run the judge on the same runs, and count where they agree and disagree. A judge with many false positives is passing failures. A judge with many false negatives is flagging good runs.

Step 5: Score offline before launch and online in production

Run a fixed test set before each release to catch regressions. Then score live traffic, because production inputs differ from any test set you wrote.

Offline evaluation is controlled testing before release. Online evaluation is monitoring on production traffic. You need both.

Offline scoring tells you whether a change made things worse on cases you already know about. Online scoring tells you about the cases you didn't think of: users who change their mind midway, questions your knowledge base doesn't cover, and tools that time out. Use the same metrics in both places so the numbers can be compared.

Step 6: Review scores, then change something and check again

Treat a low score as a reason to open the trace, not as the end of the analysis. Make one change, then compare scores before and after.

Open a few failing runs and find where they went wrong: the prompt, a missing source, a tool choice, a bad parameter. Change one thing so you can tell what caused any movement. Then check the same metrics again on new runs. If the score didn't move, the change wasn't the cause, or the metric wasn't measuring the failure.

How this looks in production

In PRISM by Block Convey, Evaluators score real runs with two kinds of rule, and every verdict can be traced back to what produced it.

  • Deterministic rules give the same verdict for the same input. They use no model and run on 100% of sessions.
  • LLM-as-judge rules have a model read the exchange. The judge is not sampled: it scores every incoming trace until the plan's allowance runs out (Free: 100 a day). After that, only the deterministic rules run.
  • Each verdict links to the rule, the span, the source checked and the reason.
  • Agent Observability tracks the outcome against the user's goal, not just span status, so a run that returned 200 can still be scored as a failure. Agent steps appear when your integration sends them.

Core scores are on the Free plan. Custom evaluators and the Evaluators Hub are on Builder and above.

For Step 6, PRISM's AI Remediation traces a failure to a likely cause and suggests changes. After a fix is merged, PRISM compares pass rates for the 7 days before and the 7 days after the merge. A person reviews and merges changes; PRISM does not do it on its own.

See the Evaluators page for how evaluators work, and PRISM for how evaluation fits with traces and sessions.

Common mistakes

Most metric mistakes come from measuring steps instead of outcomes, or trusting scores nobody has checked.

  • Tracking only step success or HTTP status. A 200 doesn't mean the user got what they came for. Fix: score the outcome against the user's goal (Step 1).
  • Using one blended score. An average can hide a serious failure in one area. Fix: track several metrics and look at them separately.
  • Using only offline test sets. Your test set can't cover every real input. Fix: add online scoring on live traffic (Step 5).
  • Trusting an LLM judge without checking it. A judge is a model, so it can be wrong. Fix: compare the judge's verdicts with human-labeled examples and count the false positives and false negatives (Step 4). Version your scorers so you know which one produced which number.

Score your agent's real runs

Send your agent's traces to PRISM and see which runs met the user's goal.

Free to start, 100 credits each month.