Risks & Mitigation
System Risks
| ID | Title | Severity | Status | Mitigation |
|---|---|---|---|---|
| rooted-os | Rooted OS or compromised local agent process | high | identified | Process isolation in the MVP; secure element, TEE, or TPM binding in Phase 1. Plaintext remains transient and zeroised. |
| stolen-token | Stolen or replayed capability token | medium | identified | Short TTL, audience binding, scope least-privilege, jti denylist revocation, and optional mTLS device identity. |
| provider-kms-exposure | Multi-tenant AI-cloud KMS used as the root | high | mitigated | Do not use multi-tenant AI-cloud KMS as root. Self-hosted key store, then HSM or secure element. |
| quantum-harvest-now | Harvest-now-decrypt-later against long-lived ciphertext | medium | accepted | Explicitly not an MVP concern. Hybrid KEM and ratchet in Phase 2. |
| human-pastes-plaintext | A human pastes plaintext into a chat | high | accepted | 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 | mitigated | 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. |
| network-exfil-allowed-command | An allowed command exfiltrates the secret over the network or via a written file | medium | accepted | Command allowlists bind high-value tokens to exact executables and argument patterns. The residual risk is stated in the README's Security guarantees and limits section rather than claimed away. |
| dev-kek-agent-readable | The development KEK is readable by the same user the coding agent runs as | high | mitigated | 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. |
Severity Summary
- high: 5
- medium: 3
Service Risks
Safekeys CLI
- A user may pipe plaintext in a way that lands in shell history or process listings; the CLI must prefer stdin and file inputs over argv.
Control Plane API
- Control plane credential compromise could mint tokens — mitigated because the plane holds no plaintext and the master key lives in the key store or hardware element.
- Postgres is a single point of failure for policy and audit; MVP accepts this with backups.
Safekeys MCP Server
- An MCP host could log tool arguments; tool handlers must return only tokens and status, never resolved values.
Python SDK
- A developer could bypass the SDK and handle plaintext directly; the SDK's value is that its API surface makes the safe path the easy path.
Safekeys.ai Site
- Public messaging must not overstate the MVP's guarantees; the threat model page is the source of truth for what is and is not mitigated.
Sidecar / Resolver
- A rooted host can observe the sidecar's process memory — the MVP relies on process isolation only; Phase 1 adds secure element / TEE / TPM binding.
- Long-running sidecar process holds transient DEKs in memory; minimise lifetime and zeroise deterministically.
TypeScript SDK
- Ships after the Python SDK, so API drift between the two SDKs is a risk; both must mirror the same contract.