Comparing Agent Traces Across Model Versions
Diffing traces pinpoints where a new model first departs from the old.

Comparing agent traces from different model versions can show behavioral regressions that accuracy scores miss. Automatic grouping of recurring AI agent failure patterns requires a shared coordinate system that connects divergent spans to failure categories and repair locations. Structural comparison shows those patterns across runs, while human review checks whether changes that look plausible are failures or improvements.
Why trace divergence is the right signal for model version changes
An engineer swaps the model, runs the evaluation suite, and sees green, yet production behavior changes. The agent selects different tools, invokes them in a different order, or passes different arguments while still producing an answer that passes the final check. An HTTP status dashboard records completion, and a latency monitor records duration, but neither explains whether an intermediate result was fabricated. The gap is between confirming an outcome and inspecting how the agent reached it.
Silent Failure in LLM Agent Systems treats silent failures as part of the structure of language-based autonomous systems, with causes that go beyond implementation defects. The study documents over 100,000 agent interactions and finds that these failures persist across operational conditions. That finding supports a structural detection method, with step-level inspection complementing aggregate scores. A model upgrade therefore needs a comparison of decisions.
What a trace actually contains and why structure matters for comparison
A trace is a hierarchical record of an agent’s decisions, organized into a parent-child span tree. Its useful elements include tool selection, arguments, responses, tokens consumed per hop, latency per hop, and the recorded reasoning connecting steps. The relationships are part of the evidence. Two runs can contain similar tool calls yet differ in how those calls depend on one another. Comparing the trees exposes the first point where the candidate stops following the baseline’s structure.
The OTel GenAI spec organizes instrumentation across six layers, including client spans, agent and workflow spans, MCP conventions, semantic events, metrics, and provider-specific attributes. It recommends two histogram metrics across conforming implementations, namely gen_ai.client.operation.duration and gen_ai.client.token.usage. These measurements show performance as part of the larger execution record. They do not replace its decision structure. A shared schema makes spans comparable, while a failure taxonomy gives those comparisons coordinates that identify which layer changed and where a repair belongs. Without both, teams have to read logs by hand to work out what went wrong.
How silent behavioral shifts accumulate across a model version boundary
Wei Wu’s longitudinal study documented a personal-assistant agent runtime running roughly 40 scheduled jobs across 8 LLM providers, defended by thousands of unit tests and declarative governance checks. Over eight weeks, the same meta-pattern appeared at least 28 times in the incidents that were recorded. The error signal never reached a human in actionable form. Automated controls stayed largely green, and people spotted most of the incidents. The dominant failure class was “fail-plausible,” in which the model converted an error into a polished, believable report.
A separate practitioner case involved an agent that was wrong about one ticket in fourteen for nine days without a dashboard registering the drift. The tool arguments had quietly shifted. The failure was visible only in the step-level trace, placing the diagnostic evidence below the level of the reported outcome.
Microsoft AI Red Team’s v2.0 taxonomy adds a cross-session concern through its account of memory poisoning. A single successful injection caused an agent to propagate the injected instruction across subsequent sessions. That mechanism shows how changed behavior can outlast the session in which it begins. Teams therefore need a cohort of runs across sessions, rather than only the first post-upgrade execution, to detect episodic or persistent drift.
Failure categories that manifest as trace divergence after a model swap
Planning errors appear when the tool sequence changes in a way that undermines the task. Their diagnostic location is the plan span, because a mistaken plan propagates into downstream execution. Tool errors have a more local fingerprint. Arguments fail the tool’s schema and recur in the same shape on retry, or the agent invokes a function absent from the runtime catalog. Schema guards and tool allowlists address that class of failure.
Retrieval errors appear as a wrong chunk or a hallucinated source in the retrieval span, directing repair toward the retriever rubric and ingestion controls. Reasoning errors instead appear in the generator span when grounded context is available but factual drift occurs or an instruction is ignored. Those failures call for a judge or calibration set at the generator layer. Safety and policy violations have another observable fingerprint. Output scanner results diverge from the baseline, calling for an adversarial pushback set and refusal evaluation.
The interaction-centric taxonomy (2026) assigns failures to an interaction edge and a fault side. Its attribution rule assigns fault to the model when a more capable model could have avoided or recovered from the failure under the same conditions. The unchanged conditions are essential to that diagnosis. Before routing a regression as model-side, engineers must distinguish a model change from a harness configuration difference. Grouping failures by their originating interaction and repair location is more actionable than grouping every unsuccessful run under one outcome label.
Microsoft’s taxonomy extends this coordinate system with Goal Hijacking and Session Context Contamination. The former redirects the agent’s terminal goal without full compromise, while the latter lets data planted early in a session skew later reasoning without triggering safety checks. The order of instructions can bring out these differences between versions. Their fingerprints require comparison of the recorded reasoning and goal state at each span.
The mechanics of diffing two agent traces systematically
To apply these categories, engineers should pin a trace set from the prior model version on fixed inputs as the trusted run. The candidate executes those same inputs against the new version. Alignment follows tree position and tool identifier. Timestamps are unsuitable anchors because latency changes can separate otherwise equivalent spans. The first sustained divergence becomes the diagnostic anchor, with downstream differences examined as possible consequences rather than treated immediately as independent failures.
The open-source Trace Diff tool demonstrates this workflow by aligning two trace trees and highlighting their first sustained divergence. It displays structural JSON changes and performance deltas, then converts the case into a regression test. Its seeded scenarios covered a model swap, a prompt edit, and a tool schema change. It localized three of three regressions to the exact step, with zero false alarms on the all-match control.
Step count and token usage also reveal changes that a success score leaves unread. A candidate that takes materially more steps without improving task success increases cost and latency. That is a regression despite unchanged accuracy. Counterfactual Trace Auditing pairs with-capability and without-capability runs of the same task and annotates their divergence. Across 49 software-engineering tasks, it recorded hundreds of behavioral effects while pass rate moved only marginally, supporting the case for inspecting execution.
A comparison harness should therefore emit three signals per span, namely structural match, performance delta, and semantic drift. Structural match checks whether the tool identity and the shape of its arguments are the same. Performance delta tracks changes in the step count and token usage. Semantic drift checks whether argument values have changed in meaning even though they still fit the same schema. Together, these signals separate a changed execution shape from increased work or a subtler change in the decision itself.
Embedding trace comparison into the upgrade workflow as a regression gate
To make comparison a release control, teams should run it before the candidate version reaches users. The CI gate pairs runtime tracing with automated scorers that can block regressions, rather than leaving the diff as a post-deployment report. The comparison becomes a condition of release. Harness AI Evals, launched July 2026, provides a concrete example of this pattern by evaluating agent or underlying-model changes against standard datasets for correctness, performance, and safety. Its scores serve as quality gates in CD pipelines.
For a model swap, the suite should also include tasks targeting known behavioral differences between the prior and candidate versions. Replaying the existing suite tests the previously defined failure surface. It does not cover every newly relevant behavior. AgentEval uses DAG-structured step-level evaluation with error propagation tracking and parses a high proportion of standard benchmark traces into valid DAGs, while fault detection recall remains strong. Its root-cause attribution degrades more sharply on external benchmarks, which supports keeping human review in the release process.
MCP changes need a distinct comparison pass because a server or protocol update can break an existing test harness independently of the model. Combining both changes obscures the origin of a divergent span. Attribution requires separating the events under test. A model upgrade and an MCP server update therefore need separate baselines and separate comparison runs. The same principle applies to a prompt edit, which should not be folded into a model-only comparison.
Where automated diffing reaches its limit and human review stays in the loop
Dense instrumentation makes a failure inspectable, but inspectability is not the same as reliable detection. Plausibility is the difficult case for automated scoring. A rubric that rewards coherence can favor a confident fabrication over an honest expression of uncertainty. Structural divergence helps teams find a suspicious decision, but judging whether it was justified takes more than the diff alone.
The appropriate refinement is to add a prioritized human review queue to the automated gate. Automated comparison narrows the material that requires attention and gives reviewers an originating span. Categories that are too broad send distinct failures to the same repair path, while overly fine categories consume review time without improving remediation. For model-version comparisons, teams can review planning errors and reasoning errors first, then handle other categories in a secondary pass.
This distinction also sets a boundary for claims about automatic grouping. A taxonomy supplies the labels and coordinates needed to organize recurring divergence, but a useful group is not automatically a proven shared cause. The originating span still needs contextual review. Trace Diff shows how alignment and localization work, while the evaluation tools score runs or assess each step. Those capabilities support a review workflow without establishing that every similar LLM agent error can be clustered and resolved without manual inspection.
What a complete trace-comparison workflow looks like end-to-end
Before deployment, teams should pin baseline traces from the current version on a fixed, diverse input corpus. The corpus should include tasks where tool selection, step count, and argument semantics affect the result. Store the baseline in version control with the model version identifier. This establishes the trusted reference for the next comparison. Teams then add tasks for the candidate where known behavioral differences fall outside the prior model’s tests.
At the gate, the candidate runs against the same corpus and produces the three-signal comparison for each span. The build should fail if there are structural regressions or a substantial increase in step count. Flagged semantic changes enter the human review queue. Reviewers use the first sustained divergence and its taxonomy coordinates to distinguish planning, tool, retrieval, reasoning, and policy failures, while checking whether the model or harness owns the fault. Separate runs for model, MCP, and prompt changes preserve that attribution.
In production, live traces should continue to be compared against the pinned baseline to catch episodic and session-dependent drift. Alerts should target the first sustained divergence in the plan span because planning errors propagate downstream. Continuous monitoring extends the pre-release evidence across the sessions and operating conditions that a fixed test run cannot represent fully.
The objective is not to prohibit change between versions. A different tool sequence or fewer steps may be an improvement when the outputs remain equivalent. Such a difference is a candidate for validation. By contrast, divergence that maps to a planning error or tool hallucination identifies a regression with a repair location. A complete workflow makes that distinction visible, attributable, and actionable before changed behavior becomes a user-facing failure.
Sources
- Updating the taxonomy of failure modes in agentic AI systems: What a year of red teaming taught us
- New whitepaper outlines the taxonomy of failure modes in AI agents
- Silent Failure in LLM Agent Systems: The Entropy Principle and the Inevitable
- Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures


