What Most Observability Platforms Miss When They Flatten Agent Errors Into a Single Failure Event
Flattened traces reveal that an agent failed, not where or why.

AI agent failure attribution by harness layer requires a trace that preserves decisions, their supporting evidence, and their dependencies across the run. The diagnosis must locate the first divergence and identify whether the prompt, tool, workflow, memory, or orchestration caused it. Flattening execution into one failure event breaks that chain, leaving a symptom where engineers need a repair target.
Why collapsing a multi-step agent run into one failure event is a structural problem, not a logging gap
Detecting a failed agent run is easier than locating its origin. Agent pipelines accumulate state, so a corrupted belief, misread tool response, or wrong intermediate conclusion can shape later decisions without producing an immediate error. A workflow may even finish and return output that looks right before its effects reveal the mistake. The terminal status therefore describes an outcome whose cause may lie in an earlier event.
An application performance monitoring view that treats the agent as a black box loses this distinction. It records whether execution succeeded or failed but leaves out the links between steps needed for attribution. More records alone do not repair that omission. If those records describe execution boundaries but omit how one decision conditioned another, the engineer still cannot distinguish the originating error from its downstream effects.
TelemetrySuffBench, by Zhu & Pu in 2026, measures this separation directly. Its trace views that work with observability and inference tracing formats keep failure detection near-perfect, but origin-step accuracy is at most 0.5%. These results measure performance in a controlled benchmark, with findings limited to the tested trace views. They nevertheless establish a precise limitation. A trace can reveal that execution went wrong while withholding the evidence needed to locate where it first departed from the intended path.
How the six agent-specific failure modes are erased when platforms report only the terminal event
The loss becomes clearer across six agent-specific failure modes, including tool misuse, context loss across turns, goal drift, retry loops, cascading errors in multi-agent systems, and silent quality degradation. Their origins differ, so their diagnostic signals differ. Tool misuse may begin with a malformed argument at step 2 that corrupts subsequent work dependent on its output. Context loss instead produces a turn that looks reasonable alone but contradicts information supplied earlier. A terminal event cannot preserve either distinction by reporting only a bad result.
Goal drift makes the problem especially difficult to isolate. Consider a request to schedule a meeting next week but avoid Friday. At step 4, the agent encounters a scheduling conflict, over-weights it, and reinterprets the original constraint. By step 8, it schedules the meeting for the following month. No individual operation needs to fail for the trajectory to abandon the user's objective. Final-answer scoring may flag the outcome, but it cannot show how the earlier conflict took the place of the original request.
Retry loops leave a different pattern as the run unfolds. Repeated tool calls, repeated edits to the same file, or verbose reasoning without progress can end in a timeout or empty return. Cascading errors and silent quality degradation likewise separate the originating defect from its visible symptom, although the relevant evidence may cross agent boundaries or show deterioration without an exception. Flattening these patterns encourages the wrong repair. A timeout increase does not resolve a workflow loop, and a model upgrade does not correct a defective prompt.
What telemetry actually needs to carry for origin-step localization to be possible
Origin-step localization depends on decision content and provenance. The trace must preserve what was decided and connect that decision to the evidence on which it depended. Span start and end times and status can describe execution without explaining it. Tool responses, memory retrievals, and prior turns help with attribution when the trace keeps a clear link between them and a later decision. Otherwise, the trace contains fragments that an engineer must try to reconnect manually.
A delayed selection error illustrates the distinction. A model may select a symbolic reference, a registry may bind it to a concrete object, and a later component may activate that object correctly. The activation is not the originating defect. The selection was wrong, even though the later components executed it as instructed. A representation that preserves the activation but loses the selection and its provenance misdirects the investigation toward the component that exposed the problem.
Removing decision content reduces origin-step accuracy to zero for every model tested, while removing provenance produces large, model-dependent losses. Detection remains high throughout those ablations. Compliance with a telemetry standard therefore does not, by itself, establish diagnostic sufficiency when that standard does not require decision content or provenance linkage. The missing fields are not optional detail for this task.
Insufficient evidence also changes what a diagnosis should claim. Without abstention safeguards, an attribution system can confidently label a downstream symptom as the origin. Engineers should audit each step's recorded decisions and evidence links, rather than treating a complete set of spans as proof that root cause analysis is possible.
How do engineers pinpoint which harness layer caused a production failure?
A step identifies where execution diverged, but a harness layer identifies what needs to change. The harness is the operational environment around the model, including the system prompt, tool description, tool implementation, middleware, skill, sub-agent configuration, and long-term memory. These are distinct failure surfaces. Attribution becomes actionable when it maps the originating step to the responsible prompt, tool, workflow, memory, or orchestration layer.
Tool schema drift and prompt ambiguity show why this distinction is necessary. Schema drift can corrupt outputs without raising an exception, so the agent seems to work normally until the corruption is visible in its output. Prompt ambiguity can produce a similar outcome because the instruction does not establish clearly what the model should do. The symptoms can look alike. Yet the former calls for an updated tool interface, while the latter calls for an edited system prompt.
Workflow defects require a broader view still. The same or similar tool calls invoked three or more times in a row, repeated edits, and reasoning without progress form a trajectory-level signature of a loop. A single call does not establish that pattern. Fixing it requires a change to orchestration logic beyond simply correcting the final failed step. Layer attribution therefore refines localization into a repair decision by connecting the observed divergence to the part of the harness that governs it.
What trajectory-level, layer-aware diagnosis looks like in practice
AgentDebugX, by Zhu et al. in 2026, organizes debugging into a closed loop of Detect, Attribute, Recover, and Rerun, with its DeepDebug component using global trajectory understanding, structure-guided investigation, and cross-examination. On the Who and When benchmark, DeepDebug reaches 28.8% exact agent-and-step attribution accuracy on qwen3.5-9b, above the strongest single-pass baseline. The result supports investigating relationships across the run instead of scoring each step independently, while its agent-and-step metric should not be mistaken for a measurement of every harness-layer distinction.
Cai et al.'s 2026 microservice failure diagnosis benchmark, using AIOps2025 and RCA100, evaluates Localization, Identification, and Reason, separating fault location, fault type, and evidence-grounded reasoning. It shows why a correct final answer can misrepresent diagnostic capability when keyword matching, rather than relevant evidence, produces that answer. The controlled RCA reasoning study adds to this finding with its taxonomy of 16 common reasoning failures, showing that failures in the reasoning along the way predict whether the final answer is correct.
Together, these cases support a workflow that keeps the execution history in scope and examines the reasoning connecting evidence to attribution. Model-driven investigation can interrogate that history rather than rely only on fixed rules over isolated events. The engineering requirement goes beyond displaying a trace. Its output needs to be a structured diagnosis that connects an originating decision to a responsible layer and gives the repair a basis in evidence. Handing an engineer a scrubbed trace to reconstruct manually leaves that essential work outside the diagnostic process.
Why replay-based validation against real traces is the only way to confirm a harness fix without introducing regressions
A proposed harness fix remains a hypothesis until it is tested against the failure path. A held-out pass/fail evaluation can be green even when a trajectory includes three turns of off-policy drift. An evaluation that never tests the production path cannot show whether the proposed change fixes that path or just improves a different case. It can also miss a regression introduced elsewhere in execution.
Replay turns captured production evidence into a repeatable test. The agent's logic runs against recorded inputs and tool outputs, so the test can check how it behaves, including its tool calls and their results. Using recorded responses in place of live API calls can avoid side effects. This removes the need to hope that a live run reproduces the original behavior before a repair can be assessed.
The production loop begins with a failed session that a domain expert labels and annotates with expected behavior. The failure is grouped into a signal, an evaluation case is generated from the real conversation flow, and that case enters the pre-deployment regression suite. Production traffic thus adds more and more cases to the test dataset. Edge cases become tests against which later harness changes can be assessed.
The objection to this approach is substantial. Harnesses grown through accumulated patches can become as opaque as the models they surround, and static rules do not learn the runtime policy governing which information and actions should pass through each step. More changes are not automatically better engineering. The response is structured validation, with reviewable changes and replay-based regression suites that expose their effects. Replay cannot promise the absence of every future regression, but it makes repair claims testable against the real paths that justified them.
What engineers should demand from observability tooling to make layer-specific attribution possible
Engineers should assess observability tooling by whether it supports evidence-backed attribution without manual reconstruction. A platform should expose the decision content and provenance links needed to follow a decision back through tool responses, memory retrievals, and prior turns. Trajectory-level queries should make those dependencies inspectable across the run, rather than constrain investigation to individual spans. Span coverage is not the acceptance criterion. The test is whether the representation preserves enough evidence to distinguish the first divergence from the later event that reveals it.
Attribution output should then name both the origin step and the responsible harness layer. A finding of prompt ambiguity should be distinguishable from a broken tool interface or a looping workflow, with evidence supporting that distinction. When the evidence is insufficient, the system should abstain. Engineers should also require proposed fixes to be reviewable and replayable against real traces before deployment, rather than auto-applied or accepted solely because synthetic benchmarks improve.
Can the platform identify which harness layer caused a failure from evidence in the trace, or does it report only that the run failed? Standards compatibility, trace display, and detection performance do not answer that question on their own. The required discipline is the same one applied to code changes, with an evidence-backed diagnosis, a reviewable repair, and regression tests built from actual failures.
Sources
- TelemetrySuffBench: Is Agent Telemetry Sufficient for Failure-Origin Diagnosis?
- A Multi-Dataset Benchmark for Evaluating LLM Agents in Microservice Failure Diagnosis
- Stalled, Biased, and Confused: Uncovering Reasoning Failures in LLMs for Cloud-Based Root Cause Analysis
- [2607.18754v1] AgentDebugX: An Open-Source Toolkit for Failure Observability, Attribution, and Recovery in LLM Agents
- Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures
- What Resolve Rate Hides: Trajectory Structure Diagnostics for Coding Agents
- Chronicle: Cut-Point Replay for Regression Testing of LLM Agents Tisha Chawla*
- From Failed Trajectories to Reliable LLM Agents: Diagnosing and Repairing Harness Flaws


