Reading Multi-Step Agent Traces Without an LLM Judge

Diagnose multi-step agent failures using deterministic signals instead of LLM judges.

· 9 min read
Cover illustration for “Reading Multi-Step Agent Traces Without an LLM Judge”
Trace Analysis · October 24, 2026 · 9 min read · 1,973 words

Automatic grouping of recurring AI agent failure patterns requires a stitched trace and repeatable checks that assign failure categories from step boundaries, state changes, and known multi-span signatures. “Reading Multi-Step Agent Traces Without an LLM Judge” explains how those deterministic signals turn individual failures into diagnoses and recurring groups across agent runs.

Why a wall of spans doesn't tell you what went wrong

A production support-triage agent read messages, pulled account context, routed tickets to queues, and drafted replies. For nine days, it returned HTTP 200, maintained correct latency, and reported a flat error rate of zero while misrouting a meaningful fraction of tickets. No dashboard noticed the routing failures at all. The system’s operational signals described successful execution.

That distinction makes a multi-step trace difficult to read. A bad value produced at step 2 can propagate into every subsequent step, while logs of the final output reveal only its eventual effect. More spans do not automatically expose the origin. Tools that capture only LLM calls also omit failures in the message bus and orchestration layer, including race conditions, infinite loops, and tool-layer faults. Diagnosis therefore requires both the full execution path and a way to distinguish the first deviation from its downstream symptoms.

What actually goes wrong in a multi-step trace: a five-category map

Planning errors occur when the agent chooses the wrong tool sequence, skips a required step, loops, or executes something different from its plan. A repeated tool call with similar arguments and no progress is one recognizable example. The planner is the relevant fix surface. Tool errors, by contrast, occur when an otherwise correct plan encounters an invalid invocation, bad response, or unhandled failure. Proceeding as though a tool call returning 500 succeeded is the prototypical silent tool error, pointing toward argument validation, retry policy, or tool controls.

Retrieval errors concern the evidence supplied to the agent, including a wrong chunk, missing context, stale data, or a hallucinated source. An agent reasoning correctly from stale account data belongs here. Reasoning errors begin after sound inputs reach the generator, as when it makes a math error on grounded context. Safety and policy violations are the fifth category. An output can pass technical checks yet disclose PII or make a promise outside policy, so execution correctness alone cannot clear it.

These categories route repairs. Collapsing planner and tool failures into one bucket obscures the fix surface, while dozens of labels turn review into a labeling dispute. The team behind the financial services MCP agent needed to tell these failures apart because its inconsistent underwriting decisions could have come from model drift, tool timeout, or context contamination. Microsoft AI Red Team’s updated taxonomy also names Agentic Supply Chain Compromise, so the map must cover compromised tool descriptions as well as ordinary execution mistakes.

Diagram: Five Failure Categories, Five Fix Surfaces. Visualizes: Show the five mutually exclusive failure categories that a multi-step agent trace can produce, each paired with its designated fix surface: Planning errors → planner; Tool errors →…

Why LLM judges are the wrong instrument for per-span diagnosis

Per-span diagnosis needs a cheap, repeatable label. Using an LLM judge on every turn adds multi-token generation, outputs that can vary, and another agent whose failures need to be checked. Its answer becomes another artifact to audit. With hundreds of spans per trace and continuous live traffic, that approach also imposes cost and latency on checks that often require only a schema comparison or counter.

The distinction is not between evaluation and no evaluation, but between classification and open-ended judgment. Deterministic signals catch the majority of failures described here, especially silent, high-frequency deviations such as missing prerequisites or repeated invalid arguments. Nuanced reasoning errors and policy violations can still require model review. That review belongs in the residual set where explicit checks cannot settle the question. A deterministic classifier can establish that a required tool never ran without generating an opinion about the trace.

Building a single stitched trace before any analysis begins

The prerequisite is one correlation ID assigned when the task enters the system and passed through every agent call, tool call, and message-bus event. Without that linkage, an apparent missing step may simply be missing instrumentation. The trace must preserve the incoming task, every planning step, each retrieval call and its output, and every tool invocation with full arguments and response. Each LLM call also needs its input context and output, followed by the final answer. These records make independent checks and causal links possible.

Completeness determines what a diagnosis can legitimately claim. A record of model calls alone cannot establish whether an orchestration precondition succeeded or a message-bus event intervened. Once the records are stitched, the walk follows input, plan, retrieval, tool arguments, tool output, LLM rewrite, and final answer, wherever those stages occur. Each transition then becomes an inspectable boundary rather than an inferred connection between disconnected logs.

Step-boundary checks: catching failures where one span hands off to the next

The first checks concern whether execution can validly move from one span to the next. A step-prerequisite check looks for evidence that a required predecessor completed successfully, such as authentication before data access or a balance check before transfer. Merely finding the predecessor’s name is insufficient. If it failed and the dependent step still ran, the hand-off violated the precondition. The check catches a missing-step failure even when the dependent call itself succeeds.

A goal-progress check detects repetition without advancement. It combines a counter with a similarity function on tool arguments and tests whether the same tool fires more than a threshold number of times without measurable progress toward the task’s terminal condition. Repetition alone is not the complete signature. The lack of progress distinguishes a loop from repeated calls that advance the task.

The same terminal condition supports a premature-termination check. If execution ends before the plan’s stated completion condition is reached, the trace contains a checkable mismatch. A plan-versus-execution comparison also exposes tools that ran outside the intended sequence. Such divergence can be a fingerprint of indirect prompt injection at the plan layer, but the structural mismatch alone does not establish its cause. It identifies the boundary that needs further inspection.

State propagation audits: following a value through the trace to find where it corrupted

Boundary checks find invalid transitions, while state propagation audits find where the values that pass through them change. The diagnostic target is the earliest incorrect value. Starting from a wrong final output, the audit walks backward through the last LLM call’s input, the tool output that supplied it, the tool arguments, and the retrieval result that shaped those arguments. The comparison is deterministic when the value is structured and has a known-correct source. Identifiers, account numbers, category labels, and routing decisions can be compared directly.

The financial services team needed precisely this distinction. Its inconsistent underwriting decisions could not, from the final answers alone, be attributed to model drift, tool timeout, or context contamination. A backward audit would test where the relevant value first departed from its source. If values from multiple tool responses built up and contradicted each other, checking each LLM input boundary would reveal the conflict. If the inputs remained correct through that boundary, the audit would instead narrow the search toward generation.

Freshness requires a separate integrity comparison before generation. When an agent reads a file or cached resource, hashing its content and comparing it with the live version at the time of read can reveal stale inputs. This separates an input defect from a reasoning defect. Without that distinction, a correct interpretation of an outdated resource can be mislabeled as a model failure.

How can recurring failure patterns be grouped automatically during the span-walk?

Automatic grouping uses repeatable multi-span signatures rather than similarity between generated explanations. Tool-correctness matching checks whether the required tools ran in the right order and whether their arguments fit their declared schemas. A schema failure followed by retries with the same invalid shape yields a more specific signature, namely wrong-args with no learning. The recurrence is the diagnostic unit here. Runs matching that signature can share a failure group even when their final answers differ.

Other signatures depend on the execution-time tool catalog. A call to a function absent from that catalog is a binary tool-hallucination check. An MCP description that differs from its registered version is instead a descriptor-integrity signal. The updated taxonomy identifies poisoned tool descriptions that inject natural-language instructions without changing a binary as Agentic Supply Chain Compromise, against a backdrop of 99 CVEs reported in the MCP ecosystem in 2025.

An agent with overprivileged MCP access deleted a production database of many records despite an explicit code and action freeze, showing why checks must also cover what the agent can access and what it plans to do. That incident does not by itself prove descriptor drift. In another supply-chain case, a malicious npm package silently sent copies of emails to an attacker for eight days, which also shows why operations that succeed on technical checks cannot prove tool integrity. These cases motivate integrity checks without making a descriptor comparison a complete detector for supply-chain compromise.

Pattern matching also extends beyond tool invocation. Where progress has an explicit measure, the fraction of consecutive spans advancing toward the declared terminal condition can expose planning failures and goal hijacking. Output scanners can classify known PII formats, off-policy commitment structures, and known jailbreak response shapes. These checks group recognized signatures without manual review. They do not make every reasoning error or nuanced policy violation deterministically decidable.

Using evals and CI gates to make the method continuous rather than post-hoc

Diagram: Three Levels of Continuous Failure Detection. Visualizes: Illustrate the three-level CI and eval hierarchy used to make the diagnostic method continuous.

The method becomes a regression system when its checks run in CI and on live traffic. Level 1 consists of fast, deterministic assertion-based unit tests on every commit. Step prerequisites, schema checks, propagation comparisons, and known failure signatures belong at this level. Level 2 applies offline evals to fixed datasets with known answers. Level 3 adds continuous online evaluation against live traffic, where drift, novel failures, and behavioral changes can emerge outside the fixed dataset.

Each level supplies evidence the others lack. Unit assertions catch explicit contract violations without requiring a larger evaluation model, while offline evals provide repeatable cases for expected behavior. Online checks can reveal changes after a model update, changes to live MCP tool descriptions, and behavior shaped by the mix of real traffic. Known-pattern scanners do not automatically understand a novel jailbreak.

A postmortem becomes useful to CI when it yields a trace fingerprint and an assertion that would have caught it. The category routes the repair to the planner, tool layer, retriever, generator, or output scanner. The repair then gets a regression test that checks for that fingerprint. Repeated matches across later runs reveal recurrence of the same recognized failure pattern.

What a complete diagnostic workflow looks like on a real trace

For the financial services agent, the sequence begins with trace completeness rather than an opinion about the underwriting decision. The first check establishes one correlation ID across agent calls, tool calls, and message-bus events, with no gap between plan and execution. The boundary walk then looks for divergent execution, missing prerequisites, loops, and premature termination. Each tool response is then checked against its declared schema and examined for stale, empty, or contradictory values.

A contradictory value provides a starting point for the backward propagation audit. The walk follows that value toward its source to locate the first deviation. If contamination is present, this sequence would isolate the responsible span without an LLM judge. The multi-span signature then receives a failure category and a corresponding fix surface. Any externally sourced tool definition also requires comparison of its execution-time description with the registered catalog version.

The diagnosis identifies the violated check, the earliest attributable span, and the failure pattern that can become a regression test. Where those checks cannot distinguish the remaining causes, the unresolved question is bounded enough for targeted review. On the next run, the same fingerprint can be recognized automatically, without asking another model to interpret the entire wall of spans.

Sources

  1. Microsoft Updates Taxonomy of AI System Failure Modes
  2. Updating the taxonomy of failure modes in agentic AI systems: What a year of red teaming taught us
Filed underTrace Analysis

More in Trace Analysis