AI agent evaluation metrics: success rate, pass^k, cost and latency
For agent builders4 min read

Good AI agent evaluation metrics answer different questions: does it finish the task, does it finish it every time, how many steps does that take, and what does it cost. One success rate hides most of that. This post defines each metric and shows how to compute them from the trial records of a small eval.
AI agent evaluation metrics start with the trial record
All the metrics below come from one record per trial: the task id, whether the grader passed, the number of steps, the tokens or money spent and the wall-clock seconds. Save these from day one. You cannot recompute a latency percentile from a pass rate.
trials = [ {"task": "a", "passed": True, "steps": 4, "cost": 0.021, "secs": 8.1}, {"task": "a", "passed": True, "steps": 5, "cost": 0.026, "secs": 9.4}, {"task": "a", "passed": False, "steps": 9, "cost": 0.048, "secs": 17.0}, {"task": "b", "passed": True, "steps": 3, "cost": 0.015, "secs": 6.2}, {"task": "b", "passed": True, "steps": 3, "cost": 0.016, "secs": 6.0}, {"task": "b", "passed": True, "steps": 4, "cost": 0.019, "secs": 7.3},]Task success rate
This is the share of trials that pass the grader. Report it per task as well as overall, because an average can hide a task that never passes. It is a clean starting number but says nothing about consistency.
pass@k and pass^k
Anthropic's agent eval guide separates two ideas. The metric pass@k is the chance of at least one correct answer in k attempts, and it rises as k grows. That suits a tool where one success is enough, like generating a candidate fix that a person then checks.
The metric pass^k is the probability that all k trials succeed, and it falls as k grows. The guide's example: a 75 percent success rate per trial gives about 42 percent for three trials in a row. That suits customer-facing agents, where users expect the same good result every time.
Source: Demystifying evals for AI agents(opens in a new tab)
A simple way to estimate pass^k for a task is to raise its success rate to the power k. It treats trials as independent, which is a rough assumption, so use it for comparison and not as a promise.
from collections import defaultdictfrom statistics import mean by_task = defaultdict(list)for t in trials: by_task[t["task"]].append(t["passed"]) for k in (1, 3): per_task = [(sum(r) / len(r)) ** k for r in by_task.values()] print(f"pass^{k} (estimate):", round(mean(per_task), 3))print("any success per task:", {k: any(v) for k, v in by_task.items()})Variance is the reason to keep per-trial records. Two agents can both show 75 percent success, yet one passes three tasks every time and fails one always, while the other passes every task three times in four. They need different fixes, and only the per-task view shows it.
Steps, cost and latency
Two agents with the same success rate are not equal if one uses twice the steps. Track the median and a high percentile for each of steps, cost and seconds. Averages hide the long, expensive runs that cause the trouble.
from statistics import median, quantiles for field in ("steps", "cost", "secs"): values = [t[field] for t in trials] p90 = quantiles(values, n=10)[-1] print(field, "median", median(values), "p90", round(p90, 3))With only a handful of trials the p90 is noisy, so read it as a prompt to look at the slowest runs. Anthropic's building agents article notes that agents trade latency and cost for better performance, which is why these numbers belong next to the success rate.
Source: Building effective agents(opens in a new tab)
Other numbers that earn their place
| Metric | What it tells you | How to get it |
|---|---|---|
| Tool-call accuracy | Right tool, right arguments | Compare each call to an expected call or schema |
| Step-limit hits | Loops and dead ends | Count truncated episodes |
| Recovery rate | Handles a failed tool call | Inject a tool error, see if the trial still passes |
| Human agreement | Is the grader trusted | Compare model grader verdicts to expert labels |
How to read the set together
Keep a baseline. Save the per-trial records from your first full run and compare every later run against them. Without a baseline, a figure like 80 percent means nothing. With one, you can say which tasks moved and by how much.
Look at success first, consistency second, cost and time third. A change that raises success by two points and doubles cost per task may not be a win. A change that keeps success level and halves p90 latency usually is. Put the table of metrics in the same report every run, so a regression shows up in the column where it happens.