Skip to main content
AI Securityai-agentsevaluationobservability

Beyond the Demo: How to Evaluate AI Agents in Production

AI agent evaluation for production: what to measure beyond the demo, why agents fail silently, and how trajectory analysis turns repeat failures into fixes.

IB
Itamar Bar

An agent investigating a vulnerability runs grep with a regex pattern across a repository, gets "No matches found," and moves on. Nothing errors. The transcript reads cleanly. Across thousands of runs, the same quiet miss repeats. That is what AI agent evaluation has to catch: not whether an agent can do the job once, but whether it keeps doing it right.

Here is how to evaluate AI agents in production. Score outcomes across the whole fleet, not the transcript of one good run: task completion, accuracy, evidence quality, consistency and reliability. Record the execution path of every run, cluster those paths to find the failures that repeat, and fix them at the source. A demo shows that an agent can complete one selected task. Production evaluation measures whether it continues working across changing repositories, credentials and tool states.

Key takeaways

  • A single successful run proves an agent can finish a task once. AI agent evaluation in production asks whether it finishes correctly across thousands of repos, cloud accounts and tool states.
  • The most expensive agent bugs throw no errors. A tool that silently ignores a regex produces plausible output, and a revoked API token fails the same way across a whole cluster of runs, so only trajectory-level analysis exposes them.
  • Many recurring failures surfaced by trajectory analysis live in the harness around the model: tool implementations, sandbox images, credentials and memory. Fixing a shared component improves every future run that depends on it.
  • Security teams trust agent output when every verdict carries evidence, reasoning and a confidence level, and when approvals sit where the team chooses to put them.

The Demo vs. Production Gap

A demo is one trajectory, picked because it worked. The repository was chosen in advance, the credentials were fresh and every tool the agent reached for existed. AI agents in production meet the opposite: thousands of repositories, tokens that get rotated or revoked, sandbox images missing build tools, and cloud estates spread across accounts and regions. AI agent evaluation that stops at the demo never meets that variation.

The most important failures appear only when agents encounter the variation of production environments. Rival has run more than 13M agent runs, and at that volume the bugs that matter are rarely the ones that crash. The write-up on Taxi, the in-house trajectory analysis tool, puts the difference in two sentences: "A normal bug fails loudly, and once patched, it is gone. A behavioral bug in an agent might fail silently and repeatedly."

Silent bugs also have a price you can calculate. At Rival, a typical failure pattern affects on the order of 2,000 runs (as a rule of thumb), each carrying about 25,000 tokens of context. Cost per uncaught pattern (per day) ≈ affected runs per day × context size × price per token. One pattern can waste on the order of 50 million tokens a day, and Taxi usually surfaces several at once. Measuring these recurring failures is necessary before a team can determine whether changing the model would help.

What Should We Actually Measure?

Demos optimize for response quality because that is what a human reads. Fluent reasoning tells you little about whether a finding was really exploitable, whether the pull request removed the root cause, or whether the run finished at all. Evaluating AI agents for security work means scoring the outcome and the path that produced it, per workflow.

MetricDefinitionHow to measureFailure signal
Task completionThe run reached the workflow's defined end state: an exploitability verdict, a remediation plan, an opened PR, an updated ticketShare of runs that produce the required artifact, against a written definition of done for each workflowRuns that stop early, give up after repeated retries, or end with a summary where an artifact should be
AccuracyThe conclusion is correct for this specific environmentSample verdicts and PRs against reviewer decisions and later ground truth, such as confirmed findings, passing tests and clean rescansVerdicts reversed on review; PRs that fail CI or leave the vulnerable path in place
Evidence qualityEvery claim is backed by artifacts a reviewer can check: code paths, deployed workloads, IAM policies, WAF rulesCheck that each verdict cites retrievable evidence and that the evidence actually supports the conclusionConfident verdicts with thin evidence, or evidence that points the other way
ConsistencyEquivalent inputs produce materially consistent conclusionsReplay a fixed set of findings and compare verdicts, supporting evidence and material reasoning across runsVerdicts that flip on unchanged inputs
ReliabilityPerformance holds across repos, accounts, integrations and timeTrack completion and accuracy by environment, tool and week, and alert on driftA drop concentrated on one integration, region or sandbox image
Cost per usable resultModel, infrastructure and review costs for each result that meets the workflow's written definition of doneTotal workflow cost divided by usable resultsStep counts rising while success stays flat: the agent is looping

Accuracy on a curated test set says little about AI agent evaluation in a live estate, because the inputs there keep changing. Consistency and reliability catch the drift, and cost per usable result catches the loops that never show up as wrong answers.

Understanding Agent Failures

An agent is built to produce a coherent answer from whatever context it gathered. When a tool quietly returns nothing, the agent reasons from nothing, and the reasoning still reads well. In one case from the fleet, the harness's grep tool did not support regex, so regex searches came back "No matches found." That is a normal outcome during exploration, so answer-level AI agent evaluation saw nothing suspicious in any single run.

The failures Taxi surfaced fall into recognizable classes, each with a concrete case:

  • Tool behavior mismatch: the agent searched with regex patterns while the grep implementation ignored them, so searches that should have matched returned empty.
  • Missing environment: agents assumed Maven (mvn) was available in the sandbox, kept failing to install packages with it, and usually gave up after burning tokens. Other missing commands showed up too.
  • Missing context: cloud exploration agents spent the first several steps of each trajectory working out which AWS region was in use. Not a reasoning failure, a memory gap.
  • Scope drift: an agent told only to trace whether the input to a symbol was user-controlled went on to build a full exploitation plan, against its instructions.
  • Dead integration: a revoked API token made every Wiz MCP call fail the same way across a whole cluster of runs.

Four of the five failures sit in the harness around the model, and the fifth came from the prompt. In those four, the agent reasoned sensibly given what it saw. That is why evaluating AI agents by reading final answers misses them, and why each pattern points to a shared correction that can improve a whole class of future runs.

Agent Observability: Tracking What Agents Actually Do

AI agent observability means recording the trajectory of every run: each step, message, action and tool call, with its inputs and outputs. It lets you evaluate what the agent did, not just what it reported. The summary says "no vulnerable usage found." The trajectory shows that the search behind it returned nothing because the tool dropped the regex.

Observability has two jobs. The first is collecting and storing trajectories as a well-managed dataset, which existing tracing frameworks such as LangSmith handle well. The second is analyzing them automatically, and that is the hard part. Reading traces works for a few dozen runs. Past a few hundred or a few thousand, even an agent reading traces for you starts to break. The goal is not individual cases but the global patterns across runs that no single trace reveals.

The Conductor reasoning engine makes automated analysis easier by organizing plans into discrete steps with defined output schemas. A deviation can then be traced to the specific step that produced it. For a security workflow, each step should log the tool called, its arguments, what came back, which repository or cloud account it touched, and the evidence it attached to the verdict.

Learning From Failures at Scale

Rival built Taxi because existing observability tools did not answer the question that matters at fleet scale: which behaviors repeat? Taxi turns raw trajectories into a taxonomy the team can query, in three stages:

  1. Clustering: Taxi embeds every step in the dataset and clusters semantically similar steps, so a regex search that fails in one repository groups with the same failure in another.
  2. Labeling: for each cluster, Taxi samples steps and asks an LLM for a short name based on what they have in common.
  3. Publishing: the taxonomy is written to a database, where engineers browse it in a web UI, query it through a chat agent that answers in SQL with cited examples, or ask a Slack bot. Periodic insight reports cover new trajectories automatically.

Each pattern led to a diagnosis or a fix:

Recurring patternHow it surfacedOutcome
Regex searches returning "No matches found"A search-failure cluster (#34) where many steps were regex grep calls that should have matchedTraced to an incomplete grep implementation in the harness
Agent building exploitation plans it was told not to buildEmerged as its own cluster in the taxonomyPrompt fixed, behavior resolved
Repeated searches for the active AWS regionThe same opening steps across cloud exploration trajectoriesPersistent memory with basic facts about each client's cloud topology
Missing Maven in the sandboxRepeated failed mvn installs, found without a pre-written ruleOther missing commands observed too
Revoked Wiz API tokenIdentical Wiz MCP call failures across a cluster of runsA credentials validation step that prunes unavailable tools before agents start

Some of these could have been caught with a regex in hindsight. But the team found them without knowing to look, and that is the point of clustering. AI agent evaluation at scale combines pre-specified checks for known failure modes with discovered clusters for the unknown ones. The team is now building automatic and user-defined agentic tests that verify expected invariants hold. The full case studies are in the Taxi trajectory debugging post, and they show how fleet-level analysis turns into AI agent reliability.

Building Trust Through Transparency

Fleet-level evaluation helps engineers find recurring failures, while security reviewers need enough evidence to assess individual results quickly. Every Rival agent result carries supporting evidence, transparent reasoning and a confidence level. An illustrative exploitability verdict could show the code path from a vulnerable function to an exposed route, the workload it runs on and whether a WAF rule blocks the payload. A reviewer checks the evidence instead of redoing the investigation.

Approval policies determine what happens after a verdict. In a remediation workflow, agents gather findings, identify the root cause, write a remediation plan and open the PR, then a human follows up and the fix is tracked to closure. Teams choose where approvals sit and widen automation as trust grows, while persistent memory carries lessons forward so a mistake like the AWS region search is not repeated. Pricing also affects the incentive to find these failures. Rival prices per successful run, but its public materials do not define what qualifies as successful. Teams should ask which outcomes count, how low-confidence results are treated and what evidence marks completion. In a DIY build, token costs accrue on failed runs too.

AI agents in production need to produce accurate, consistent results and leave enough execution data to diagnose recurring failures. Outcome-based pricing can reinforce that accountability, but only when success is defined and measurable. Rival uses fleet-level AI agent evaluation to identify failure patterns and improve the harness around its agents. The workflows that run on this harness are on the Rival use cases page.

Sources

Frequently asked questions

How is AI agent evaluation different from evaluating an LLM?

LLM evaluation scores a model's answer to a prompt. AI agent evaluation scores a multi-step process: which tools the agent called, what they returned, whether it reached the workflow's end state, and whether the final artifact is correct. Two agents on the same model can differ widely, because the harness around the model, its tools, memory and context, shapes most of the outcome.

Can an LLM-as-a-judge replace trajectory analysis?

Not on its own. A judge model reading final answers grades plausibility, and silent failures are plausible by definition: a verdict built on an empty search reads as well as one built on a real search. Judges are useful for scoring individual outputs at volume. Trajectory clustering is what reveals that hundreds of those outputs share the same broken step.

How do you evaluate AI agents before giving them write access?

Learning how to evaluate AI agents before granting write access starts with outputs a human reviews: exploitability verdicts, remediation plans and draft pull requests that require approval before merge. Measure accuracy and evidence quality, then move specific workflows to autonomous execution once the numbers hold across environments. Approval points can stay on high-impact actions indefinitely.

Does AI agent observability add much cost?

For AI agent observability, storing trajectories and embedding their steps is cheap compared with the LLM calls the agents already make, since embedding models are inexpensive and scale well. The relevant comparison is the cost of leaving recurring failures undetected. A single uncaught failure pattern can waste on the order of 50 million tokens a day in a large fleet, which dwarfs the cost of the analysis that finds it.

What should an agent trace record in a security workflow?

At minimum: each tool call with its arguments and raw response, the repository, image or cloud account it touched, the intermediate conclusions, and the evidence attached to the final verdict. Add the credentials and integrations available at run start, so a revoked token or missing build tool shows up as a cause rather than a mystery.

Who is accountable for AI agent reliability, the vendor or the customer?

Both models need visibility, but responsibility for finding silent failures should sit with whoever operates the agents. Under outcome-based pricing, the contract should define how failed and low-confidence runs are treated. With in-house agents, the security team carries both the token cost of failed runs and the engineering time needed to diagnose them.