TL;DR
When AI agents receive faulty data from external tools, current robustness methods can flag that something is wrong, but they fail to diagnose what went wrong. This paper introduces a dual-signal diagnostic approach at the tool-return boundary—combining text likelihoods with next-action distributions—to successfully distinguish between incomplete tool outputs and subtle, schema-valid inconsistencies.
What Problem Does This Paper Address?
LLM-based agents (like those using ReAct loops) increasingly rely on external tools to solve complex tasks. However, tools fail in the real world. These failures generally fall into two categories:
- Incomplete responses: Truncated payloads or explicit error messages.
- Inconsistent responses: Well-formed, schema-valid data that is factually incorrect or contradicts the user's intent or previous steps.
To build resilient agents, it isn't enough to just notice a failure; the agent must diagnose the type of failure to choose the correct recovery action (e.g., retrying an incomplete call vs. cross-checking an inconsistent claim against an independent source). Existing methods rely on tracking rising uncertainty (entropy) over an entire episode, which acts as a smoke detector but doesn't pinpoint the fire. This paper tackles the challenge of identifying the exact failure type at the exact moment the tool response enters the agent's context.
Methods
The authors propose analyzing tool returns at the "return boundary" using two complementary channels:
- The Likelihood Channel: The return string is evaluated under two different contexts to calculate conditional surprisals:
- $S_0$: Surprisal given only the tool's structural schema.
- $S_1$: Surprisal given the full trajectory prefix (user intent + past actions).
- The Likelihood Gap ($G = S_1 - S_0$) measures how much the historical context helps predict the tool's output.
- The Action Channel: Instead of looking at token-level text generation, the authors measure the agent's probability distribution ($\pi$) over its legal next actions (e.g., the 16 available tools plus a user reply action). They track changes in Action Entropy ($\Delta H$) and shifts in probability mass toward specific action groups, such as state verification (reading) vs. state-changing (writing) tools.
Datasets
The approach was evaluated using the retail customer-service domain of $\tau^2$-bench, a benchmark for tool-augmented language agents. Out of 114 tasks, 53 met the strict criteria for clean baseline execution.
The authors injected three types of simulated tool faults into the first get_order_details call:
F(Failed/Incomplete): Replaces the payload with an environment error string.Nm(Token Inconsistency): Alters a payment ID field to a value that directly contradicts a verbatim token mentioned earlier in the conversation.Ns(Policy Inconsistency): Alters the order status to a different legal value, creating a contradiction that can only be caught by reasoning about the domain policy.
Key Insights and Ideas
- Different failures hide in different channels: Incomplete returns (
F) violate structural expectations and are easily caught by schema-level likelihoods ($S_0$). Inconsistencies that contradict explicit past text (Nm) stand out in the context-level likelihood gap ($G$). - Policy violations are invisible to text likelihoods: When a tool returns a perfectly formatted but logically impossible status (
Ns), the text likelihood channel sees nothing wrong. - Action distributions reveal logical contradictions: Even when a policy violation (
Ns) sneaks past the likelihood channel, it violently disrupts the agent's action distribution, causing a massive spike in action entropy. - Failures alter the agent's trajectory destination: Incomplete returns naturally push the agent toward safe, state-verifying actions (re-reading). In contrast, undetected logical inconsistencies (
Ns) dangerously redirect the agent toward incorrect, state-changing write actions.
Key Results
The experiments, conducted using a Qwen3-8B model, demonstrated that combining both channels yields a reliable diagnosis:
- Schema Shifts: As shown in Figure 1(a) above, the incomplete arm (
F) showed a massive, isolated shift along the $\Delta S_0$ axis, completely separating it from the inconsistent arms. - Likelihood Gap: The token-inconsistent arm (
Nm) increased the likelihood gap ($G$) in 30 out of 37 instances where the correct identifier was present in the prefix. - Action Entropy: Figure 1(b) highlights that the policy-inconsistent arm (
Ns) caused the most severe immediate increase in action uncertainty ($\Delta H$). - Downstream Effects: Looking downstream along the trajectory (Figure 2, below), the likelihood effects of incomplete returns (
F) persisted for several steps, while the immediate action-entropy spikes from inconsistencies quickly flattened out into confidently chosen wrong actions.
Limitations and Future Work
- Teacher Forcing Constraint: The metrics were evaluated at specific decision points using "teacher forcing" (replaying reference actions) rather than letting the agent play out a live, unconstrained rollout. This isolates the immediate signal but doesn't measure long-term task completion degradation.
- Scope of Evaluation: The study was restricted to a single model (Qwen3-8B) and a single domain ($\tau^2$-bench retail).
- Synthetic Noise: The failures were template-injected rather than organic or adversarial human-engineered noise.
The authors suggest that future architectures should build explicit guardrails using these boundary signals to trigger automated recovery strategies before the agent commits to a corrupted reasoning path.
Summary updated