The kernel is the only substantial code Opbox owns and the system’s trust boundary. It is a single Rust
binary that is both the opbox CLI and the HTTP/MCP server. Every capability is a verb; nothing reaches the
data except through a verb.
The front door
The axum router exposes a small, fixed surface:
| Route | Purpose | Auth |
|---|---|---|
POST /v/:verb | Dispatch a verb (the raw JSON body is the input) | Bearer |
POST /mcp | The Streamable-HTTP MCP transport (the caged agent’s door) | Bearer |
POST /auth/login | Email + password → a SESSION token | none (bootstrap) |
POST /auth/reset/* | Password reset | none (bootstrap) |
GET /health | Unauthenticated liveness ({"status":"ok"}, no version disclosure) | none |
All three doors (CLI, HTTP, MCP) dispatch through the same registry and the same pool — there is no second backend (INV-14).
The agent, the CLI, and the web app all enter the same way: one verb, permission-checked and audited before it runs. There is no privileged side-channel - which is why the agent can be handed real work safely.
Token-only in release
A release binary is built with the dev-identity cargo feature dropped (ADR-0040), so the only way to
resolve an identity is a bearer token. A production server cannot fall back to a privileged dev actor — it is
a compile-time fail-closed property. The bootstrap ceremony (opbox initiate) mints the first owner bearer;
see Genesis.
The verb model
There are ~360 verbs across ~40 noun domains (matter, form, doc, board, bill, party,
signing, org, token, gate, review, trigger, and more), spread over four tiers - about 68 are
always-on Core, the rest unlock on demand or are admin-only (see Capabilities). Each verb is registered once with its
metadata, and the dispatch gate checks all of it before any database work (fail-closed, INV-11):
- Authz tier — the caller’s standing must meet the verb’s required tier (
MEMBER→ADMIN→OWNER, orEXTERNALfor provider/portal surfaces). - Autonomy level — the caller’s per-request autonomy (
min(actor, token ceiling), 0–3) must meet the verb’s implied level. Level 0 is read-only; sensitive and owner operations need higher levels. - Capability scope — if the bearer carries a verb allow-list, the verb must be on it (the narrowest, per-bearer fence).
This is why least-privilege is tier + autonomy + scope, never a feature flag (INV-12). A bounded agent at autonomy 1 can read and create matters but cannot perform sensitive or owner operations, regardless of its verb scope.
The data plane
Postgres + pgvector is the single source of record. The kernel writes through one path per fact (INV-1) and appends exactly one hash-chained audit event per verb call, in the same transaction (INV-8). The append-only event log makes every action tamper-evident and attributable.
Idempotency
A retried POST /v/:verb carrying the same Idempotency-Key header returns the first call’s response instead
of re-executing — so a durable orchestrator (see Hatchet) can retry safely. The dedup
is keyed (workspace, key) and is additive: with no header, the dispatch path is byte-identical.