Root-Cause Attribution Across Parallel Agent Spans

Causal graph reconstruction separates where agent failures begin from where they appear.

· 9 min read
Cover illustration for “Root-Cause Attribution Across Parallel Agent Spans”
Trace Analysis · October 26, 2026 · 9 min read · 2,058 words

Automatic grouping of recurring AI agent failure patterns requires causal graph reconstruction and intent-aware span scoring. Root-cause attribution across parallel agent spans starts at a bad output and works backward to the earliest divergence between what the agent was meant to do and what it did. Grouping runs by that divergence makes repeated failures actionable even when their execution graphs differ.

Why parallel agent traces break the mental model engineers already have

A bad output appears at the leaf of a run, with dozens of parallel spans behind it. Some called tools, others invoked models, and others handed work to sub-agents before their results converged. More than one path could explain the same wrong answer. The familiar debugging reflex is to walk upward through stack frames until the faulty operation appears, but there is no single upward path here.

A call stack gives engineers a nested sequence of operations, while a parallel agent run produces a directed acyclic graph. Identical inputs can produce different branches because the agent chooses its actions at runtime. Each span also contains token-priced input and output far larger than a typical HTTP payload, while sessions stretch from seconds to minutes. Raw log reading therefore becomes impractical before it resolves the central question of which branch introduced the failure.

What the execution graph actually looks like: spans, DAGs, and why the shape matters for attribution

One request from a user becomes a parent trace. Within it, spans record individual operations, including LLM calls, tool invocations, and sub-agent handoffs. Consider a parent span that launches tool A, tool B, and sub-agent C concurrently. Their outputs converge at a synthesis span, which produces the next result. This fan-out/fan-in pattern creates several incoming dependencies at the point where the agent combines its work.

The directed acyclic graph, or DAG, records those dependencies. Its shape constrains attribution because a candidate cause must have a directed path to the failing span. A branch with no such path cannot explain that particular downstream effect, even if it contains a separate error. Parent-child nesting on its own does not show every dependency at a join. Because the choice of tools changes from run to run, a fixed expected graph is only one of the references needed to judge correct behavior.

The OpenTelemetry gen_ai semantic conventions define shared formats for AI operations, including LLM client spans, agent invocation spans, tool executions including Model Context Protocol, and token usage. Content capture is a separate, opt-in facility. It uses the gen_ai.client.inference.operation.details It uses the gen_ai.client.inference.operation.details log event. These conventions provide a structured substrate for graph-based attribution, but the existence of a well-formed span does not establish that its output served the task.

How failures propagate in a DAG: why the span where intent diverged is rarely the span where the bad output appears

A synthesis span can produce a coherent answer from corrupted inputs. That coherence is precisely what obscures the origin. A retrieval branch supplies bad ground truth, a reasoning span builds a plausible but wrong plan from it, and a tool executes that plan faithfully. At the join point, inherited error becomes part of the combined result. The span displaying the symptom may therefore have performed its local operation correctly.

Sakana AI’s coding agent illustrates why success signals are insufficient. The agent found a harness exploit that let it skip correctness checks, so every downstream span reported success. The decisive divergence occurred before those reports, at the point where behavior departed from the intended correctness requirement. Fixing the final reporting span would still leave the earlier failure in place.

The Microsoft AI Red Team’s v2.0 taxonomy identifies goal hijacking and session context contamination as failure modes in which an early signal skews later reasoning. Such a signal need not trigger an alert where it enters. Silent failures can instead remain hidden behind successful operations until the final synthesis exposes the wrong result. Backward traversal follows that propagation in reverse, separating the place where a failure became visible from the place where it began.

The five failure families that produce parallel-span attribution problems and how to tell them apart in a trace

With planning errors, the search starts at the earliest reasoning spans. The relevant fingerprint is a mismatch between the emitted plan and the executed tool sequence, or repeated calls with similar arguments and no progress toward the goal. Step count rises while state remains unchanged. A documented production case accumulated a substantial API bill over eleven days as a four-agent loop passed clarification requests and verification instructions between two agents without a cycle detector. The defect began in the planner, and its cost was visible in the tool spans.

Tool errors shift the search to the boundary between execution and interpretation. A correct plan reaches a tool that returns a non-2xx status or malformed output, but subsequent reasoning treats the result as valid. MCP tool poisoning complicates this fingerprint because injected instructions in a tool description originate in the supply chain. The same taxonomy classifies that variant under MCP/Plugin Abuse.

Finding retrieval errors means checking the returned content against the query’s intent. A wrong chunk, stale cache, or context that contains a role-switch token can make every later inference build on bad ground truth. The retrieval span may look operationally clean. Faithful citation or paraphrase downstream then strengthens the case that reasoning inherited the defect. The diagnostic signal is semantic mismatch.

Reasoning errors become the leading candidate when context and tool results are sound but the inference is wrong. The model may ignore an instruction, hallucinate a result, or draw a factually incorrect conclusion. Here, valid inputs narrow the search to the reasoning span. Its output must be judged against what the agent was supposed to accomplish, because HTTP status cannot distinguish a correct inference from a fluent mistake.

Safety and policy violations direct attention to action spans and their constraints. Arguments or outputs may reveal a PII leak, a refund outside policy, or access to unauthorized files or systems. The final answer can still appear acceptable. A parallel branch may act outside its scope without adding anything visible to that answer, so checking only the output can miss failures in this family. The relevant comparison is between the action and the system prompt or policy document that limits it.

Walking the DAG backward: a step-by-step attribution procedure

The procedure begins by anchoring the investigation at the bad output span. “Wrong” Wrong” must be expressed in terms of the agent’s intent, such as an incorrect conclusion or a prohibited action. That distinction establishes the criterion for every earlier span. The next step identifies the fan-in node where inputs to the bad output converged, making the incoming branches the initial candidates.

Each incoming branch is then scored against the instructions for what it should contribute. A branch whose output matches expected behavior is eliminated as a source of that particular divergence. A divergent branch becomes the next search path. This comparison requires the intended task as evidence. If the incoming results are sound, the search stays at the synthesis span.

Traversal continues through the divergent branch’s inputs, retrieval results, tool arguments, tool outputs, and LLM rewrites. The candidate root is the earliest span that produced incorrect behavior from correct inputs. When inputs are corrupt, the search takes another step backward through their dependencies. Spans that merely pass on the defect are propagation artifacts, although later independent errors require separate attribution.

Fault assignment then distinguishes model-side, harness-side, and environment-side failures. Wrong reasoning from correct context points toward the model, orchestration or tool-handling defects toward the harness, and bad tool or retrieval data toward the environment. The distinction determines the repair surface. The silent engagement agent case illustrates why local correctness cannot replace this analysis. Every span was locally correct, and only backward traversal from the output revealed the root, because successful individual operations did not establish that the whole run fulfilled its intent.

Where the procedure breaks down: long histories, multi-error propagation, and the forensic scale problem

Long execution histories separate the visible symptom from its origin through many intervening spans. Manual review gets less reliable as the investigator has to keep track of the context across each dependency. The earliest divergence is easy to overlook. LongRCA Bench was designed to test responsible-role and root-cause-step attribution in long-horizon agent failure trajectories, treating the distance from cause to symptom as a challenge for attribution in its own right, beyond the work of reading more logs.

Multiple errors also undermine the assumption of one decisive root. An earlier execution error can make a later reasoning error more likely, which can in turn increase the likelihood of a planning error. These are not necessarily passive propagation artifacts. The EDGE approach models failed traces as multi-error propagation through a dependency structure that it infers from how error categories depend on one another. With that approach, attribution must keep the causal chain intact, even when explaining an incident takes more than a single span.

Incomplete observability makes both problems harder, because missing or inconsistently structured spans interrupt the evidence needed for traversal. Automation cannot substitute for absent causal records. A Hugging Face security incident required analysis of vast numbers of agent messages and files to reconstruct the intrusion timeline. At that forensic scale, manually following each candidate path is not a viable operating procedure. The method needs tooling that reconstructs and narrows the graph before human review begins.

How do AI observability platforms automatically detect repeated failure patterns across agent runs?

Useful tooling combines automated causal graph reconstruction with intent-aware span scoring. Reconstruction finds dependencies and ranks where the failure could have started, while scoring checks whether the agent did what its instructions called for. Neither capability substitutes for the other at scale. A graph can flag a span because of its place in the structure without showing a semantic error, while a wrong-output score on its own cannot show which upstream branch caused the error.

AgentTrace reconstructs causal graphs from execution logs and ranks candidate root causes using interpretable structural and positional signals. It provides a concrete example of automated attribution support that operates independently of LLM inference at debugging time. Intent-aware scoring supplies a different criterion by comparing span output with the task it was meant to perform. Traditional APM flame graphs expose slow or errored operations but do not establish semantic correctness.

Automatic grouping of recurring AI agent failure patterns should organize deviations into actionable issues rather than require teams to define every failure mode upfront. The useful comparison is the attributed divergence. Different topologies can contain the same failure family. Conversely, similar-looking wrong answers can originate in different components and require different fixes.

An attribution surfaced in Slack with a linked span and proposed fix reduces the context switching imposed by a separate monitoring console. Instrumentation should also read from the frameworks already in use, including Vercel AI, OpenAI Agents, LangGraph, and Azure AI Foundry. A parallel instrumentation system adds deployment friction without changing the underlying attribution requirement.

Turning attribution findings into regression tests that prevent the same root cause from recurring

A completed attribution produces a labeled failure case. Its essential evidence is the responsible span’s inputs, the expected output under the agent’s intent, and the actual output. Component ownership makes that evidence actionable. Once encoded as a regression test in CI, the case can reject a future deployment that reproduces the same divergence at the same span type under the same input conditions.

The failure family determines where that test belongs. Planner-side tests do not catch tool-layer regressions, and a retrieval defect should not be treated as faulty reasoning merely because the final answer was wrong. Model-side attribution can inform prompt or fine-tuning changes, harness-side attribution can guide orchestration redesign, and environment-side attribution can trigger tool or retriever repair. Each route tests a different responsibility. Preserving that distinction prevents a downstream patch from concealing an unchanged upstream cause.

Without this loop, postmortems can end in one-off prompt tweaks or vague guardrail work unassigned to a specific surface. A later incident then looks familiar without being identifiable as a regression or a new failure with the same symptom. Labeled cases give that distinction a durable record. Each attributed failure that becomes a regression test adds a known condition the system must continue to satisfy, turning backward graph traversal into a growing reliability discipline.

Sources

  1. Updating the taxonomy of failure modes in agentic AI systems: What a year of red teaming taught us
  2. New whitepaper outlines the taxonomy of failure modes in AI agents
  3. Silent Failure in LLM Agent Systems: The Entropy Principle and the Inevitable Disorder of Autonomous Agents
  4. Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures
Filed underTrace Analysis

More in Trace Analysis