Skip to content

[Proposal] New Guide: Mechanical Guards for AI Agents #787

Description

@YuhaoLin2005

Proposed Section: Mechanical Guards for AI Agents

A new guide covering a category of prompt engineering currently missing from the guide: mechanical verification patterns that compensate for an LLM's structural inability to verify its own NL output.

The Gap

Current guides cover prompt design, reliability patterns, and adversarial robustness. But there's a distinct category not yet covered: deterministic, filesystem-level checks that bypass the LLM's reasoning layer entirely — because the LLM cannot reliably judge its own configuration integrity.

Core Concept: The Prose Barrier

Any NL-based AI agent shares a structural constraint: its verification loop and generation loop use the same channel. An agent cannot independently verify its own NL output — it can only produce more NL claiming the first NL was correct. This is not a bug — it's an architectural property.

What the Guide Would Cover

  1. The Prose Barrier — why AI agents structurally cannot self-verify NL output
  2. Mechanical Gate Patterns — filesystem checks (mtime, regex, exit codes, hook wiring) that verify config integrity without AI involvement
  3. Dual-Layer Architecture — process-layer soft monitoring + output-layer hard blocking
  4. Causal Evidence — config rules causally shape agent behavior (n=30 experiment, p=0.0092)
  5. Implementation Patterns — SessionStart/PreToolUse/Stop hook designs for mechanical verification

Evidence

  • 50+ session production deployment
  • Causal experiment: odds ratio 11.0, p=0.0092
  • Independent structural convergence with Anthropic J-space (July 2026)
  • ECC 226K★ repo: delivery-gate merged (#2378)

Scope

~2000 words, fits as a new guide under guides/prompts-mechanical-guards.md. Complementary to existing prompts-reliability.md — focuses on the verification layer rather than prompt design patterns.

Happy to draft the full guide if maintainers are interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions