2026-11-26 15:40 UTC

Sentry releases an MIT-licensed failure-recovery layer for LLM agents

state: seedheat: mediumuncertainty: mediumrelevance: highagent-failure-management agent-self-improvement agent-reliabilitynuglifeleojiChangxiu JiAmy LuQizheng ZhangKunle Olukotun

What is this?

Sentry is an available, MIT-licensed Python runtime layer from Changxiu Ji, Amy Lu, Qizheng Zhang and Kunle Olukotun, presented in a GitHub repository and an arXiv paper. It runs alongside an LLM agent: it detects invalid actions and other behavioral failures, provides repair guidance, checks whether recovery worked, and can retain verified recoveries as lessons for similar failures. The repository reports results including 37% average relative improvement over a runtime-intervention baseline and an 81.7% recovery rate across 939 detected failures; the arXiv search result reports 81.8%. These are project-reported results, not independent confirmation. The checkout supports an AppWorld reference benchmark, while the repository says runners for the paper’s other benchmarks are not included.

Why it matters

Agent reliability is a practical bottleneck for systems that use tools over multiple steps. Sentry explores adding a separate recovery layer that learns from verified fixes without keeping its full playbook in the agent’s context. If its approach generalizes, it could make existing agents more dependable without replacing their underlying models; the benchmark claims still need independent validation.

Current assessment

The newly surfaced project is both code and a research paper, rather than only a proposal: the repository provides a Python 3.10+ implementation, provider configuration, integration guidance and an AppWorld benchmark runner under an MIT license. Its design separates failure detection, repair, recovery verification and cross-task playbook learning; the application still handles action generation, execution and task completion. The paper and repository report gains on benchmark tasks, transfer of lessons to held-out tasks, and lower token use than a cited baseline; the repository also reports lower latency than the base agent on two benchmarks. Treat these as author-reported findings: supplied sources do not provide independent replication, and the benchmark runner in the checkout does not cover all paper benchmarks. Recovery-rate figures differ slightly (81.7% in the repository, 81.8% in the arXiv result); the available evidence does not explain the discrepancy. Worth tracking for agent reliability and test-time learning, especially whether independent evaluations confirm gains and whether the recovery judge and detector remain reliable outside the reported tasks.

Measured heat

now 0 pts/hpeak 4 pts/hcomments 0/hpeers p21momentum: steady2 platformsage 62h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-24 01:26 (minted)⭐ origin echo-reconstructedThe repository presents Sentry as a runtime layer that detects agent failures, guides and verifies recovery, and learns reusable lessons; it
nuglifeleoji on github (echo) · attributed from hn.story.50621997 · published time unknown
—
11-24 00:56first on hacker news · published · lag ?Sentry: An external self-improving failure management layer for LLM agents
matt_d
—
11-24 00:56amplified on hacker news 👑hn.story.50621997
matt_d
peak 2 · 0 comments · 103% of case engagement
11-24 01:24our radar first saw it · lag ?discovery anchor: hn.story.50621997—
pace: p36 vs 1989 stories at the 48h mark (now 62h old) — ahead of 42loop-agent-operated-product-experiment (2.0x), behind agentfx-agent-animation-tool (0.7x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnSentry: An external self-improving failure management layer for LLM agents
Retrieved article excerpt

Open article · Retrieved 2026-11-24T01:26:21.031530+00:00

[Sentry Logo](https://github.com/nuglifeleoji/Sentry/blob/main/assets/sentry_logo_gif.png)

# **Sentry: An external self-improving failure management layer for LLM agents.**

**Sentry runs alongside your agent loop to detect failures, guide recovery, and learn reusable lessons from verified recoveries.**

**[Quick Start](https://github.com/nuglifeleoji/Sentry#quick-start)**  | 
**[Paper (arXiv)](https://arxiv.org/abs/2610.02994)**  | 
**[License](https://github.com/nuglifeleoji/Sentry/blob/main/LICENSE)**

[Python 3.10+](https://github.com/nuglifeleoji/Sentry#installation)
[MIT License](https://github.com/nuglifeleoji/Sentry/blob/main/LICENSE)
[arXiv](https://arxiv.org/abs/2610.02994)

## What is Sentry?

Sentry is an external runtime failure management layer for LLM agents. It helps agents fix invalid actions and recover when they get stuck in loops, drift from the task, or make unsupported assumptions. Unlike typical runtime monitors with fixed advice, Sentry learns and evolves from recoveries that work. By detecting failures, guiding recovery, and checking that the repair worked, Sentry helps agents become more reliable across tasks without cluttering their context.

## Demo

[Sentry demo](https://github.com/nuglifeleoji/Sentry/blob/main/assets/sentry-demo.gif)

## Key Results

Results reported in the [paper](https://github.com/nuglifeleoji/Sentry/blob/main/assets/Sentry_paper.pdf):

- **37% average relative improvement** over the strongest runtime-intervention baseline across WebShop, AppWorld, SWE-bench Lite, and Mind2Web Replay.
- **39% average relative improvement** over the strongest context-evolution baseline on held-out WebShop and Mind2Web Replay tasks.
- **1.54× base-agent token usage**, versus 2.44× for AgentForesight.
- **Lower average task latency** than the base agent on SWE-bench Lite (31.7s saved) and AppWorld (45.6s saved).
- **81.7% recovery rate** across 939 detected failures.

## Quick Start

### Installation

Sentry requires Python 3.10 or later.

```
git clone https://github.com/nuglifeleoji/Sentry.git
cd Sentry
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
```

### Configure a Model

Copy the OpenAI configuration template, then set your model ID:

```
mkdir -p outputs
cp configs/providers/openai.yaml outputs/sentry.yaml
export OPENAI_API_KEY="your-api-key"
```

In `outputs/sentry.yaml`, replace `YOUR_DEPLOYMENT_MODEL_ID` with the exact model ID available to your account. Then validate the configuration:

```
sentry-validate outputs/sentry.yaml
```

Validation prints the resolved configuration as JSON without making a model request. For other providers or a local endpoint, see [Model providers](https://github.com/nuglifeleoji/Sentry/blob/main/docs/model-providers.md).

### Try a Recovery

Run this Python example from the repository root. It submits an intentionally malformed action and asks the configured model to rewrite it:

```
from Sentry import SentryRunner, agent_step_from_parts

runner = SentryRunner.from_yaml("outputs/sentry.yaml")
runner.start_task(
    objective="Inspect item 42 to check its price.",
    action_schema='Return JSON: {"tool": "inspect", "args": {"item_id": <integer>}}',
)

try:
    step = agent_step_from_parts(
        step_id=0,
        reasoning="Open the item details before deciding whether to buy.",
        raw_action="inspect item 42",
        observation="Item 42 is visible; its price has not been inspected.",
        parsed_ok=False,
        schema_valid=False,
        parser_error="Expected a JSON object; received plain text.",
    )
    repair = runner.step(step)
    if repair is not None:
        print("Repair route:", repair.route)
        print("Next action:", runner.generate_repair(repair))
finally:
    runner.finalize()
```

The route is `hard_repair`; the next action is model-generated and should follow the JSON schema. This example makes one model request and does not execute the returned action.

For a real agent, submit each action-observation cycle to Sentry and include any returned guidance when generating the next action. Your application handles action generation, validation, execution, and task completion. Follow [Agent integration](https://github.com/nuglifeleoji/Sentry/blob/main/docs/agent-integration.md) for the full lifecycle and validity rules.

## How It Works

[Sentry framework: failure detection, repair, verification, and playbook learning](https://github.com/nuglifeleoji/Sentry/blob/main/assets/sentry-framework.png)

1. **Failure Detection:** Sentry monitors recent agent steps for invalid actions and behavioral failures.
2. **Hard Repair:** Sentry asks the agent to retry invalid actions in the required format.
3. **Soft Repair:** Progress and reasoning failures receive targeted guidance from relevant playbook lessons.
4. **Recovery Verification:** Sentry checks whether the agent recovers over the following steps.
5. **Online Playbook Learning:** Verified soft recoveries become reusable lessons for similar failures across tasks.

## Documentation

The guides follow the recommended reading order: model-provider setup, configuration, agent integration, playbook and logging, and the AppWorld benchmark.

| Guide | Contents |
| --- | --- |
| [Model providers](https://github.com/nuglifeleoji/Sentry/blob/main/docs/model-providers.md) | Credentials, provider templates, and endpoint configuration |
| [Configuration](https://github.com/nuglifeleoji/Sentry/blob/main/docs/configuration.md) | Model and storage options, fixed algorithm settings, and configuration validation |
| [Agent integration](https://github.com/nuglifeleoji/Sentry/blob/main/docs/agent-integration.md) | Task lifecycle, step inputs, repair guidance, and recovery verification |
| [Playbook and logging](https://github.com/nuglifeleoji/Sentry/blob/main/docs/playbook-and-logging.md) | Cross-task memory, persistence, explicit loading, and runtime logs |
| [AppWorld benchmark](https://github.com/nuglifeleoji/Sentry/blob/main/docs/appworld-benchmark.md) | Environment setup, task selection, run limits, and result files |

The [paper](https://github.com/nuglifeleoji/Sentry/blob/main/assets/Sentry_paper.pdf) also examines conditional lesson exposure, fine-grained retrieval, transfer to unseen tasks, and combining Sentry with context evolution.

## Release Status

This checkout includes the Sentry runtime, model-provider adapters, configuration templates, tests, and an AppWorld reference benchmark. The benchmark runner currently supports AppWorld dev tasks. The other benchmarks reported in the paper do not yet have runners in this checkout.

## Contributing

Contributions to Sentry are welcome, including bug fixes, integration examples, and documentation improvements.

Bug reports and feature requests can be submitted through [GitHub Issues](https://github.com/nuglifeleoji/Sentry/issues). Code and documentation changes can be submitted as pull requests.

## Citation

If you use Sentry in your research, please cite:

```
@article{ji2026sentry,
  title={Sentry: Learning to Recover from LLM Agent Failures at Test Time},
  author={Ji, Changxiu and Lu, Amy and Zhang, Qizheng and Olukotun, Kunle},
  journal={arXiv preprint arXiv:2610.02994},
  year={2026}
}
```

## License

Sentry is released under the [MIT License](https://github.com/nuglifeleoji/Sentry/blob/main/LICENSE).
matt_d20
🟧 echo.github ⭐The repository presents Sentry as a runtime layer that detects agent failures, guides and verifies recovery, and learns reusable lessons; itnuglifeleoji——

Interpretation history

Decision trace