Tracing Workflow Regression to the Responsible Step When Real User Traces Are the Eval Unit
Scoring each step of replayed production traces shows where regressions start.

To test agent changes before deployment, replay the affected cohort of real production traces, score each step as well as the outcomes, and block release until the regression eval clears. Past conversations need the execution context that went with them, including tool calls, intermediate state, and routing decisions. Outcome metrics cannot reliably locate a regression’s source because they discard the causal path that step-level trace evaluation preserves.
Why outcome metrics alone cannot locate a regression's source step
The AgentPex airline case ended in the correct terminal state, with duplicate reservations canceled and refunds recorded. Its outcome score was perfect. Yet the agent quietly skipped a critical post-cancellation verification step, so the outcome grader missed the procedural failure. The final state therefore answered a narrower question than the score appeared to answer. It established only that the requested changes had occurred.
Lanham’s 2026 eval analysis found that the large majority of a sample of traces with perfect outcome rewards contained at least one procedural violation that a standard grader would miss. Outcome scoring compresses a causal chain into a pass/fail bit, hiding “evidence-to-action gaps” in which an agent retrieves correct information but fails to translate it into the correct state change. The score cannot distinguish a sound procedure from a fragile path that happens to succeed.
Lu et al.’s trajectory study on microservice root-cause analysis found a related problem. Correct localization did not establish correct causal reconstruction. For engineers investigating a regression, that distinction is essential because the final answer can conceal the very behavior that needs repair.
Why agent errors are non-local and hard to see at the point they occur
Agent pipelines accumulate state across steps, so an error introduced at step N can become visible in the workflow only at step N+3 or later. The symptom arrives after the original mistake. A misread tool response, corrupted belief state, or incorrect intermediate conclusion can silently contaminate later decisions without causing an immediate exception. By the time the workflow visibly fails, the local evidence may describe the consequence while leaving its origin unclear.
Mahale’s causal attribution paper shows why assigning responsibility from total effects can fail even under controlled conditions. Under the marginal estimand, a causally inert step and the decisive step receive algebraically identical values on every run of a planted chain. A different measure, the common-random-numbers estimand, separates them in most cases, but still gives the decisive step exactly zero on a measurable set of runs. Zero attribution does not certify zero causal contribution. The limitation comes from the measurement structure.
Chen and Yu’s Active Neural Matter framework explains the importance of retained history from another direction. An identical tool result can mean different things depending on the earlier request it answers, so a state representation that discards that interaction history cannot reproduce the observed response distributions. Traditional APM tools such as Datadog and Elastic target crashes and unhandled exceptions rather than hallucination spirals, sycophancy loops, and corrupted beliefs. Those failures require a dynamic agent graph and tool execution trace view. Before locating the responsible step, however, an investigator also needs to distinguish what kind of failure propagated through it.
The failure categories that require step-level attribution to distinguish
“Plan Adherence Failure” points toward workflow routing or prompts, while “Misinterpretation of Tool Output” points toward tool descriptions or output parsing. “Invention of New Information” instead directs attention to retrieval or grounding. These are different engineering problems with similar possible outcomes. A final failure score cannot distinguish among them, and a step identifier alone does not explain which component needs to change.
In the MAST taxonomy, failures fall into system design issues, inter-agent misalignment, and task verification. Its earlier version called the first category “Specification Issues,” which account for the largest share in the taxonomy described here. Many failures attributed to model behavior originate in how the harness specifies or coordinates the work.
Tool schema drift provides a concrete example of a different failure path. A calendar team renames a parameter from attendee_emails to invitees, while the eval harness continues using a frozen schema snapshot. Both the agent and its eval appear healthy, but the production path is broken. The mismatch is at the tool interface. Lu et al. distinguish omitted evidence, misinterpreted evidence, and unsupported reasoning, which likewise require different responses because evidence may never have been queried, may have been read incorrectly, or may not support the reasoning at all. This vocabulary makes attribution actionable, but only if the evaluated workflow matches the one users encounter.
How the eval-prod gap silently invalidates the harness you think is protecting you
A system prompt changed through a prompt-management UI can reach production while an eval harness stays pinned to the main branch’s prompt file. Three weeks later, a team may look into an unrelated regression using a prompt that production no longer uses. Step-level scoring can provide precise evidence about the wrong workflow, giving the investigation an appearance of rigor without establishing production relevance.
The same gap appears when production uses a combination of flag state and prompt version that has never gone through the eval pipeline. The correct alert is “you are serving an unevaluated agent to users,” not “the eval is green.” Passing tests describe the evaluated configuration only. They cannot establish the behavior of a different combination of prompts, tools, routing, and policy.
The harness must version with the workflow, with scenarios, golden tasks, tool-trace assertions, and acceptance thresholds updated in lockstep as those components change. Otherwise, an eval rerun can reproduce yesterday’s assumptions while production exercises today’s dependencies. The attribution consequence is direct. Evidence from a divergent harness cannot establish which step broke for users, making replay against production traces necessary.
How to test agent changes against real production traces before deploying
A production trace becomes an eval unit when evaluation follows the actual execution path, including its intermediate decisions, rather than a synthetic reconstruction of the intended workflow. In a trace-based evaluation workflow, each run captures tool-call logs, sub-agent decisions, and intermediate state as OpenTelemetry spans. Each span includes a step identifier, tool name, model, prompt, output, retrieval chunks, and parent-trace ID. Evaluator scores attach as span events. This structure keeps a score connected to the evidence and state at the step being judged.
TaskCompletion provides the aggregate entry point, while Groundedness, ToolSelectionAccuracy, and ReasoningQuality expose per-step behavior. A drop in one of those scores narrows the investigation beyond whether the overall task succeeded. It does not, by itself, prove causation. Its diagnostic value comes from keeping the score attached to the execution history and then using replay to test that history.
Replay establishes the baseline before a candidate change is evaluated. If the agent code stays the same but replay diverges, it points to a correctness issue such as a control-flow fork, prompt drift, or an untraced dependency. A tweaked-prompt rerun cannot establish that baseline. Once the original execution is reproducible, a targeted edit can be evaluated against the cohort of production traces that exhibited the failure.
Lanham’s eval stack places that procedure within five layers, namely the task harness, trace instrumentation, mixed graders, contrastive regression testing, and meta-evaluation of the judges themselves. Deterministic checks cover schemas and tool calls, while LLM judges assess semantics. The judges also need evaluation. Lu et al.’s annotated fault propagation paths show why process-level ground truth is needed to tell a correct diagnosis from one that is well-grounded. At higher trace volumes, incremental evaluation with log replay across parallel rounds can reduce the required turn-evaluations by 70%, making this approach tractable without scoring every turn afresh.

How systematic frameworks attribute failure to the specific responsible step
Microsoft’s AgentRx converts traces into a common intermediate representation and synthesizes executable constraints from tool schemas and domain policies. It then checks those constraints step by step under guard conditions and creates a violation log that can be audited. That log becomes the evidence for root-cause categorization. Rather than asking an LLM to infer everything from a raw trace, the framework gives the judge a structured record of violations, reducing its surface for bias.
The constraint-synthesis stage connects expected behavior to observable execution. Tool schemas and policies become checks that can identify where a step violates a requirement, rather than remaining prose that an investigator must interpret anew. Guard conditions govern when those checks apply. The log keeps the violations found apart from the later judgment about what caused them. AgentRx reports a 23.6% improvement in failure localization over prompting baselines, with meaningful gains in root-cause attribution as well.
AgentDebugX approaches the investigation through its DeepDebug component, which combines global trajectory understanding, structure-guided investigation, and cross-examination across multiple turns. On the Who&When benchmark, it substantially outperforms the strongest single-pass baseline on exact agent-and-step attribution accuracy. ReCast addresses the representation used for attribution instead. Its study found limited separation between root-cause steps and other steps in ordinary LLM hidden-state representations, motivating attribution-oriented representations trained with contrastive and ranking objectives. Its ReCast-2K training dataset extends attribution beyond ad hoc inspection of individual traces.
These approaches contribute different parts of a disciplined investigation. AgentRx makes requirement violations executable and auditable, DeepDebug structures the inquiry across a trajectory, and ReCast learns representations intended to distinguish responsible steps. None treats the terminal answer as sufficient evidence. Their shared contribution is to turn step attribution into an explicit task whose accuracy can be evaluated, rather than an informal explanation produced after a failed run.

Turning attributed failures into validated harness improvements
The engineering response begins by isolating the responsible step from the production trace. A targeted harness change then fixes the layer at fault with a prompt edit, tool description update, routing fix, or memory revision. Validation replays the change against the cohort of real traces that exhibited the failure. Deployment remains blocked until the regression eval clears.
The failure must also change the harness. A golden task can preserve the scenario, a tool-trace assertion can cover the broken schema, and an adjusted acceptance threshold can govern the affected step. Lu et al. found that omitted evidence, misinterpreted evidence, and unsupported reasoning recurred across two held-out benchmarks and multiple diagnostic frameworks. A lightweight defense targeting those families raised localization accuracy across all tested configurations, showing how cataloged failures can support improvements beyond the original traces.
ReHarness demonstrates a related feedback loop in text-based memory. On CL-Bench with Claude, revision produced higher normalized gain across all six tasks than running without it. Adaptation can also occur during execution. PILOT creates or revises skills and memory from the live trajectory and environment feedback, while Continual Harness adapts prompts, subagents, skills, and memory within a reset-free run, and Self-Harness retains validated edits across runs.
Retraining remains appropriate when attribution identifies a genuine model-weight failure. Systematic tool-output misinterpretation or intent-plan misalignment should not be presumed fixable by a prompt alone. However, AgentRx, ReHarness, and Lu et al.’s findings support harness-first investigation because many failures are addressable through changes that are faster, cheaper, and reversible compared with retraining. Attribution must precede that decision. The lasting discipline is to maintain a dataset of recurring failure modes, run weekly regression evals against it, and extend harness maintenance beyond cleanup after an incident with the same rigor as code review.
Sources
- Causal Attribution for Agentic Decisions: Estimators, Coupling, and a Traceability Specification
- Beyond Fault Localization: A Trajectory-Level Study of LLM Agents for Microservice Root Cause Analysis
- ReCast: Attribution-Oriented Step Representation Learning for LLM-Based Agent Systems
- Active Neural Matter: A Finite-Window Response Framework for Physical Systems and Distributed AI Workflows


