Security Architecture Whitepaper

Technical specification of trust boundaries, cryptographic bindings, and non-goals.

1. Four binaries separated by credentials

dev, solo, and cloud run the exact same four Rust binaries: iot-gateway (MQTT-mTLS), iot-api (/v1, /mcp, SSE), iot-worker (leased outbox jobs & allowlisted egress), and iot-authority (independent workspace, SQLite vault, signing keys, and zero-framework approve.<host>). There is no monolithic binary and no in-memory database fallback.

2. Three-layer permission narrowing

Layer 1 (firmware envelope) is burned into signed firmware and cannot be relaxed. Layer 2 (PolicyBundle) is signed by Authority with monotonic policy_revision and encodes customer direct-allow ranges, local invariants, TSL digest, and single home controller. Layer 3 (CommandGrant) is a one-shot Ed25519 grant bound to workspace, project, device, command, policy_revision, lease_ms, canonical CBOR writes, approval_id, boot_nonce, uptime_deadline_ms, and optional service_id.

iot.tx-binding.v1
SHA-256("iot.tx-binding.v1" || version_u16 || decision_u8 || workspace || project || device || command
        || policy_revision_u64 || lease_ms_u32 || len_u32 || writes_cbor
        || approval || boot_nonce || uptime_deadline_ms_u64 || optional_service_suffix)

3. Independent approval domain (approve.<host>)

All Passkey registrations, high-risk command approvals, safety relaxations, OTA activations, API key minting, and recovery vetoes occur exclusively on approve.<host>, served directly by iot-authority with zero React/npm dependencies. iot-api cannot mint WebAuthn assertions or modify displayed fields.

4. Database-enforced tenant isolation & audit chain

Every PostgreSQL transaction passes the caller credential via SET LOCAL app.auth_secret. Database RLS resolves workspace, project, and permission bitmasks directly—application-supplied workspace IDs are ignored. Runtime roles have no SUPERUSER, BYPASSRLS, TRUNCATE, or DDL privileges. Workspace and platform audit logs maintain independent hash chains.

5. Emergency stop & AI circuit breakers

AI clients operate in Read-only, Shadow (dry-run), or Auto mode. Exceeding per-minute actuator/energize budgets or consecutive rejection thresholds latches Shadow mode until a human administrator resets the breaker with Passkey confirmation. safe_stop always bypasses daily commercial quotas and AI circuit breakers.

6. Explicit non-goals & honest limits

Software controls do not replace physical E-stops or SIL-certified safety interlocks. Cloud/Solo capacity figures in architecture notes are design targets, not guaranteed production benchmarks. Hardware qualification and external audits are published only with reproducible artifacts.