Security Design
Authentication / Authorization
| Scheme | Type | Description |
|---|---|---|
| control-plane-api-key | api-key | Client credential used by the sidecar and CLI to authenticate to the control plane in the MVP. |
| sidecar-mtls | oauth2 | Mutual TLS device identity between sidecar and control plane, introduced alongside hardware binding. |
| local-sidecar-socket | none | Local authenticated channel (Unix domain socket) between an agent/CLI and the sidecar on the same host. |
Security Auditing
- Monitoring: Prometheus metrics from the sidecar and control plane — resolution latency and deny rates.
- Alerts: Deny-rate spikes and key-store reachability.
- On-call: Single team in MVP.
Vulnerabilities
| ID | Title | Severity | Mitigation |
|---|---|---|---|
| rooted-os | Rooted OS or compromised local agent process | high | Process isolation in the MVP; secure element, TEE, or TPM binding in Phase 1. Plaintext remains transient and zeroised. |
| provider-kms-exposure | Multi-tenant AI-cloud KMS used as the root | high | Do not use multi-tenant AI-cloud KMS as root. Self-hosted key store, then HSM or secure element. |
| human-pastes-plaintext | A human pastes plaintext into a chat | high | Out of scope even in later phases. The product exists to make this unnecessary, not to detect it. |
| output-relay-leak | A prompt-injected agent reads the secret back out of relayed command output | high | The sidecar redacts the resolved value — and substrings of 8+ characters — from any output it relays, in raw, base64, base64url, hex, percent-encoded, and JSON-escaped form, including split-across-chunk matches; output is size-capped by default; MCP-initiated resolves require a command allowlist and CLI/SDK resolves fall back to a documented backstop denylist. See safekeys/output-control. |
| dev-kek-agent-readable | The development KEK is readable by the same user the coding agent runs as | high | The default dev flow keeps the KEK in the macOS Keychain with an ACL restricted to the sidecar binary, or in the containerised OpenBao dev instance on Linux; a plaintext file survives only behind SAFEKEYS_ALLOW_INSECURE_KEYSTORE=1 with a permission check and a loud warning. A separate-user local mode mirrors the deployment isolation. See safekeys/dev-key-custody. |
Security Stack
- First line of defense: Capability token verification — signature, expiry, audience, and policy checks at the sidecar.
- Last line of defense: Envelope encryption with a key store holding wrapped keys; plaintext never persisted.
- Notes: The threat model is explicit about what is deferred: a fully compromised secure element plus all threshold shares, or a human pasting plaintext into a chat, remain out of scope even after Phase 3.