Sentry: Learning to Recover from LLM Agent Failures at Test Time
cs.LG, cs.AI, cs.CL
Submitted: 2026-10-02
Updated: 2026-10-02
License: http://creativecommons.org/licenses/by/4.0/
The gist: LLM agents often fail mid-task due to invalid tool calls, repeated actions, or poorly grounded reasoning, and learning from these failures is a path to reliability.
Abstract
LLM agents often fail mid-task due to invalid tool calls, repeated actions, or poorly grounded reasoning, and learning from these failures is a path to reliability. We find that how failure knowledge reaches the agent matters as much as what it contains. Failure lessons are conditional: kept in the agent's context, they misfire when their failure is absent, and removing them from an evolving playbook improves performance. Runtime interventions, in contrast, act only when a failure occurs but do not learn from their repairs. We argue that failure knowledge is conditional knowledge and should be conditionally exposed, and instantiate this principle in Sentry, a failure-management layer that runs alongside the agent. When Sentry detects a failure, it retrieves matching lessons from an external playbook to guide recovery, verifies without access to task rewards whether the agent recovered, and stores a new lesson only if it did; the full playbook never enters the agent's context. Across multiple agentic benchmarks, Sentry outperforms the strongest runtime-intervention baseline on every benchmark, by 37% on average, and the strongest context-evolution baseline by 39% on the two benchmarks where both are evaluated; combining Sentry with context evolution yields further gains. Learned lessons transfer to held-out tasks, and controlled experiments show that exposing the full playbook to the agent lowers performance even when relevant lessons remain available on demand.
Sources
- From Failed Trajectories to Reliable LLM Agents: Diagnosing and Repairing Harness Flaws
- Real-Time Detection and Repair of LLM Agent Failures
- AgentGuard: Runtime Verification of AI Agents
- AutoHarness: improving LLM agents by automatically synthesizing a code harness
- AgentFixer: From Failure Detection to Fix Recommendations in LLM Agentic Systems
- Voyager: An Open-Ended Embodied Agent with Large Language Models
- Adapting the Interface, Not the Model: Runtime Harness Adaptation for Deterministic LLM Agents
- $\tau$-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains
- Do Self-Evolving Agents Forget? Capability Degradation and Preservation in Lifelong LLM Agent Adaptation
- AgentForesight: Online Auditing for Early Failure Prediction in Multi-Agent Systems
- Self-Harness: Harnesses That Improve Themselves
- Where LLM Agents Fail and How They can Learn From Failures
- Wink: Recovering from Misbehaviors in Coding Agents
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks