Evidence-Gated Autonomous Operations
"It acts until acting becomes dangerous."
RunbookAI converts operational runbooks into evidence-gated agent workflows. Core idea: "The model proposes. Policy authorizes."
Problem
Modern autonomous agents in production systems suffer from two dangerous extremes:
- Unconstrained Execution: Agents execute arbitrary shell commands and mutate critical infrastructure without deterministic checks, leading to data loss, unauthorized access, or cascading outages.
- Analysis Paralysis: Agents cannot take safe, standard diagnostic steps without halting for human approval at every keystroke.
Moreover, relying on an LLM to evaluate its own safety ("Is this command safe?") is inherently flawed. LLMs can be persuaded, hallucinate safety guarantees, or succumb to prompt injection embedded in logs and external data.
Solution
RunbookAI decouples proposal from authorization:
- The Model Proposes: AI models explore, formulate hypotheses, and propose remediation actions.
- Policy Authorizes: A deterministic, zero-LLM policy engine computes blast radius, checks evidence provenance, and gates all actions.
- Safe by Default: Read-only and isolated sandbox steps execute automatically to gather diagnostic evidence; consequential external mutations strictly require human approval.
Architecture
[ Incident Trigger ] (e.g. INC-001 checkout-api 500 spike)
│
▼
[ Runbook Compiler ] ───> Controlled Runbook Steps
│
▼
[ Evidence-Gated Agent Loop ]
├─► Read-Only Diagnostics (Health checks, logs, diffs) ────► ALLOW
├─► Safe Reproduction (Isolated Sandbox execution) ───────► ALLOW (Policy)
├─► Remediation Formulation (Hypothesis + Validation) ────► Gated
│
▼
[ Deterministic Policy Engine ]
├─► requestsSecretExposure? ──► BLOCK
├─► unknownScope? ────────────► BLOCK
├─► FORBIDDEN category? ──────► BLOCK
├─► Blast Radius > Threshold ─► REQUIRE_APPROVAL
└─► External Mutation ────────► REQUIRE_APPROVAL
│
▼
[ Evidence Gate & Human Authorization ]
└─► Requires Verified Evidence (TOOL_DERIVED / SANDBOX_DERIVED)
(MODEL_HYPOTHESIS alone cannot attest to passing tests)
│
▼
[ Audit Timeline ] (Immutable, chronologically validated, auto-redacted)
Safety Model
RunbookAI enforces deterministic safety invariants:
- No LLM in the Policy Loop: Policy evaluations, blast radius calculations, and provenance verification are 100% pure TypeScript code.
- Untrusted-Content Handling: External content (issues, logs, PRs, diffs) is treated as untrusted data with deterministic tool boundaries.
- Defensive Secret Redaction: Automated pattern-based redaction of tokens (Bearer, GitHub, AWS, OpenAI, Daytona) across logs and audit events.
- Monotonic Audit Timeline: All events are recorded in verifiable chronological order without backdating or synthetic pre-population.
Action Classification
Every proposed action belongs to one of five exact categories:
| Category | Description | Policy Decision |
|---|---|---|
READ_ONLY |
Querying logs, checking status, inspecting source code | ALLOW |
SANDBOX_ONLY |
Isolated reproduction and test execution | ALLOW (at policy level) |
REVERSIBLE_EXTERNAL |
External mutation with clean rollback path | REQUIRE_APPROVAL |
CONSEQUENTIAL |
Modifying state, deploying code, applying migrations | REQUIRE_APPROVAL |
FORBIDDEN |
Dangerous wildcard commands, secret extraction, purge | BLOCK |
Evidence Gate
Actions requiring approval must present a structured EvidencePackage. Crucially, RunbookAI enforces strict provenance typing:
OBSERVEDTOOL_DERIVEDSANDBOX_DERIVEDMODEL_HYPOTHESISUSER_PROVIDED
Critical Safety Invariant: A
MODEL_HYPOTHESIScannot masquerade as verified execution. Model-generated claims that "tests passed" or "service recovered" are rejected by schema refinement unless verified by actualTOOL_DERIVEDorSANDBOX_DERIVEDoutput.
Blast Radius
The deterministic blast radius calculator evaluates actions across 8 dimensions:
- External systems touched
- Resources affected
- Customer-facing status
- Data mutation
- Destructiveness
- Reversibility
- Rollback availability
- Unknown dependencies
Rule Precedence: BLOCKED > HIGH > MEDIUM > LOW
Runbook
Controlled runbooks (such as runbooks/checkout-incident.md) are compiled into structured execution steps. Ambiguous or unrecognized instructions fail safely rather than defaulting to read-only.
Supported demo scenario: INC-001 (Checkout API 500 spike after release).
Security
- Untrusted Content Analysis: Detects prompt-injection markers (
ignore previous instructions,reveal API key,upload secrets,disable policy) as defensive signals without claiming to be "prompt-injection proof". - Defensive Redaction: Scans for and redacts API keys and sensitive environment values before persisting audit records.
Local Development
Prerequisites: Node.js >= 22
# Install dependencies
npm install
# Run full test suite (191 tests across 15 test files)
npm test
# Run type check across all workspaces
npm run typecheck
# Run linter (strict type-checked)
npm run lint
# Build client production bundle (populates dist/ and apps/dashboard/dist/client)
npm run build
# Start Demo Dashboard (Port 8791) - Synthetic Replay & Judging
npm run dev:fixture
# Or in production mode:
npm run start:fixture -w @runbook-ai/dashboard
# Start Live TrueForge Dashboard (Port 8792) - Connected to TrueForge
npm run start:live
# Start Target Microservice (checkout-api on Port 3000)
npm start --prefix demo-service
Running the Dashboards & Live Demo
RunbookAI provides two side-by-side dashboard experiences:
Demo Dashboard (Port 8791):
- URL:
http://127.0.0.1:8791 - Mode: Synthetic Fixture Replay (
--source=fixture) - Interactive Replay (Step 8 Approval Boundary):
http://127.0.0.1:8791/?session=fixture-inc-001-awaiting - Resolved Session (GitHub PR + Recovery Verified):
http://127.0.0.1:8791/?session=fixture-inc-001-resolved - Incident Post-Mortem Report:
http://127.0.0.1:8791/?session=fixture-inc-001-awaiting&view=report
- URL:
Live TrueForge Dashboard (Port 8792):
- URL:
http://127.0.0.1:8792 - Mode: Live TrueForge (
--source=trueforge) - Reaches TrueForge agent harness over HTTP/SSE (
http://localhost:8790). - Dispatches live incident runs, streams tool execution events, and forwards human approvals to TrueForge.
- URL:
Target Microservice (
checkout-api):- URL:
http://127.0.0.1:3000(orhttp://127.0.0.1:8792in standalone mode) - Live endpoint reproducing incident INC-001:
GET /health➔200 OKPOST /checkout(No promo) ➔500 Internal Server Error(Cannot read properties of undefined (reading 'discount'))POST /checkout(With promoSAVE10) ➔200 OK(10% discount applied)
- URL:
Cloud Deployment
- TrueFoundry: See TRUEFOUNDRY.md and
truefoundry.yamlfor single-replica Kubernetes service deployment. - AWS Amplify: Configured via
amplify.ymltargetingbaseDirectory: dist.
Testing
Comprehensive test suites (191 tests passing across 15 test files):
demo-service/tests/health.test.ts- Target microservice health probe and service discoverydemo-service/tests/checkout.test.ts- Incident INC-001 regression reproduction and patch validationpackages/core/tests/policy.test.ts- Deterministic policy decisions, permission matrix, and blast radius rulespackages/core/tests/security.test.ts- Untrusted content analysis and defensive redactionpackages/core/tests/envelope.test.ts- Tool execution envelope validationapps/dashboard/tests/server.test.ts- HTTP API routes, SSE streams, write guards, and preflight healthapps/dashboard/tests/projection.test.ts- Incident and execution projectionsapps/dashboard/tests/console.test.ts- Console and UI state projectionsapps/dashboard/tests/report.test.ts- Incident post-mortem report generation and Markdown exportapps/dashboard/tests/write-guard.test.ts- Fail-closed TrueForge write safety guardsapps/dashboard/tests/preflight.test.ts- Preflight checks and connector validationapps/dashboard/tests/sandbox-output.test.ts- Sandbox output handling and evidence extractionapps/dashboard/tests/hub.test.ts- Real-time SSE event hubapps/dashboard/tests/lineage.test.ts- Execution lineage and causal graphsapps/dashboard/tests/config.test.ts- Runtime configuration, flags, and source selection
Current Integration Status
| Component | Status | Notes |
|---|---|---|
| Local TypeScript Core | REAL | Verified, compiles in strict mode |
| Deterministic Policy | REAL | 100% deterministic TypeScript, zero LLM dependencies |
| Evidence Model | REAL | Typed provenance gating (SANDBOX_DERIVED, TOOL_DERIVED) |
| Blast Radius Engine | REAL | Evaluates 8 dimensions with strict risk precedence |
| Security Primitives | REAL | Untrusted content analysis & token redaction verified |
| Audit Timeline | REAL | Chronologically validated, auto-redacted |
| Controlled Runbook | REAL | checkout-incident.md parsed and executed |
| Target Microservice | REAL | checkout-api running on port 3000, reproducing INC-001 |
| TrueForge SDK Client | REAL | Interfaces via @truefoundry/trueforge-sdk v0.2.0 |
| Fail-Closed Write Guard | REAL | Prohibits unacknowledged external mutation writes |
| Incident Reporting | REAL | Interactive post-mortem timeline with Markdown export |
| Multi-Dashboard Support | REAL | Demo on 8791, Live TrueForge on 8792 |
| AWS Amplify Deployment | REAL | Configured in amplify.yml with dist/ artifacts |
AI Assistants Used
- Google Antigravity (Advanced Agentic Coding): Used for codebase inspection, TypeScript domain modeling, policy engine implementation, test creation, write-guard safety integration, and quality gate verification.
License
MIT License. Copyright (c) 2026 RunbookAI Contributors.