Skip to main content
Lab Grimoire
TW EN
Coffee
The AI Agent Self-Healing Playbook: How Sentinel Mechanisms Stop Silent Failures
Agent Architecture

The AI Agent Self-Healing Playbook: How Sentinel Mechanisms Stop Silent Failures

On this page

There's an old saying in software engineering: the hardest bug to fix isn't the one that crashes the system — it's the one that lets the system look like it's still running while it's actually broken.

AI agents have amplified this problem to a new level. A modern AI assistant might run a dozen background processes simultaneously: memory writes, usage tracking, safety checks, context monitoring. If any one of them quietly stops working, the agent can keep responding perfectly on the surface while degrading in ways the user won't notice for days, or weeks.

You won't realize the memory subsystem failed until you ask a question it should have remembered — and it doesn't.


The Sentinel Concept

An open-source Claude Code plugin called evolving-lite proposes an elegantly simple solution: the Sentinel mechanism.

Sentinel Mechanism: How Scripts Leave Proof of Success

The principle is almost insultingly straightforward. Every background script, upon successful completion, writes a small JSON file to /tmp/. That file records: "I just ran, here's my timestamp, status is OK."

These JSON files are the sentinels. Their existence is proof that everything worked. When the system starts up next time, a health monitor scans for them: which sentinels are present? Which are missing? A missing sentinel points directly to the script that silently failed last time.

No complex error-handling logic. No centralized monitoring service. No external dependencies. The presence or absence of a file is the entire signal.


Four Feedback Loops

The sentinel mechanism is just one component of a larger system called HEAL Loop. The full architecture contains four continuously running feedback cycles:

LEARN Loop — When you correct the AI's output (say, fixing a misused term), the system captures that correction and stores it as memory. Next time a similar situation arises, the correction applies automatically. You don't tell it "remember this." The act of correcting is the teaching.

CONTEXT Loop — Monitors conversational context usage. At 70%, it warns and suggests entering summary mode. At 93%, it automatically triggers knowledge preservation — ensuring that even as the conversation compresses, no critical information is lost.

HEAL Loop — The sentinel mechanism. Every startup triggers an automatic health check. Problems surface immediately with guided repair suggestions.

EVOLVE Loop — Tracks usage frequency and automatically archives stale data. The system doesn't slow down under the weight of accumulated old memories.

Four loops, each operating independently, together forming a safety net: always learning, never overflowing context, never hiding failures, never letting data rot.

HEAL Loop: Four Continuous Feedback Cycles


The Two-Stage Repair Protocol

When a sentinel reports an anomaly, the repair follows a strict two-stage protocol:

Stage 1: integrity-checker. Read-only diagnosis only. It scans directory structures, checks whether JSON files contain required fields, verifies that scripts have execution permissions. It reports problems. It never modifies anything.

Stage 2: integrity-fixer. Only addresses issues the checker explicitly flagged, and announces its intent before each action. Damaged files aren't deleted — they're moved to a quarantine zone. Every action is logged and traceable.

Why separate them? Because mixing diagnosis and treatment is a classic cause of medical errors — and software is no different. Giving a diagnostic process write permissions is like letting the medical scanner also perform the surgery. If the judgment is wrong, the damage is irreversible.


The "Install and Forget" Philosophy

The most compelling design principle of the whole system is what the creators call "install and forget." Users don't manually maintain the memory system, don't periodically clean up, don't check health status. Everything runs automatically.

The system builds trust through three progressive activation layers:

  • Session 1: Safety monitoring only, plus 20 default experiences for reference
  • Session 3: Learning layer activates, begins capturing user corrections
  • Session 10: Deep memory activates, proactively injecting past learned solutions into the AI's reasoning process

This is a gradual trust curve from "cautious observation" to "deep participation" — remarkably similar to how effective employee onboarding works in human organizations.


Three Principles Worth Keeping

You may never install evolving-lite directly (it's new, only 34 GitHub Stars as of this writing — worth watching for a while). But the design principles it demonstrates apply to any system that needs to run reliably:

Use existence proofs instead of error catching. Rather than trying to capture every possible failure mode, let each module leave evidence when it succeeds. Missing evidence is the anomaly signal.

Separate diagnosis from treatment. Never let the same code both judge and fix. The act of combining them introduces a single point of failure that can make things worse, not better.

Quarantine damaged data, don't delete it. You don't know what you don't know. Preserve it in an isolated zone and decide later. Deleted data can't be recovered; quarantined data can always be reviewed.

These aren't revolutionary insights. But in a world where AI agents are growing increasingly complex, the systems that get these basics right are surprisingly rare.


References

  1. primeline-ai/evolving-lite GitHub Repository. https://github.com/primeline-ai/evolving-lite
  2. evolving-lite health-sentinel.sh source. https://github.com/primeline-ai/evolving-lite/blob/main/hooks/scripts/health-sentinel.sh
  3. evolving-lite integrity-checker Agent. https://github.com/primeline-ai/evolving-lite/blob/main/agents/integrity-checker.md
  4. evolving-lite integrity-fixer Agent. https://github.com/primeline-ai/evolving-lite/blob/main/agents/integrity-fixer.md
  5. PrimeLine Official Site. https://primeline.cc/

Found this useful?

Follow for new AI × biomedical research notes:

Or buy me a coffee to keep new content coming.

☕ Buy Me a Coffee