Pillar guide

Agent evals (agent evaluation)

A plain-English guide to agent evals — the practice papers call LLM agent evaluation and vendor docs call AI agent evaluation: what agent evaluation measures that model benchmarks cannot, the final response vs trajectory agent evals split, how to run agent trajectory evaluation, how to write agent evals from the failures your agent actually has in production, what an agent evaluation framework should include, and how LLM-as-a-judge grading works and where it fails.

TL;DR

What are agent evals?

Agent evals — agent evaluation, in the longer form papers use — are tests that measure whether an AI agent completes real tasks: whole multi-turn conversations and tool-call sequences, not single model responses. Each eval pairs a task with an environment, a grader, and pass criteria. The eval sets worth trusting are written from production failures, because a suite written from imagination measures the team's imagination, not the agent.

The term shows up under two spellings — agent evals in the shorthand engineers actually use, agent evaluation in papers and vendor docs — and both mean the same thing: tests for an AI agent as a system, graded on task completion rather than text quality. That distinction is what separates the topic from model benchmarking. A benchmark scores a frozen model on standardized questions; an agent eval scores your model plus everything you wrapped around it — prompts, tools, skills, memory — on the jobs your users bring.

This guide covers the ground the search terms ask about: what agent evals measure that model benchmarks cannot, the split between final-response and trajectory grading and how to run trajectory evals, the anatomy of a single eval, how to write agent evals from production failures rather than imagination, LLM-as-a-judge grading and its documented failure modes, and what an agent evaluation framework should include. It also argues one position throughout, and flags it as a position: an eval set is a component of the agent harness, and the only eval sets that stay meaningful are the ones continuously rebuilt from real production failures.

We build in this space. Moda is a harness engineering platform — not an observability dashboard, not an LLM router, and not another platform for running evals. It turns production traces into verified evals and harness improvements: failures detected in real traces become eval cases, and proposed changes are checked against replayed traffic before they ship. This page will not pretend the eval runner you already use needs replacing.

Updated

Foundations

What agent evals measure that model benchmarks cannot

Model benchmarks score a model's answer to a prompt. Agent evals score a system's completion of a job — a multi-turn conversation, a sequence of tool calls, a change made to some external state. The difference is not cosmetic; it changes what a test case even is.

Single-response metrics — exact match, similarity to a reference answer — assume the unit under test is one piece of text. An agent's unit of work is a trajectory: did it pick the right tool with the right arguments, keep track of what the user said four turns ago, stop when the job was done, and leave the external state the user wanted? An agent can produce a fluent, polite, individually-reasonable transcript and still fail the task, and a per-response metric will grade every message in that transcript highly.

Agents are also non-deterministic. The same input can produce different trajectories across runs, so agent evals report pass rates over repeated runs rather than a single pass or fail, and the failures worth engineering against usually live in the tail runs rather than the median one.

In practice the field splits grading along two axes: final-response (outcome) evals check whether the end state matches expectations, and trajectory evals check whether the steps taken to get there were reasonable. That split decides most of a suite's cost and most of its blind spots, so it gets its own sections next.

Terminology

LLM agent evaluation and AI agent evaluation: two names, one practice

LLM agent evaluation and AI agent evaluation name the same discipline this page calls agent evals. The variation is by community, not by meaning: research papers say LLM agent evaluation because the agents under test are built on large language models; vendor docs and enterprise teams say AI agent evaluation; engineers shorten both to agent evals. All three grade an agent as a system — the model plus the harness around it: prompts, tools, skills, memory — on whole tasks.

The distinction worth keeping is not between the synonyms but between grading a model and grading an agent. Model benchmarks and single-response scoring grade one piece of text from a frozen model. LLM agent evaluation grades a trajectory: tool selection and arguments, state kept across turns, recovery from failed steps, and the end state left in external systems — reported as pass rates over repeated runs, because agents are non-deterministic.

Whichever term you search, the machinery is what this guide walks through: a task, an environment, a grader, and pass criteria per case; final-response and trajectory grading reported separately on the same case; deterministic checks first and calibrated LLM judges only where assertions cannot reach. And the property that decides whether any AI agent evaluation effort means anything is the same throughout: cases written from failures observed in production traces, not imagined ones. That supply side — traces in, verified eval cases and harness fixes out — is the harness engineering job Moda does, while the evals themselves run in whichever runner you already use.

The split

Final response vs trajectory agent evals

Final response vs trajectory agent evals is the first split to settle in any suite, because stripped down, every agent eval grades one of two things. Final-response evals grade what the agent ultimately produced — the closing answer, or the end state it left in external systems. Trajectory evals grade the path: which tools it called, with what arguments, in what order, at what cost, and how it recovered when a step failed. The two fail independently, which is why the choice between them is a false one.

Final-response grading fails silently on process. An agent can land the right answer through a wasteful or dangerous path — twelve tool calls where two would do, a hallucinated argument that happened to work, a skipped verification step that will bite on the next input. Outcome-only suites pass all of it, and the cost shows up later as latency, spend, and successes that cannot be repeated.

Trajectory grading fails in the mirror image. An agent can execute a clean, defensible sequence of steps and still miss the goal because the final synthesis was wrong. Trajectory checks are also more expensive to maintain: they need reference trajectories or per-step criteria, and they are more sensitive to harmless variation, because two correct runs rarely take identical paths.

So the practical answer to final response vs trajectory is both, assigned deliberately per case. Grade the final response with cheap deterministic checks wherever the task has a checkable end state. Add trajectory grading where the process is the product — tool-heavy workflows, anything with side effects, anything with a cost budget — and weight it toward the steps that production failures show actually going wrong. Report the two as separate scores on the same case: a passing outcome with a failing trajectory is a specific, actionable finding, and so is the reverse.

SourceLangfuse, AI Agent Evaluation

Method

Agent trajectory evaluation

Agent trajectory evaluation is the practice of grading the path an agent took — the ordered sequence of tool calls, arguments, intermediate decisions, and recoveries — rather than only its final output. It answers the question final-response grading cannot: did the agent do the work correctly, or did it merely end well?

In practice trajectory evals split into a deterministic half and a judged half. The deterministic half is trajectory matching against a reference: strict mode requires the same tool calls in the same order, unordered mode accepts the same calls in any order, and subset and superset modes bound the agent's calls from above or below — no tools beyond the reference, or at least the reference's tools. LangChain's agentevals package is the cleanest public statement of these modes. Alongside matching sit step metrics that need no reference at all: step counts, loop detection, required-step presence, and budget checks.

The judged half hands the whole trajectory to an LLM judge with a rubric — optionally including a reference trajectory — and asks whether the steps were reasonable. It is the right tool for open-ended tasks where correct paths legitimately vary, and it inherits every LLM-as-a-judge bias, so it needs the same calibration against human-labeled examples as any other judge before its score gates anything.

Strictness is a per-case decision, not a suite-wide one. Exact matching is cheap, deterministic, and brittle — reserve it for compliance-critical sequences where order is the requirement, like a policy lookup that must precede an authorization. Ordinary tool workflows get subset or unordered checks; open-ended work gets the judge. And because agents are non-deterministic, run each case repeatedly: path variance across runs is itself a signal, since an agent that takes a wildly different route every time is fragile even when its pass rate looks fine.

Where do reference trajectories and rubrics come from? The same place cases should: production. A replayed production trace where the agent succeeded is a reference trajectory. One where it failed names the property the judge must catch — codify it and it becomes a regression test. This is the supply side Moda covers: full traces in, behavioral failures attributed per step, trajectory criteria derived from what actually went wrong — while the trajectory scoring itself runs in whichever eval runner you already use.

SourceLangSmith docs, Trajectory evaluations (agentevals)

Anatomy

The anatomy of an agent eval

Strip away the tooling and every agent eval is four decisions: what task to test, what environment it runs in, how the result is graded, and what counts as passing.

  • Task: a single turn, a full conversation, or a scenario driven by a scripted simulated user. The task defines what done means; vague tasks make every grader downstream of them unreliable.
  • Environment: live tools, mocked tools, or replayed production traffic. Live is realistic and flaky; mocks are stable and drift from reality; replaying recorded production traces sits between the two and is the only option that tests against what users actually did.
  • Grader: deterministic checks (assertions on tool calls, end state, output structure), human labels, or an LLM judge. Mature suites mix all three — cheap assertions everywhere, judges for qualities assertions cannot express, humans to calibrate the judges.
  • Pass criteria: per-case thresholds plus a suite-level bar — which regressions block a change from shipping, and which are logged and watched instead.

The decision that determines whether any of this is worth running is none of the four. It is where the cases come from. A suite whose cases were written from imagination measures the team's imagination; a suite whose cases were written from production failures measures the agent. The rest of this page keeps returning to that distinction because every other design choice is downstream of it.

Playbook

How to write agent evals from production failures

Here is how to write agent evals from production failures, as a concrete loop with four moves: cluster the failures in your traces, turn each observed failure into an eval case, pick a code check or a judged check per criterion, and gate the harness change that fixes it on replayed traffic. The loop is vendor-neutral until the last step, and the order matters: teams that start by choosing tooling usually end up with an empty framework, and teams that start by reading their own failures usually end up with a suite that catches real regressions.

  • Step 1 — cluster failures from traces, not from a feature list. Read a sample of real failed traces and name the failure modes that actually occur in your traffic — tool misuse, context loss, reasoning loops, goal drift, hallucination. Most never throw an error: every span in the trace can return 200 OK while the task itself fails, which is why error logs cannot supply this step. Group the failures by intent cluster and failure mode; the largest and fastest-growing clusters define the eval backlog, in priority order.
  • Step 2 — turn each observed failure into an eval case. The input comes from the real trace — the actual user messages, tool calls, and tool results, not a paraphrase, because paraphrases quietly drop the detail that triggered the failure. The grading criteria come from what should have happened. Tag the case with the intent cluster and failure mode it reproduces so results can be sliced later, and keep the trace reference on the case: an eval whose provenance is a real failure is a regression test, not an opinion.
  • Step 3 — pick a code check or a judged check per criterion. If the failure was checkable — a wrong tool argument, a skipped required call, a malformed output, a blown call budget — write the assertion; it is deterministic and free on every run. If the failure was open-ended — the agent talked around the request, the answer was ungrounded — write a narrow, binary judged criterion and calibrate the judge against human-labeled examples. The judge-vs-code section below has the full decision playbook; the mistake to avoid is one 1-to-10 aggregate score doing both jobs.
  • Step 4 — gate harness changes on replayed production traffic. Run the proposed prompt, tool, or skill change against replayed production traces and compare per intent cluster before shipping — starting with the change meant to fix the failure the new case encodes. A fix that passes its own eval case but regresses a neighboring cluster is caught here or in production; there is no third option.
  • Then keep the loop running: refresh with traffic. New intent clusters and newly observed failure modes become new cases, and stale cases are retired. A suite nobody refreshes becomes a green dashboard over a regressing agent.

Why write agent evals from production failures instead of from a feature list? Because an agent's failure distribution is an empirical fact about your users and your harness, and nothing else predicts it well. Cases written from a feature list encode what the team imagined at launch; cases written from production failures encode what actually breaks, weighted by how often it breaks. The first suite is a checklist. The second is an instrument. This is also why the loop starts at the traces rather than at a framework: every downstream decision — which cases exist, what each grader asserts, which changes get blocked — inherits its meaning from step 1.

This loop is the job Moda is built for — it is the trace-to-evals half of harness engineering: detecting behavioral failures across the whole trace population, clustering intents to define coverage, attributing each failure to the harness component responsible (a prompt, a tool schema, a skill, the eval set itself), and verifying candidate changes against replayed traces before they ship. Production traces in, verified harness improvements out. The runner, the CI wiring, and the deploy pipeline stay yours.

SourceHusain, Your AI Product Needs Evals

Checklist

Trajectory evals for agents: a working checklist

Adding trajectory evals for agents to an existing suite is mostly a matter of order. This is the sequence that avoids the common traps.

  • Log full trajectories before grading them. Trajectory evals need every tool call with its arguments and results. If your capture drops arguments or truncates outputs, fix the instrumentation first — you cannot grade steps you did not record.
  • Pick strictness per case, not per suite. Strict match for compliance-critical sequences, unordered or subset match for ordinary tool workflows, judged trajectories for open-ended tasks.
  • Grade the trajectory and the final response on the same case, reported as separate scores. One blended number hides which half failed.
  • Start with the free metrics. Step counts, loop detection, required-step presence, and budget checks are deterministic, run on every case, and catch the expensive-success failure mode before any judge is involved.
  • Derive step criteria from observed failures. The steps worth asserting on are the ones production traces show going wrong — the tool that receives wrong arguments, the verification step that gets skipped. When you find a bad trajectory, codify the violated property as a permanent check.
  • Run each case multiple times and watch path variance. A case that passes through three different trajectories in five runs is reporting fragility that a single green check hides.

The checklist is runner-agnostic — LangSmith, Langfuse, DeepEval, and the rest each support some mix of trajectory matching, step metrics, and judged trajectories. What no runner supplies is the evidence: which steps fail in production, on which intents, how often. That is the part Moda rebuilds from production traces, so the checklist runs on real failure data instead of guesses.

Setup

Tool calling accuracy evals: how to set them

Tool calling accuracy evals grade the most assertable property an agent has. Every tool call is a structured record — a tool name, an argument object, a position in a sequence — so most of the grading can be exact instead of judged. Setting evals for tool calling accuracy comes down to four decisions: what to assert, which checks stay deterministic, where the criteria come from, and how the score is reported.

  • Assert tool selection first. For each case, check that the agent called the right tool — and did not call tools the task never needed. Wrong-tool and unnecessary-call failures are the cheapest to catch and among the most common in production traces.
  • Assert arguments at the right strictness. Structured arguments — IDs, enums, dates, amounts — get plain equality against the expected value. Free-text arguments, like a search query, get schema validation plus a semantic check, because two correct query strings rarely match byte-for-byte.
  • Assert order only where order is a requirement. A compliance-critical sequence — the policy lookup that must precede the authorization — gets a strict ordered check; ordinary workflows get unordered or subset matching so harmless variation does not fail the case.
  • Set a call budget per case. A maximum tool-call count catches retry loops and redundant calls even when the final answer lands — the expensive-success failure that outcome-only grading passes.
  • Keep the deterministic and judged halves separate. Tool name, argument equality, schema validity, order, and call counts are deterministic — run them on every case, every run, at no model cost. Reserve an LLM judge for what equality cannot express: whether a free-text argument means the right thing, or whether skipping an optional call was reasonable.

Derive the assertions from production tool-call failures, not from the tool catalog. Reading real traces where a tool call went wrong — the wrong tool for the intent, a malformed or hallucinated argument, a redundant retry loop, a required call skipped entirely — tells you exactly which properties are worth asserting, weighted by how often each one actually breaks. A tool-call failure observed in production, codified as an assertion, is a regression test; an assertion written from the tool's documentation is a guess.

Report tool-call accuracy as its own score, separate from final-response accuracy, on the same case. An agent can produce the right answer through wrong tool use — a hallucinated argument that happened to work, three redundant calls where one would do — and a blended score hides it. Two numbers per case make the failure actionable: a passing response with failing tool calls points at the harness (the tool schema, the prompt's tool guidance); failing responses with passing tool calls point at the final synthesis.

Because agents are non-deterministic, run each case repeatedly and report tool-call accuracy as a pass rate, not a single pass or fail. The supply side is where Moda fits: it detects tool-call failures across production traces, attributes each one to the harness component responsible, and turns the observed failure into eval criteria — while the assertions themselves run in whichever eval runner you already use.

Method

LLM as a judge

An LLM judge is a model prompted with a rubric, the input, and the agent's output, and asked to score what deterministic checks cannot express: helpfulness, groundedness, whether the agent actually resolved the request rather than talking around it.

The method took over because it scales like code while grading, approximately, like a human. The MT-Bench work that made it credible measured strong LLM judges agreeing with human preferences over 80% of the time — roughly the rate at which humans agree with each other. That result is why LLM-as-a-judge is now the default grader for open-ended agent behavior.

The same research is also the canonical catalog of its failure modes: position bias (favoring whichever answer is shown first), verbosity bias (favoring longer answers), self-enhancement bias (favoring text the judge model itself might have produced), and weak grading of subtle reasoning errors. None of these are exotic. All of them appear in production eval suites that nobody calibrated.

The working discipline is unglamorous. Prefer narrow, binary rubrics per criterion over one 1-to-10 aggregate score. Grade the judge itself against a set of human-labeled examples before trusting it, and re-calibrate whenever the judge model or the rubric changes. A judge nobody has checked against human labels is a random number generator with good grammar.

For agents specifically, judges should read the trajectory, not just the final message — wrong-but-plausible tool arguments and quietly skipped steps are invisible in closing text. And the rubric should be derived from failures observed in production, not imagined ones: a judge tuned to catch failures no user ever hits is a cost center with a confidence interval.

SourcesZheng et al., Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (arXiv:2306.05685) · Langfuse docs, LLM-as-a-Judge

Reliability

How good is an LLM as a judge?

Good enough to grade open-ended agent behavior at scale, and not good enough to trust uncalibrated — the honest answer to how good is an LLM as a judge sits between those two poles. The MT-Bench and Chatbot Arena research measured strong LLM judges agreeing with human preferences over 80% of the time, roughly the rate at which humans agree with each other; that is the ceiling argument for the method. The floor is set by its documented biases, and where a given judge lands between the two depends almost entirely on how it is used.

  • Against human labels: a strong, well-prompted judge approaches human-to-human agreement on preference tasks at a fraction of the cost and latency — which is why it took over open-ended grading. It does not replace humans; it amortizes them: a small human-labeled set calibrates the judge, and the judge scales those labels across every case and every run.
  • Against code evaluators: as a working rule — ours, not a finding of the judge research — prefer the assertion wherever one can be written. Deterministic checks are exact, free per run, and drift-proof; a judge costs a model call per case, returns a distribution rather than an answer, and inherits bias. Judges earn their keep on the properties assertions cannot express — helpfulness, groundedness, whether the agent resolved the task rather than talking around it.
  • Known failure modes: position bias (favoring whichever answer is shown first), verbosity bias (favoring longer answers), self-enhancement bias (favoring text the judge model might have written itself), and weak detection of subtle reasoning errors — all documented in the same research that validated the method, and all present in production suites nobody calibrated.
  • The uncalibrated case: a judge nobody has checked against human labels can be confidently and systematically wrong — scoring politeness while missing a wrong account id, or passing a fluent transcript that failed the task.

So the practical answer is that an LLM judge is exactly as good as its calibration. Measured against a human-labeled sample, a narrow binary rubric per criterion typically holds up; a single 1-to-10 aggregate score typically does not. Reliability also degrades quietly whenever the judge model or the rubric changes, which is why re-calibration on every change is part of the method rather than an optional extra.

For agent evals specifically, two upgrades make a judge materially more trustworthy. First, have it read the whole trajectory, not just the closing message — wrong-but-plausible tool arguments and silently skipped steps are invisible in final text. Second, derive the rubric from failures observed in production traces rather than imagined quality bars: a judge tuned to catch failures no user ever hits is a cost center with a confidence interval. That second half is the part Moda supplies as a harness engineering platform — behavioral failures detected in real traces become the judged criteria and the human-label calibration sets — while the judge itself runs in whichever eval framework you already use.

SourceZheng et al., Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (arXiv:2306.05685)

Decision

Should I use LLM-as-a-judge or a code evaluator?

Use a code evaluator wherever the property is checkable, and reserve LLM-as-a-judge for the properties assertions cannot express. That single rule settles most of the decision: code evaluators are deterministic, free to run, and never drift, so every case starts there — and a judge is added only where the failure you need to catch is genuinely open-ended.

  • Code evaluator (deterministic checks): tool names and arguments, schema validity, output structure, end state in external systems, exact and pattern matches, step counts, required-step presence, ordering, and cost or call budgets. If the criterion can be written as an assertion, write the assertion.
  • LLM-as-a-judge: helpfulness, groundedness, whether the agent actually resolved the task rather than talking around it, tone, reasoning quality, and semantic equivalence of free text — two correct answers that share no exact wording.
  • Prefer code first. A deterministic check costs nothing per run, returns the same verdict every time, and needs no calibration. A judge adds model cost and latency, inherits position, verbosity, and self-enhancement bias, and returns a distribution rather than an answer.
  • When you do add a judge, run the discipline from the section above: narrow binary rubrics per criterion, calibration against human-labeled examples before its score gates anything, re-calibration when the judge model or rubric changes.
  • Derive both kinds of criteria from production failures. The assertion worth writing is the property a real trace violated; the rubric worth judging is the open-ended failure users actually hit — not an imagined quality bar.

In practice the split is not either-or but layered on the same case: deterministic checks run on every case and every run as the floor, and judged criteria sit on top of the subset of cases whose failure modes are open-ended. A case that greets the user politely while passing the wrong account id to a tool should fail on the assertion long before any judge reads the transcript.

If you are shopping for an LLM-as-a-judge framework, the good news is that the choice is low-stakes: Langfuse, LangSmith, Braintrust, DeepEval, promptfoo, and OpenAI Evals all ship both grader types — managed judges with rubric templates alongside assertion and code-based evaluators. The differentiating question is the same one this page keeps returning to: not which framework runs the graders, but where the criteria come from. Moda's part is that supply side — behavioral failures detected in production traces become the assertions and the rubrics, and both run in whichever framework you already use.

Framework

Agent evaluation framework: what it should include

An agent evaluation framework is the machinery around the cases: somewhere to keep datasets, a runner that executes the agent against them, graders, and a comparison view that says what got better and what got worse between two versions of the agent. If you are choosing an agent evaluation framework, evaluate it on five components — and then on a sixth question no framework answers, which is where the cases come from.

  • Case and dataset management: versioned cases with expected outcomes, tagged by intent and failure mode so results can be sliced — ideally with provenance, so each case points at the production trace or failure it encodes.
  • A runner: executes agent configurations against cases with concurrency and repeated runs, including multi-turn scenarios and simulated users. Repeated runs are non-negotiable for agents; a framework that reports single-run pass/fail hides non-determinism.
  • Grader integration: assertions and code evaluators, LLM judges with calibration support, and human-label queues, reporting per-case results rather than one averaged score. The judge/code mix is a per-criterion decision, so the framework must allow both on the same case.
  • Regression comparison: two agent versions run on the same set, diffed case by case, wired into CI so a regressing change is blocked before deploy rather than discovered after.
  • Reporting over time: pass rates per slice — per intent, per tool, per model — because the single global number hides everything worth knowing.

The real options span a spectrum. OpenAI Evals established the registry-of-benchmarks pattern in open source. Hosted platforms such as Braintrust, Langfuse, and LangSmith ship dataset management, judges, and CI hooks as a product. Open-source libraries like DeepEval and promptfoo suit teams that want the whole suite living in the repository. All of them are competent at the running part.

Zoom out, though, and the framework is the middle of a longer stack. End to end, keeping an agent evaluated takes five layers: a trace store that captures full production trajectories (every message, tool call, argument, and result — you cannot write cases from traces you did not keep); failure clustering that groups those traces by intent and failure mode so you know what needs a case; the eval suite itself; the judge/code grader mix per criterion; and a regression gate that replays production traffic against any proposed harness change before it ships. Eval frameworks cover the middle two. The outer layers — the trace store and the failure clustering that decide what the suite measures, plus the replay gate that decides whether a change ships — are the parts Moda supplies, as harness engineering rather than as another runner.

The trap is the one Hamel Husain's widely-cited essay on evals names directly: tooling makes running evals easy, which lets teams skip the hard part — error analysis, the unglamorous work of reading real transcripts to decide what is worth testing. A framework filled with hand-written cases executes flawlessly and measures nothing. Framework choice is the fifth most important decision on this page; case provenance is the first.

SourcesOpenAI, Evals framework · Husain, Your AI Product Needs Evals

Tools

AI agent evaluation tools, and the question they leave open

Every tool above answers the question how do we run evals. The question that decides whether the resulting numbers mean anything is different: where do the cases come from, and do they still resemble production? That question is not answered anywhere inside an eval runner.

The standard failure sequence: a team hand-writes an eval set at launch, encoding what they imagined users would do. Traffic arrives and drifts away from those guesses. Six months later the suite is green on every run while users hit failures the suite never modeled. The suite did not rot because the tooling was bad; it rotted because nothing connected it to production.

Moda approaches the problem from the other side. It is not an eval-running platform, not an observability dashboard, and not an LLM router. Moda is a harness engineering platform: it treats the eval set as one component of the agent harness — alongside prompts, tools, skills, and memory — and changes it from production traces. Behavioral failures detected in real traces become eval cases. Intent clusters with no eval coverage become new suites. Proposed harness changes are verified against replayed production traces before they ship.

The practical division of labor: keep whichever runner your team already likes. What changes is the provenance of the cases it runs — evidence from production instead of guesses from launch week.

The position

Evals are a harness layer, not a separate discipline

The framing that keeps eval sets honest is to stop treating them as a QA artifact that lives next to the agent, and start treating them as a component of the agent harness — versioned, owned, and continuously changed from production evidence like every other component.

The harness is everything around the model that makes it your agent: prompts, tools, skills, evals, memory. Every component encodes assumptions about users, and every component drifts as users change. A prompt written for last quarter's traffic goes stale in a familiar way. An eval set written for last quarter's traffic is worse, because the eval set is the instrument that was supposed to detect staleness in everything else. When it drifts, the whole improvement loop reports green while the agent regresses.

Treated as a harness layer, evals get the same operational properties as the rest: cases live in version control next to the prompts and tool schemas they gate; every case traces to evidence — a production failure it reproduces or an intent cluster it covers; the set is refreshed on a cadence tied to traffic shift rather than the calendar; and changes to the eval set itself go through review like any other code.

This is the sense in which Moda works on evals — the same loop it runs for prompts and tools: detect a failure in production traces, attribute it to the responsible harness component, propose a diff, verify against replays. When the component is the eval set, the diff is new cases built from real failures and retired cases that no longer reflect how users behave.

Failure mode

Why did my agent pick the wrong model?

Because model selection is a harness decision, and the decision drifted from what your traffic needs. Whatever mechanism picks the model — a hardcoded default, a routing policy, a learned router your team built — it encodes assumptions about which tasks need which capabilities, and those assumptions go stale exactly the way prompts and tool schemas do. A wrong-model pick is not the model malfunctioning; it is a model selection failure in the harness, and it is caught and fixed the same way as any other harness failure.

  • Stale defaults: the model that was right at launch, still serving traffic that has since changed shape. The most common wrong-model pick is no decision at all.
  • Surface-feature routing: rules keyed to token counts or keywords instead of intent, sending a hard reasoning task down the cheap path because it happened to be short.
  • Stale learned routers: a router trained on old preference data keeps routing to yesterday's winner after the task mix or the model lineup changed.
  • Silent fallback downgrades: a rate limit or timeout triggers the fallback chain, a weaker model answers, and nothing in the logs marks the response as degraded.

Wrong-model picks rarely throw errors, so error logs will not surface them. The detection that works is population-level: compare quality per intent cluster across the models that served it, from production traces. A cluster that regresses only when the cheap model serves it is a model selection failure with a named location — that cluster, that route — rather than a vague sense that the agent got worse.

The fix path runs through evals, not through shopping for a router product. Turn each observed wrong-model pick into an eval case: input from the real trace, criterion naming the intent cluster and the capability it actually needed. Then compensate in the harness — adjust the routing policy or default, or fix the prompt or tool schema if the failure was never really about the model — and gate the change on replayed production traffic before it ships, per cluster, the same replay gate the model-swap section below describes.

This is also the honest version of AI agent model selection as a practice: deciding which model serves which task from production evidence per intent cluster, not from announcement benchmarks or a leaderboard. To be explicit about what Moda is here: Moda is not an LLM router and does not sit in your request path picking models. Routing stays in your infrastructure — a config file, a gateway, a router you built. Moda supplies the evidence that makes the routing decision right: which clusters fail under which model, eval cases built from observed wrong-model picks, and replay verification that a routing-policy change actually fixed the cluster it targeted.

Routing

How to eval an LLM router in production

If you built your own LLM router — a routing policy, a set of model defaults, or a learned classifier deciding which model serves which request — the question of how to eval an LLM router in production has a concrete answer: grade the routing decision the same way you grade any other harness component, with eval cases built from your own traffic and a replay gate in front of every policy change. A router is code you own; it deserves the same evals as your prompts and tool schemas.

  • Cluster production traffic by intent first. The routing unit is the task, so router evals need a denominator: which intent clusters exist, how much traffic each carries, and which model currently serves each.
  • Compare quality per cluster across the models that served it, from production traces. A cluster that regresses only when the cheap model serves it is a routing failure with a named location — that cluster, that route.
  • Turn each observed wrong-model pick into an eval case: input from the real trace, criterion naming the capability the task actually needed. These cases are the router's regression suite.
  • Gate routing-policy changes on replayed production traffic, per cluster, before they ship — the same replay gate any harness change gets. An aggregate score can hold steady while the three clusters your revenue depends on quietly regress.
  • Watch the affected clusters after the change ships. Production evals for model routing are a loop, not a launch check: traffic drifts, model lineups change, and yesterday's correct route goes stale.

To be explicit about the division of labor: Moda is not an LLM router and never sits in your request path picking models. Moda is a harness engineering platform for teams building their own router — it supplies the intent clustering, the per-cluster model comparison from production traces, the eval cases built from observed wrong-model picks, and the replay verification that a routing-policy change actually fixed the cluster it targeted. The router itself — the policy, the classifier, the fallback chain — stays in your infrastructure, versioned and owned like any other harness component.

Evidence

LLM router evaluation from traces

LLM router evaluation from traces means the evidence behind every routing decision comes from what your agent actually did in production, not from public benchmarks. A benchmark ranks models on someone else's distribution; your traces record how each candidate model performs on your tasks, which is the only comparison a routing decision can safely rest on.

The method in four moves. Traces are clustered into a task taxonomy, so routing decisions have units. Each cluster's quality is measured per serving model — replaying real traces through candidate models where live traffic has not already produced the comparison. Wrong-model picks observed in traces become eval cases with trace provenance, exactly like every other production failure on this page. And every proposed routing change is verified against replayed production traffic before it ships, per cluster, with the affected clusters watched after.

Traces also surface the two failure modes benchmark-driven routing cannot see. Silent fallback downgrades: a rate limit or timeout triggers the fallback chain, a weaker model answers, and nothing in the logs marks the response as degraded. Stale routes: the model that was right at launch still serving traffic that has since changed shape. Both are population-level patterns, visible only when whole trace populations are compared per cluster and per serving model — which is precisely what trace-based router evals do and what request-level logging does not.

This is the trace-to-evals loop Moda runs for every harness component, applied to the model-selection layer: production traces in, verified routing evidence out — while the router, the gateway, and the eval runner all stay yours.

Job one

Holding performance through a frontier-to-open-model switch

The highest-stakes moment an eval set ever faces is a model swap: the team decides to move from a frontier API model to an open-weight model — for cost, latency, or control — and the agent has to hold its production performance through the switch.

What makes the switch dangerous is that the harness was tuned, mostly implicitly, to the old model's dispositions: how literally it follows instructions, how it formats tool calls, how much it hedges, what it does with ambiguity. The new model breaks those assumptions silently. Generic benchmark deltas between the two models say nothing useful here, because your agent's behavior is the model and the harness together, and the benchmark only saw the model.

The only honest gate is an eval set built from your own production traces: replay the same real traffic through both configurations and compare per intent cluster and per failure mode, not as one aggregate score. An aggregate can hold steady while the three clusters your revenue depends on quietly regress.

The loop that makes the switch survivable is compensate-and-re-gate: run the gate, see which clusters regressed under the new model, fix the harness for it — a prompt adjusted to the new model's instruction-following, a tool schema tightened against its argument habits, a skill added for a workflow it handles differently — and re-run until the gate holds. The switch succeeds or fails on the harness and the evals that gate it, not on the announcement benchmarks of the incoming model.

This is the first job Moda's eval work is built around: hold agent performance through the switch, with the gate built from your traffic and every compensating harness change verified against replayed traces before it ships.

Frequently asked

Questions

What are agent evals?

Agent evals — agent evaluation, in the longer form — are tests that measure whether an AI agent completes real tasks correctly: full multi-turn conversations and tool-call sequences, not isolated model responses. An agent eval combines a task, an environment (live tools, mocks, or replayed traffic), a grader (assertions, human labels, or an LLM judge), and pass criteria. Because agents are non-deterministic, results are reported as pass rates over repeated runs rather than single scores.

What is LLM agent evaluation?

LLM agent evaluation is the research-paper name for agent evals: testing an agent built on a large language model as a whole system — the model plus its prompts, tools, skills, and memory — on complete tasks, and grading task completion rather than single-response text quality. It grades trajectories (tool selection, arguments, multi-turn state, recovery from failed steps) alongside final responses, and reports pass rates over repeated runs because agent behavior is non-deterministic. The term is interchangeable with AI agent evaluation and agent evals.

What is AI agent evaluation?

AI agent evaluation is the practice of measuring whether an AI agent completes real tasks correctly — full multi-turn conversations and tool-call sequences, not isolated model responses. Every case combines a task, an environment, a grader, and pass criteria; grading splits into final-response checks and trajectory checks, reported separately on the same case. It is the same discipline papers call LLM agent evaluation and engineers shorten to agent evals, and the eval sets that stay meaningful are the ones continuously rebuilt from failures observed in production traffic.

How do you write agent evals from production failures?

Read real failed traces first and name the failure modes that actually occur — behavioral failures like tool misuse, context loss, reasoning loops, and goal drift rarely throw errors, so error logs will not surface them. Turn each observed failure into a case: input drawn from the real trace, grading derived from what should have happened, tagged by intent and failure mode. Cover the largest and highest-failure intent clusters first, gate harness changes on replayed production traces, and refresh the suite as traffic shifts. A small suite written from real failures beats a large suite written from imagination.

Final response vs trajectory agent evals: which should you use?

Both, assigned deliberately per case. Final-response (outcome) grading checks the end state and is cheap to run, but it silently passes agents that succeed through wasteful or dangerous paths — retry loops, hallucinated arguments that happened to work, skipped verification steps. Trajectory grading checks the steps and catches those, but it passes agents that take reasonable steps to the wrong result, and it costs more to maintain. Grade outcomes with deterministic checks wherever the task has a checkable end state, add trajectory grading where the process is the product, and report the two as separate scores on the same case.

What is agent trajectory evaluation?

Agent trajectory evaluation grades the path an agent took — the ordered tool calls, arguments, intermediate decisions, and recoveries — rather than only its final output. The deterministic form matches the trajectory against a reference (strict, unordered, subset, or superset modes) or applies step metrics like counts, loop detection, and budgets; the judged form hands the whole trajectory to a calibrated LLM judge with a rubric. Because agents are non-deterministic, trajectory evals run repeatedly per case, and path variance across runs is itself a fragility signal.

How do you run trajectory evals for agents?

Capture full traces first — every tool call with arguments and results — then choose strictness per case: strict match for compliance-critical sequences, unordered or subset checks for ordinary tool workflows, judged trajectories for open-ended work. Score per step and per run, report trajectory and final-response results separately on the same case, and calibrate any trajectory-reading judge against human-labeled examples before it gates anything. Derive the step criteria from failures observed in production traces — the tool that receives wrong arguments, the verification step that gets skipped — rather than imagined process rules.

What are tool calling accuracy evals?

Tool calling accuracy evals grade whether an agent called the right tools with the right arguments: tool selection, argument correctness (equality for structured values, schema plus a semantic check for free text), ordering where order is a genuine requirement, and a per-case call budget that catches retry loops and redundant calls. Because every tool call is a structured record, most of the grading is deterministic — assertions that run free on every case — with an LLM judge reserved for what equality cannot express. Derive the assertions from tool-call failures observed in production traces, and report tool-call accuracy as its own pass rate, separate from final-response accuracy on the same case.

How do I set evals for tool calling accuracy?

Grade each case on deterministic assertions first: did the agent pick the right tool, pass the right arguments (equality for structured values, schema plus a semantic check for free text), respect ordering where order is a requirement, and stay within a per-case call budget. Add a judged check only for what equality cannot express. Derive the assertions from tool-call failures observed in production traces — wrong tool for the intent, malformed or hallucinated arguments, redundant retry loops, skipped required calls — so each observed failure becomes a permanent check. Report tool-call accuracy as its own pass rate, separate from final-response accuracy on the same case: an agent can land the right answer through wrong tool use, and one blended number hides it.

How are agent evals different from model benchmarks?

A model benchmark scores a frozen model on standardized questions and produces a number you can compare across models. An agent eval scores your whole system — the model plus the harness around it: prompts, tools, skills, memory — on your tasks. Two agents built on the identical model can score very differently on the same agent eval because their harnesses differ, which is also why benchmark deltas between two models predict very little about what a model swap will do to your agent.

What is LLM as a judge?

LLM-as-a-judge is a grading method where a model is prompted with a rubric, the input, and the agent's output, and asked to score qualities deterministic checks cannot express — helpfulness, groundedness, task resolution. The MT-Bench research that popularized it found strong judges agreeing with human preferences over 80% of the time, and also documented its standard failure modes: position bias, verbosity bias, and self-enhancement bias. Judges should use narrow rubrics and be calibrated against human-labeled examples before their scores gate anything.

How good is an LLM as a judge?

Calibrated and narrowly scoped, very good: the MT-Bench research measured strong LLM judges agreeing with human preferences over 80% of the time, roughly the rate at which humans agree with each other. Uncalibrated, unreliable: judges carry position bias, verbosity bias, self-enhancement bias, and weak detection of subtle reasoning errors, and can be systematically wrong without anyone noticing. And wherever a deterministic assertion can be written, prefer the code evaluator — assertions are exact, free per run, and need no calibration — reserving the judge for open-ended properties assertions cannot express. In agent evals, an LLM judge is good enough to gate changes when it uses narrow binary rubrics per criterion, reads the whole trajectory rather than only the final message, is calibrated against human-labeled examples (and re-calibrated when the judge model or rubric changes), and grades rubrics derived from failures observed in production traces.

Should I use LLM-as-a-judge or a code evaluator?

Use a code evaluator wherever the property is checkable, and reserve LLM-as-a-judge for what assertions cannot express. Code evaluators cover tool names and arguments, schema validity, end state, output structure, step counts, ordering, and budgets — they are deterministic, free per run, and need no calibration, so every case starts there. Add a judge only for open-ended properties like helpfulness, groundedness, and task resolution, give it narrow binary rubrics, and calibrate it against human-labeled examples before its score gates anything. Layer the two on the same case rather than choosing suite-wide, and derive both the assertions and the rubrics from failures observed in production traces rather than imagined quality bars.

What is an agent evaluation framework?

An agent evaluation framework is the machinery around eval cases: versioned dataset management, a runner that executes agent configurations against cases with repeated runs and multi-turn scenarios, grader integration spanning assertions, LLM judges, and human labels, regression comparison between agent versions, and reporting sliced by intent and failure mode. OpenAI Evals, Braintrust, Langfuse, LangSmith, DeepEval, and promptfoo all fit the description and all run evals competently. What no framework answers is where the cases come from — the provenance that keeps a suite resembling current production traffic — which is the part Moda supplies from production traces.

What should an agent evaluation framework include?

Versioned case and dataset management, a runner that supports multi-turn scenarios and repeated runs, grader integration spanning assertions, LLM judges, and human labels, per-case regression comparison between agent versions wired into CI, and reporting sliced by intent and failure mode rather than one global pass rate. Around the framework sits a longer stack: a trace store capturing full production trajectories, failure clustering that decides what needs a case, the judge/code grader mix per criterion, and a regression gate that replays production traffic against proposed changes. The piece most frameworks leave to you is case provenance — a mechanism that keeps the cases resembling current production traffic instead of launch-week guesses — and that is the part Moda supplies from production traces.

What are the best AI agent evaluation tools?

There is no single best; the common choices split by how much you want hosted. OpenAI Evals is the open-source registry pattern; Braintrust, Langfuse, and LangSmith are hosted platforms with dataset management, judges, and CI hooks; DeepEval and promptfoo are open-source libraries for teams that keep everything in the repository. All of them run evals competently. The differentiating question is not the runner — it is whether the cases the runner executes still resemble your production traffic, which is the part Moda supplies from production traces.

How many eval cases does an AI agent need?

There is no magic number, because the right measure is coverage, not count. Every major intent cluster in production traffic and every failure mode observed in real traces should have at least one case, with more cases on the clusters that carry the most traffic or the most failures. A small suite of cases drawn from real production failures beats a large suite written from imagination, and any suite stops being meaningful when traffic drifts away from it.

Why did my agent pick the wrong model?

An agent picks the wrong model because model selection is a harness decision — a default, a routing policy, or a learned router — and that decision has drifted from what the traffic actually needs. The usual causes: a stale default that outlived the traffic it was chosen for, routing rules keyed to surface features like token count instead of intent, a learned router trained on old preference data, or a fallback chain that silently downgrades on rate limits. Wrong-model picks rarely throw errors, so detect them from production traces by comparing quality per intent cluster across the models that served it, then fix them like any harness failure: an eval case from the observed pick, a routing-policy or prompt change, and a replay gate before it ships.

What causes model selection failures in AI agents?

Model selection failures in AI agents come from the harness, not the model: stale defaults, surface-feature routing rules, learned routers trained on outdated preference data, and silent fallback downgrades. AI agent model selection done well is an evals problem — decide which model serves which task from production evidence per intent cluster, encode each observed wrong-model pick as an eval case, and gate every routing-policy change on replayed production traffic. Moda is not an LLM router and never sits in the request path picking models; it supplies the evidence side — which intent clusters fail under which model, eval cases from wrong-model picks, and replay verification — while routing stays in your own infrastructure.

How do you eval an LLM router in production?

Treat the router as a harness component and eval it from your own traffic: cluster production traces by intent, compare quality per cluster across the models that served it, turn each observed wrong-model pick into an eval case with trace provenance, gate every routing-policy change on replayed production traffic per cluster, and watch the affected clusters after the change ships. Aggregate scores hide routing failures — a cluster that regresses only under the cheap model is invisible in a global average. Moda is not an LLM router; it is a harness engineering platform for teams building their own, supplying the intent clusters, the per-cluster model comparison, the eval cases from wrong-model picks, and the replay verification — while routing stays in your infrastructure.

How does LLM router evaluation from traces work?

Production traces are clustered into a task taxonomy, quality is measured per cluster and per serving model (replaying traces through candidate models where live traffic has not already produced the comparison), observed wrong-model picks become eval cases, and proposed routing changes are verified against replayed traffic before shipping. Trace-based router evals catch what public benchmarks cannot: silent fallback downgrades, stale defaults that outlived their traffic, and per-cluster regressions that a global score hides — because the comparison runs on your task distribution rather than someone else's. The router itself stays in your infrastructure; the traces supply the evidence that its policy is right.

Can evals keep an agent's performance stable when switching from a frontier model to an open-weight model?

Yes — if the gate is built from production traffic. Replay the same real traces through both configurations, compare per intent cluster and per failure mode, then compensate in the harness for whatever the new model does differently: adjust prompts to its instruction-following, tighten tool schemas against its argument habits, add skills for workflows it handles differently. Re-run the gate after each change until it holds. Generic benchmark comparisons between the two models cannot substitute, because they never saw your harness or your traffic.

How does Moda handle agent evals?

Moda is a harness engineering platform — not an observability dashboard, not an LLM router, and not an eval runner. It treats the eval set as one component of the agent harness — alongside prompts, tools, skills, and memory — changed from production traces like every other component. Behavioral failures detected in real traces become eval cases, intent clusters without coverage become new suites, and every proposed harness change is verified against replayed production traces before it ships. Moda does not replace the runner you already use; it changes what that runner runs.

See agent evals written from your production failures.

Moda is a harness engineering platform: it turns production traces into verified improvements for the agent harness — eval cases written from real failures, attributed to the component responsible, and checked against replayed traces before they ship.