Skip to main content

The kernel

The kernel (vanta-kernel, in src/) is the enforced security boundary — small, dependency-free Rust. It owns every decision about whether an action is safe, and the agent layer cannot bypass it.

Modules

ModulePurpose
appState (root + data dir), doctor, event log, JSON escaping, data-dir migration
safetyassess_action() → Verdict{ Allow / Ask / Block } — the gate
approvalsApprovalQueue, persisted to .vanta/approvals.tsv; only Ask actions queue
goalsGoalLedger, persisted to .vanta/goals.tsv
runtimerun_native() — safety-gates then dispatches; returns Unsupported rather than silently falling back
serverRaw TCP HTTP/1.1 — the cockpit UI + all /api/* JSON endpoints
auditTamper-evident hash chain over events.jsonl (per-install secret key) — see Security
scopePath containment (inside_scope) + protected-path enforcement — see Security
loopsLoop ledger reader/writer (.vanta/loops/*): summaries for the cockpit, pause/resume/kill, escalation clearing

How assess() decides

The classifier runs in a fixed order, and earlier floors are never downgraded:

  1. Block floor — destructive or exfiltration keywords → Block. Runs first, immovable.
  2. Scope check — paths outside the root → Ask.
  3. System / credential keywordsAsk.
  4. Reversibility pass on the Allow tail — irreversible operations (push, migrate, publish, deploy, history rewrite) escalate Allow → Ask; read-only and reversible operations (including file writes, which are reversible authoring) stay Allow.

See Safety model for the full tier semantics.

HTTP API

The kernel listens on 127.0.0.1:7788:

Method + pathPurpose
GET /api/statusHealth + counts
POST /api/assessBody = action → returns the Verdict
GET|POST /api/goalsRead / append goals
GET|POST /api/approvalsRead / resolve approvals
POST /api/logAppend an event
POST /api/runRun a gated native action
GET *The cockpit HTML UI

Data directory

.vanta/ holds the kernel's durable state:

  • events.jsonl — the independent decision/event log
  • approvals.tsvid ⇥ text ⇥ risk ⇥ needs_human ⇥ status ⇥ reason
  • goals.tsvid ⇥ text ⇥ status

Running it

cargo build && cargo test # build + the kernel test suite
cargo run -- doctor # health check, creates .vanta/
cargo run -- serve 7788 # cockpit + JSON API

The TypeScript launcher auto-starts the kernel when the agent needs it (it passes VANTA_ROOT for the active project). If port 7788 is held by a stale binary, find and kill it: lsof -nP -iTCP:7788 -sTCP:LISTEN.