Est.

Distinguishing Model Errors From Tool Errors in Agent Traces

Follow the trace span by span to find where a failure began.

· 9 min read · Updated
Cover illustration for “Distinguishing Model Errors From Tool Errors in Agent Traces”
Behavior-Based Alerting · October 21, 2026 · 9 min read · 2,072 words

Distinguishing model errors from tool errors in agent traces requires locating the origin of a failure. A wrong answer can result from either side of the interaction, and each side requires a different repair. The practical discipline is to follow the trace through its component boundaries, assign fault where the evidence places it, and only then choose a fix.

Why the same trace symptom can mean two opposite problems

A failing trace ends with a wrong answer, but the engineer reading it still does not know where to look. The model may have ignored valid information, or the surrounding system may never have supplied it.

Scale AI’s Model or Harness? illustrates this ambiguity with a long-running Claude Code session in which an agent ignores an earlier user instruction. If harness context compaction removed the instruction, the repair belongs in the harness. If the instruction remained available and the model disregarded it, the intervention belongs at the model level. Changing the model cannot repair an instruction removed from its context.

The same ambiguity appears when an agent calls a tool with slightly wrong parameters, receives a result, and continues as though the call succeeded. Later steps make the first error worse, but there may be no single log line that marks a failure. A label based on the outcome can send engineers toward model post-training, harness engineering, environment redesign, or benchmark repair without showing which change could fix the cause.

How the interaction-centric model divides fault sides

Model or Harness? treats interactions between components as the unit of analysis. Each failure receives an edge identifying the interaction where it arose and a fault side identifying where the repair belongs. These are separate judgments. A model-to-tool failure names the boundary under examination, but it does not establish whether the model supplied bad arguments or the tool supplied a bad schema, timed out, or returned the wrong data.

The component vocabulary keeps those judgments precise. Model means the LLM policy, and Context means the information it has during the current interaction. Memory is a persistent store across sessions, and Tool is the bidirectional interface for actions and observations. Local env covers the OS, shell, and filesystem, while External env covers remote services, APIs, and databases. The other components are Owner, Grader, and Third party.

The taxonomy organizes 41 failure modes through this edge-plus-fault-side structure. Model-side failures call for post-training or prompting, while harness-side failures call for changes to scaffolding and tool-integration. Because the framework describes interactions rather than one architecture, it applies to coding assistants, long-horizon personal assistants, and multi-agent systems. But the framework is useful only if engineers can link those distinctions to evidence in a trace.

The four tool-use failure modes and what each looks like in a trace

ToolFailBench defines four tool-use failure modes that separate the need for a call from how faithfully the model used its result. Models with much the same aggregate scores can make different kinds of errors in these areas. A single pass rate conceals that difference and therefore gives little guidance about the repair. The four labels provide a more useful naming system for reading traces.

Tool-Skip (TS) means the model does not produce a valid executed tool call when one was required. Unnecessary-Tool-Use (UTU) is the inverse, in which the model invokes a tool even though the task could and should be answered directly. Both are model-side faults in deciding whether and when to call.

Result-Ignore (RI) occurs after the model calls the tool but fails to use the returned data. The tool span contains a successful return, yet the next generation proceeds from prior knowledge or fabrication. Output-Fabrication (OF) also follows a call, but the model adds invented structured information, including fields or values absent from the return. Both are model-side failures after a structurally correct interaction. The tool did its job, but the model failed to integrate its output faithfully.

ToolFailBench uses a “parametric trap” in which mock tool returns contradict what a model would likely guess from memory. If the model ignores such a return and follows its memorized prior, the failure is RI. The diagnostic payoff is to assign responsibility from the relationship between the return and the next generation.

How tool-infrastructure faults produce traces that look like model errors

Infrastructure faults can leave a model that seems to act correctly working with information that is missing or invalid. MCP schema drift is one example. Agents read MCP server config and tool schemas at startup and cache them, retaining the cached schema absent a listChanged notification or TTL expiry. When a server is upgraded mid-session, the agent can continue calling the old schema. Calls may cause a schema mismatch or return a 200 OK with wrong-shaped arguments, so an integration fault can look as though the model generated the wrong arguments.

Silent egress failure hides the cause further back in the chain. In the supplied case, a network policy change in a lower environment blocked outbound traffic from the MCP server to a cloud provider’s API. The server had no health check endpoint, so the deployment remained green. The agent received empty tool responses, interpreted them as “no resources found,” and told users they had no cloud projects. Its confident answer looked like a reasoning error even though the missing data originated in the network path.

Context compaction illustrates a related mechanism outside tool execution. Instead of invalidating a schema or blocking a response, the harness removes information the model needed to obey. The model then breaks an instruction in a way that can look as though it ignored guidance it still had. Across these cases, fluent output is not evidence that upstream interactions were sound. Diagnosis depends on whether the model misused valid information or rationalized information that was missing, stale, or wrong-shaped.

Reading a trace to assign fault side: a step-by-step span walk

Begin with the input and follow the span tree through plan, retrieval, tool args, tool output, LLM rewrite, and final answer. The input establishes what the task required, while the later spans show what information and actions supported the response. Each transition is a possible point of origin. The goal is not to find the most conspicuous anomaly but to locate where the execution first departed from the required behavior.

At the plan span, compare the emitted tool sequence with the task. Choosing the wrong tool, skipping a step, or showing a plan-vs-execute divergence points to a model-side planning fault. In that case, the intended tool never had a chance to succeed or fail. Continue through retrieval so that the information available before argument generation remains part of the causal chain. A later answer cannot be judged independently of what reached the model.

At the tool-args span, compare the arguments with the schema available at call time. Malformed arguments against a correct, available schema point to the model. Arguments generated against a stale cached schema instead point toward the harness or environment. Then inspect the tool-output span for returned data, latency, and status codes. An empty or wrong-shaped return requires examining that boundary, and a timeout or network error establishes an infrastructure fault even if the next generation looks like faulty reasoning.

At the LLM-rewrite span, score faithfulness against the upstream tool output. This comparison asks whether the generation reflects the evidence actually returned, rather than whether the final answer sounds plausible. A threshold around 0.85 is a workable starting point for identifying unfaithful generations. Low faithfulness with a populated, valid return points toward RI or OF, while an empty return requires tracing the missing evidence back to its cause. The score supports localization only when read with the tool-output span.

Finally, carry the assignment forward to the final answer without confusing the downstream symptom with the origin. In multi-agent systems, apply the same walk at each agent boundary. A subagent’s output becomes the next agent’s tool-output span. A fabrication in step 2 can corrupt later work and appear as a reasoning failure at step 8, so the final failing agent is not necessarily the source.

Why traditional logging cannot perform this localization

Standard event logs record discrete outcomes rather than the causal chains needed for fault-side assignment. Agent behavior is non-deterministic, so the tools called and their order can change with model temperature, retrieved context, or prior memory state, even when the prompt stays the same. A “tool call failed” entry does not distinguish an incorrect request from an incorrect return or an environment that prevented any return. It records a symptom without preserving the interaction needed to explain it.

The egress case exposes this gap. The only signal in the agent logs was “tool call failed,” with no per-tool latency metrics, health check endpoint, or alerting. The deployment stayed green for two days while the agent silently told users they had no cloud projects. Deployment status and a generic failure entry therefore could not explain why the application produced empty answers.

Structured trace data supplies high-cardinality span trees that can be filtered by tool version, model version, schema version, or user segment. Those dimensions make it possible to ask whether a failure correlates with a model update, tool deployment, or network change. Correlation helps locate the relevant evidence. The interaction-centric taxonomy becomes actionable only when each edge has its own recorded span. Without that structure, the boundary where responsibility changes is invisible.

How automated fault localization benchmarks reveal the limits of LLM-as-judge approaches

Automated localization is a useful counterpoint to this framework because assigning fault from a trace is itself difficult. Model or Harness? tested how well four frontier models could act as judges and recover the fault-side labels that humans had assigned. The strongest reached Cohen’s κ = 0.76 against human category labels. That agreement suggests the taxonomy captures shared structure. It does not establish the reliability needed to delegate production localization entirely to a judge.

TRAIL supplies 148 human-annotated agent traces with 841 labeled errors across GAIA and SWE-Bench Lite. It evaluates category F1, location accuracy, and joint accuracy, separating recognition of an error type from identification of its location. Its results show that state-of-the-art LLMs remain unreliable at automatically identifying and diagnosing agent failures. A system can therefore recognize the general kind of failure without reliably locating the interaction that caused it. Automated LLM-as-judge localization remains an open problem.

Coding benchmarks can combine the model, harness, context, execution environment, and feedback signals into one score, obscuring what actually improved after a change. Automated localization can assist engineers, but it cannot replace explicit span-level instrumentation and a human-readable taxonomy. An engineer who understands the fault-side framework can check or correct a judge’s assignment.

Turning fault localization into a fix workflow rather than a postmortem

Fault-side assignment is the decision gate into the repair workflow. For a model-side fault, the available interventions include prompt revision, system-prompt tightening with explicit termination conditions, fine-tuning or post-training, and a model swap. Evals should reproduce the specific failure mode, such as TS, RI, or OF, so the proposed repair can be regression-tested before redeployment. The test must preserve the distinction that justified the intervention. Otherwise, an improved aggregate result can leave the original failure unresolved.

For a harness or tool-side fault, the repair instead belongs in the scaffolding. Depending on the localized cause, that can mean schema correction, retry policy, a circuit breaker, timeout configuration, a health check endpoint, or environment isolation. These changes do not touch the model and should not require model redeployment. A model intervention is not a substitute for repairing an unavailable service or stale interface.

The five-category taxonomy also links incidents to a fix surface. Planning errors map to the planner-prompt, tool errors to a schema guard and retry policy, and retrieval errors to the retriever rubric. Reasoning errors call for work on the generator rubric, while safety/policy violations call for an output scanner. Conflating them sends patches toward the wrong mechanism.

The workflow closes when the localized failure becomes a labeled trace that the next deployment must clear. Naming the failure category tells the regression test what behavior to look for. Continuous localization audits traces against what the agent was supposed to do. That catches fault patterns before they accumulate into incidents, while reactive investigation yields the same information later at greater cost. The purpose of reading a trace is therefore not just to explain a wrong answer, but to direct the next change to the component that can prevent it.

Sources

  1. Model or Harness? An Interaction-Centric Taxonomy forLocalizing Agent Failures
  2. ToolFailBench: Diagnosing Tool-Use Failures in LLM Agents
  3. Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures

More in Behavior-Based Alerting