← All papers  /  Oct 2, 2026
Agents

Sentry: Learning to Recover from LLM Agent Failures at Test Time

First page
Sentry: Learning to Recover from LLM Agent Failures at Test Time
The curator’s take

Changxiu Ji, Amy Lu, Qizheng Zhang and Kunle Olukotun at Stanford argue that failure lessons should be shown to an agent only when the matching failure occurs, and build Sentry, a failure-management layer that keeps its recovery playbook outside the agent's context.

Ask this paper

Key points
01

Finding. Failure lessons are conditional. Kept permanently in context they misfire when their failure is absent, and removing them from an evolving playbook improves performance.

02

Sentry. When a failure is detected mid-trajectory, Sentry retrieves matching lessons to guide recovery, checks without access to task reward whether the agent recovered, and adds a new lesson only if it did.

03

Results. Sentry beats 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 were run. Combining Sentry with ACE context evolution performs best wherever tested.

04

Causal check. Paired forks from 200 intervention points show Sentry's guidance raises local recovery from 33.5% to 60.5%, and human annotators agree with its intervention and recovery judgments in 86.0% and 81.8% of cases.

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.

Every Monday
Get next week’s papers.
Subscribe on Substack