Production Learning Review

Reading Prompt Versus Tool Failure as Distinct Production Learning Signals

Distinguishing prompt from tool failures sharpens what to fix in production agents.

· 8 min read
Cover illustration for “Reading Prompt Versus Tool Failure as Distinct Production Learning Signals”
Production Signal Theory · November 6, 2026 · 8 min read · 1,860 words

AI agent failure attribution by harness layer requires separating instruction and context failures from tool-integration failures. Production traces reveal the difference through the instructions the model received, the calls it made, the results it consumed, and its next actions. Reading prompt versus tool failure as distinct production learning signals enables targeted improvement after an “agent failure.

Why treating agent failures as one category misdirects improvement effort

In controlled demos, tools respond correctly and the task stays narrow, which hides the differences between failure classes. Production removes those protections. The same prompt can produce different tool selections and reasoning paths across runs, while a small early error can compound into a wrong answer without raising an exception. A failure that cannot be reproduced in a test environment is therefore especially difficult to attribute.

A bad answer, stalled task, or empty response may reflect what the model was told to do or what its tools supplied. Treating those outcomes as one category pollutes the signal because it groups incidents that require different repairs. A system-prompt patch cannot fix a broken tool contract, and fixing a tool cannot clear up an ambiguous task boundary.

Uptime, latency, and error rates describe whether services responded. A run that looks healthy may still hold evidence of failure. Engineers must recover that evidence before choosing an intervention.

How do production traces pinpoint which layer caused the failure?

Fault localization and failure attribution answer different questions. Localization identifies the root-cause step, while attribution identifies the failure category. A production trace provides the event tree needed for both, including model calls, tool calls, reasoning steps, and errors. Without that record, the final answer leaves too much of the causal chain hidden.

The difficulty is that origin and symptom can be far apart. A malformed tool output at step two may not produce a detectable failure until step seven. Intermediate reasoning can bury the connection while making the final response appear to be an isolated model mistake. Reconstructing that connection requires the tool name, parameters, returned payload, and evidence of how the return shaped the next step.

AgentScope, introduced by Bi et al., uses a Reasoning-Action Graph to show how an agent reasons and carries out actions. Its neural invariants provide correctness conditions that require LLM-guided reasoning to check against that structure. Structure changes what the diagnosis can establish. AgentScope’s 2026 analysis reports that the best-performing model tested in sole LLM-as-judge attribution achieves 18.15% accuracy, reflecting difficulty tracking multi-step causes and consistent invariants. Its neuro-symbolic approach significantly outperforms the current art in both localization and attribution on publicly available agent failure datasets.

The taxonomy that separates prompt failures from tool failures as distinct categories

Raj et al.’s taxonomy localizes failures to the interactions where they originate and identifies the responsible component. Model-side failures identify targets for post-training, while harness-side failures point to scaffolding and tool-integration changes. Environment or grader failures instead indicate evaluation conditions requiring redesign. The responsible component determines the class of intervention.

Prompt and tool failures must be separated within that broader framework, rather than equating every prompt-following mistake with a model defect. An ignored instruction illustrates the distinction. The model may have received the instruction and failed to follow it, or the harness may have dropped it during context compaction. Those cases look the same in the final answer, but the trajectory holds different evidence for each.

The taxonomy makes this distinction more than a naming exercise. Its strongest LLM judge reaches substantial agreement with human category labels, with Cohen’s κ=0.76. That result suggests the categories reflect patterns that annotators share more than the preferences of any one annotator. It does not eliminate the need to reconstruct causality. AgentScope applies a related principle by checking behavioral properties within the trajectory, so that the diagnosis identifies both where a failure occurred and what kind of failure it was.

What prompt failures look like in traces and why their signal is diffuse

Prompt failures often degrade quality without producing a discrete error. In a pure-text agent, imperfect instructions may still yield a usable trajectory, making the weakness visible only across multiple runs. Individual steps can look plausible in isolation. The trace may show required actions deferred, steps completed in the wrong order, insufficient specificity, or missed opportunities to iterate.

Goal Drift creates a related but distinct pattern. Accumulated context shifts the operative objective away from the original goal, while context compaction can make the result resemble a prompt-following failure. No exception identifies the lost objective. Attribution therefore depends on the context available at the relevant step.

After a system-prompt update, nothing may break right away, but output quality can fall over days while the agent keeps completing runs. When failures remain consistent across different tool-call patterns but correlate with prompt-version boundaries, the prompt layer is the likely origin.

The next step is to use statistical analysis of traces to check the quality of results against the original intent. Prompt versions need to be treated as deployable infrastructure with rollback capability. This evidence supports changes to instruction specificity, task boundaries, iteration triggers, or output structure.

What tool failures look like in traces and why they are acutely dangerous

Tool failures more often show which integration boundary has failed. Schema violations occur when argument types or key names are wrong, or required fields are missing. A rejected call may lead to blind retries, while a silently misinterpreted call may let the agent proceed on a null response. Schema drift creates this risk when the expected inputs change and the agent is not told.

A description mismatch produces a different signature from a schema mismatch. The latter can raise a runtime error, while the former changes when the model selects a tool without violating its input contract. A clean trace can therefore be misleading. The detection signal is a shift in each tool’s selection frequency across a deployment boundary, compared with its own history and keyed to a hash of the registered description text.

A hallucinated invocation attempts to call a tool outside the registered set, making the missing handler the diagnostic evidence. Missing exit conditions can produce repeated calls to a broken tool until token budgets are exhausted, or paralysis in which no output appears.

A malformed result becomes the next step’s input, and the model reasons over it without knowing it is defective. By the final response, the original fault may be several layers deep. Silent failures are especially dangerous because they can supply apparent evidence for claims the tool never supported.

Fabrication after tool failure as the clearest diagnostic signal in the trace

Sethi et al. isolate a particularly clear sequence. The call is well formed, the tool is reached, and the returned payload supplies nothing usable. The model then either reports the failure honestly or asserts an answer the payload cannot support. In this sequence, fabrication shows that the tool-result boundary has failed, beyond any lack of clarity in the task wording.

The response envelope governs much of that behavior. Sethi et al.’s 2026 study finds almost no dishonesty when the tool returns a clear error status. When a success status accompanies a redacted, corrupted, stale, malformed, empty, or truncated value, fabrication reaches 45.3%. The model treats the unusable payload as valid ground truth.

The study finds this behavior with the prompt that ships with every production agent framework it tested. None of the nine frameworks audited specifies what the model should do when a tool fails. Trace signatures include newly invented values, repetition of corrupted or redacted content as fact, and interpretation of missing data as zero or “none.” Matching the assertion against the returned payload and the tool’s declared capability makes the unsupported claim visible.

The intervention targets the handling of that boundary. Adding a single sentence to the prompt that requires an explicit retrieval status flag before answering cuts fabrication by an order of magnitude, and the same sentence works unchanged in multiple foreign agent scaffolds. This does not make the incident an ordinary prompt-ambiguity failure. The trigger is an unusable tool return presented as success, and the remedy is a reviewable change to the prompt envelope.

Diagram: When 'Success' Lies: How Tool Response Status Drives Fabrication. Visualizes: Show a stark before/after or two-condition contrast between two tool-return scenarios and their fabrication rates.

How Outcome Monitors and contract-based detection make tool failure traces actionable

Panthi and Abdelfattah’s Outcome Monitors address the return boundary through deterministic detection. Their outcome contracts specify expected relationships between calls and results, using invariants mined from nominal executions or derived from public schemas. These checks assess what the tool returned. They can identify a silent failure before the model consumes it as unqualified evidence.

This operates at a different layer from the retrieval-status instruction. The instruction governs how the model responds when usable evidence is missing, while the monitor checks the returned result for a contract violation. The two mechanisms complement each other: one gives the model a reporting obligation, and the other supplies an infrastructure-level detection signal.

On a violation, the monitor preserves the result and appends an advisory receipt naming the violated property and available recovery tools. It neither restricts actions nor selects a repair. Detection remains separate from recovery, leaving the language agent to choose its next action. The controls identify the recovery-tool list as the active receipt content. Removing that list eliminates the measured completion gain, while changes to diagnostic detail or timing produce no detectable difference.

Panthi and Abdelfattah’s 2026 research reports detection falling to 46% outside the mined vocabulary, leaving broader detection an open problem. ToolMaze, introduced by Zhu et al., supplies a benchmark for distinguishing systematic replanning from blind trial-and-error under tool failures. This complements contract detection by testing whether an agent can recover from a fault once it encounters one.

Why each failure class demands a different intervention and what that means for harness engineering

Tool failures call for schema validation before a call is dispatched, contracts on returned values, a prompt envelope that explicitly names failure states, and checks for tool-selection shifts across deployments. The fix must target the demonstrated mechanism, even when the changed artifact is a prompt in both cases.

The Co-Harness framework formalizes attribution before repair. Its LLM-based HarnessCritic assigns failed trajectories to structured harness-level causes, including prompt ambiguity, tool schema error, missing skill, middleware mismatch, or memory overflow. Only then is a fix generated for the attributed layer. This ordering makes the proposed change inspectable against a stated cause rather than treating any improved answer as proof of a sound diagnosis.

Validation must then return to the production evidence. A prompt repair that succeeds in isolation may conceal a co-occurring tool fault or introduce a regression on another workflow path. Failed production traces therefore become evaluation cases against which changes are tested before deployment. Replay validation connects the proposed intervention to the failure it is supposed to correct.

That connection is what makes improvement repeatable. A prompt edit and a schema contract can each be reviewed against an attributed cause, while an opaque repair that patches both layers at once breaks the learning loop. Over time, the trace-to-dataset process builds a library of attributed failures and tested interventions. The lasting value is not simply a repaired run, but a body of evidence the team can use to recognize and correct the next failure systematically.

Sources

  1. Fabrication After Tool Failure: Tool-Augmented Agents Assert Values Their Tools Did Not Return
  2. Diagnosing with Insights: Structured Analysis of Agent Failures via Behavioral Abstractions
  3. Outcome Monitors: Recovery Affordances for Silent Tool Failures
  4. When Tools Fail: Benchmarking Dynamic Replanning and Anomaly Recovery in LLM Agents
  5. Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures

More in Production Signal Theory