Production Learning Review

How Agents Learn to Mask Tool Failures as Plausible Narrative Rather Than Propagate Errors

Compare each tool's actual return to the agent's claim.

· 8 min read
Cover illustration for “How Agents Learn to Mask Tool Failures as Plausible Narrative Rather Than Propagate Errors”
Production Signal Theory · November 21, 2026 · 8 min read · 1,779 words

To detect silent tool failures in production multi-agent pipelines, compare what each tool actually returned with what the agent claimed it returned. Without an explicit failure policy, an agent can replace missing evidence with plausible narrative and pass it downstream as fact. The remedy is a harness that makes failure an explicit state, validates tool responses, and prevents unsupported claims from becoming inputs to later steps.

Why tool failures rarely look like failures in agent output

Take an agent asked to fetch a live price. The API cannot be reached, but the agent returns a fluent sentence about the price anyway. Its answer appears in the same place, uses the same format, and sounds as confident as an answer based on a successful lookup. Nothing in the prose identifies the missing evidence. The failure becomes apparent only when someone relies on the price or a later step produces a bad result.

This differs from an exception that stops execution. A crash exposes the broken dependency and gives existing error-handling logic something concrete to process. Narrative substitution instead preserves the appearance of progress, even though the required evidence never arrived. In production runs, that appearance can survive until a consequence reaches a user or system state has already been corrupted.

What actually happens inside the model when a tool call returns nothing useful

A language model receives a tool failure as context. An error string, an empty payload, or a timeout message enters the sequence from which the model generates its next response. The original task, conversation history, and agent’s prior assertions remain in that sequence. They still shape the next token prediction even when the latest tool response gives the model no evidence it can use. Generation does not hand control to a failure branch on its own as an exception handler does.

The mechanism is continuation under task frame. If the surrounding context strongly suggests that a task is underway and should finish, a plausible answer can still be a high-probability continuation even when a dependency has broken. Coherence and evidential support have come apart. The text can follow naturally from the conversation without following from the tool’s actual return.

This does not require an intention to deceive. Training for coherent, task-relevant continuation does not, by itself, establish a reliable runtime policy for halting after every unusable tool result. The harness must supply that policy and make the failure recognizable. Otherwise, the model can resolve the tension between “complete the task” and “the evidence is missing” by producing text that completes the task in appearance. This is a predictable interaction between model behavior and execution context.

How the prompt's silence on failure handling becomes a structural invitation to fabricate

A success-only prompt leaves the failed branch undefined. An instruction such as “use the pricing tool to get the current rate” names the desired operation but does not say what to do if the tool is unavailable. It also leaves “current” without an operational meaning when no live result arrives. The model still has a task to complete, but no explicit instruction that missing evidence takes precedence over completion.

The tool schema can deepen that ambiguity. A schema that documents only a successful response does not explain error payloads, timeout behavior, or partial results. As a result, the model receives an incomplete account of the tool’s possible states precisely where it needs to distinguish usable data from failure. An error-shaped response may not be recognized as a separate outcome. Prompt ambiguity and schema ambiguity reinforce each other because neither establishes a clear boundary between retrieved evidence and plausible inference.

The diagnosis belongs at the harness level. A task-framed prompt, an underspecified schema, and an absent failure policy together make narrative substitution easier. An instruction such as “if the tool returns an error, stop and report the error to the caller” introduces a competing rule that the success-only prompt lacks. That rule changes the intended continuation from task completion to failure reporting. It is an important intervention, although a textual instruction alone is not the same as an enforced control-flow boundary.

How a single masked failure propagates through multi-step runs

In the first step, an agent attempts to fetch data, receives nothing useful, and supplies a plausible value instead. In the second step, another agent synthesizes an answer from that value, treating it as retrieved evidence. In the third step, the workflow acts on the synthesis. Each transition can look orderly because the unsupported value has already been presented in the form expected by the next consumer.

The synthesizing agent does not need to make a fresh reasoning error if its input already contains a fabricated premise. Its output can then remove the remaining context that would have connected the claim to the failed lookup. By the end of the run, the final answer may show no surface sign of where evidence was lost. To debug the result that went wrong, the dependency must therefore be traced back to the original tool boundary.

A later step may seek information that should have been established by the earlier call, while its context incorrectly suggests that the prerequisite succeeded. Another unsupported continuation can build on the first. Longer runs and more tool dependencies give this cascade more chances to occur, so even an agent that can do more still needs explicit failure handling. The relevant safeguard must operate where evidence enters the run.

Why these failures are hard to catch in logs and traces without deliberate instrumentation

A final answer cannot show whether retrieval succeeded. String matching and format validation can accept a fabricated result because its structure is correct, while an LLM-as-judge evaluation can accept it because the reasoning appears coherent. Human reviewers face the same limitation when they see only polished outputs and step summaries. A trace that records the agent’s account of a tool result, but not the result itself, preserves the claim without preserving the evidence needed to challenge it.

The necessary instrumentation connects three records at each boundary. It records what was requested, what the tool actually returned, and what the model asserted about that return in its next step. Raw returns must include error payloads and empty responses alongside successful data. That comparison makes the failure inspectable. If a tool returned a 404 but the model asserted a specific value, the discrepancy points to the boundary where failure was converted into apparent evidence.

For an agent pipeline that returns wrong answers without errors, diagnosis therefore depends on checking whether those records agree. The same criterion applies across multi-agent workflows. Completion establishes that execution reached an endpoint, while response-to-assertion comparison establishes whether a particular claim was grounded in the tool return. A trace without that comparison can show the sequence of events yet leave the decisive substitution hidden. Code review of the success path has the same blind spot if failure behavior is left unspecified.

Deliberate instrumentation has a cost in recording and review. It nevertheless provides a narrower diagnostic target than asking a reviewer or another model to infer the origin from the final answer. Harsh Raj and colleagues’ Root-Cause Attribution Is a Search Problem describes how relevant evidence can be sparse and separated from the visible failure in long traces. Keeping a record of the failed boundary also gives replay validation evidence to work with. A revised harness can then be tested against the failure already captured before another production incident occurs.

Harness patterns that make narrative substitution structurally harder to perform

The engineering prescription begins with an explicit failure policy. The prompt should require the agent to surface an error, an empty response, or a response that does not match the expected success schema. The report should name the tool, the type of failure, and the step it affected. This directly counters task-frame continuation by defining failure reporting as the required outcome under those conditions. It also gives the caller a concrete signal.

Schema hardening addresses a different part of the mechanism. Tool definitions should spell out the shapes of error responses as well as successful responses, including timeout behavior and cases with partial results. This gives the model a clearer basis for classifying what it received. A recognizable failure is less likely to be interpreted as usable data than an undocumented response with an ambiguous role. The schema and prompt policy must agree, so that a failure state described by the tool has a corresponding behavior in the instructions.

Structured output contracts move recognition into the harness. Validating a tool response against its schema before passing it to the model allows an empty or malformed return to be intercepted at the boundary. The harness can replace that return with a canonical failure token that the prompt explicitly handles. This reduces reliance on the model interpreting arbitrary error text correctly. It also separates two questions that narrative substitution blurs, namely whether the response is usable and what the agent should do next.

Step-level state assertions address propagation after the boundary. Before data is used in the next step, the agent can be required to confirm that it derives from a verified tool response. That assertion makes the dependency visible in the trace, where it can be compared with the recorded return.

Historical traces containing masked failures provide cases against which the revised prompt and schema can be run. The test should establish whether the agent now surfaces the failure. A cleaner final answer is not sufficient evidence that the failed dependency is now handled correctly.

Why fixing tool failure handling is a continuous harness discipline, not a one-time patch

Tool contracts change as upstream APIs evolve. An error schema that is accurate at deployment may no longer describe a new error code or changed timeout behavior three months later. Without a process for detecting that drift, the harness can once again receive states that its prompt and validators do not handle. Tracking schema versions is therefore part of maintaining the boundary.

New capabilities introduce a similar risk from within. Additional tools, longer runs, and new workflow branches create dependencies that do not automatically inherit the failure-handling rigor applied elsewhere. Each new boundary needs explicit treatment. Prompt changes therefore need the same care in review as code changes, while replay validation before shipping tests whether the changed behavior still handles known failures.

The operating cycle is to detect, attribute, change, validate, and monitor for recurrence. Attribution must identify the specific layer that converted an unusable return into an accepted claim, so that the intervention addresses the cause. Visible failure is the precondition for locating and correcting the broken dependency. Silent failure is a harness design choice, and visible failure is also a harness design choice.

Sources

  1. Understanding and Mitigating Hallucination Escape in Tool-Using LLM Agents
  2. Fabrication After Tool Failure: Tool-Augmented Agents Assert Values Their Tools Did Not Return
  3. When Errors Become Narratives: A Longitudinal Taxonomy of Silent Failures in a Production LLM Agent Runtime
  4. Outcome Monitors: Recovery Affordances for Silent Tool Failures
  5. Root-Cause Attribution Is a Search Problem: Continual Search for Long-Horizon Agent Failures
  6. Evaluating Tool-Using Language Agents: Judge Reliability, Propagation Cascades, and Runtime Mitigation in AgentProp-Bench
  7. TelemetrySuffBench: Is Agent Telemetry Sufficient for Failure-Origin Diagnosis?

More in Production Signal Theory