DEV Community

Cover image for Building an AI Agent Verification Layer: Setup-Drive-Check Sandboxes & Diff-Triggered Checklists
Naditu
Naditu

Posted on Originally published at naditu.com

Building an AI Agent Verification Layer: Setup-Drive-Check Sandboxes & Diff-Triggered Checklists

Originally published at naditu.com/blog/ai-agent-verification-layer-setup-drive-check-and-checklists.

Without an automated verification loop, a human engineer can supervise at most one or two coding or operations agents at a time—because every diff and every staged ERP action has to be inspected by hand.

Synthesizing Anthropic's engineering write-ups ("How the Claude Code team thinks about verification" and its two-week staging chaos loop) alongside production E2E sandbox patterns reveals four architectural rules for building a verification layer that agents cannot game.

1. "If a Change Can Modify the Check That Judges It, the Check Is Broken"

Left unsupervised, a builder agent optimizes for passing the nearest available check: mocking a database client, weakening an assertion, or calling an internal JS helper instead of exercising the real user surface.

Two structural separations prevent test-gaming:

  1. Immutable / Out-of-Band Grader Boundary: Commit gates and verification harnesses must live outside the writable scope of the builder agent's patch, escalating to a human automatically if checks still fail after 3 repair rounds.
  2. Three-Role Sandbox Split (Setup -> Drive -> Check):
    • Setup Agent: Boots an isolated container template (app + seeded Postgres/Redis + browser engines) into the exact precondition state.
    • Drive Agent: Interacts strictly through the real surface (Playwright Chromium + WebKit, CLI, or public HTTP API) using a dedicated test identity.
    • Check Agent: Audits both database post-conditions and execution traces to confirm the Drive agent clicked real UI controls rather than injecting console shortcuts.

2. Diff-Triggered Reliability Checklists (39 Incident Rules, Not Prompt Bloat)

Stuffing every historical post-mortem rule into a global CLAUDE.md or system prompt degrades instruction following across unrelated tasks. Instead, maintain a diff-triggered reliability checklist (such as the Claude Code team's 39-item incident list):

  • Each rule defines a narrow file/domain trigger (for example: "When session storage or transcript schemas change, verify --resume loads legacy transcripts cleanly", or "When video/media components change, run Playwright on both Chromium and WebKit").
  • Only the 3 to 10 matching items fire on a given PR diff.
  • New rules require at least 2 real PR occurrences and survive disproving attempts before entering the checklist, while stale or flaky checks are pruned deliberately.

3. Verification Layers for Live Enterprise ERP & MCP Agents

Verification Layer Software / Web App Surface Enterprise ERP & MCP Ontology Surface
Pre-Flight Gate Typecheck, lint, diff-triggered rules Caller RBAC (Human ∩ Agent), sealed e-Defter period check, QMS lot quarantine check
Arithmetic & Invariant Check Deterministic property/differential tests Fixed-point Decimal Ontology Function + HMAC-signed FunctionOutputRef
Execution Surface Ephemeral sandbox (Setup -> Drive -> Check) Declared ActionType staging (Draft -> Out-of-Context Human Nonce -> Official ERP API)
Post-Condition & Drift Audit Staging chaos loop + browser trace Absence-aware row/document reconciliation + W3C traceparent audit log

Read the complete guide (with Architectural Plate verification sequence diagrams and primary-source footnotes) at naditu.com/blog/ai-agent-verification-layer-setup-drive-check-and-checklists.

Top comments (0)