Architecture Change Management (TOGAF Phase H)
Auto-generated from USM decisions, risks, and future items.
Architecture Decisions (99)
| ID | Decision | Status | Source |
|---|---|---|---|
| metadata-only-logging | Log identifiers and outcomes, never values or key material. | accepted | safekeys/audit-logging |
| record-denials | Record denied attempts as first-class events. | accepted | safekeys/audit-logging |
| append-only-by-construction | Provide no mutation path for audit records rather than relying on access control alone. | accepted | safekeys/audit-logging |
| go-and-postgres | Implement the control plane as a Go service on Postgres. | accepted | safekeys/control-plane-api |
| no-create-with-value-endpoint | Deliberately omit any endpoint that accepts a secret value. | accepted | safekeys/control-plane-api |
| api-key-then-mtls | Start with API keys and add mTLS for sidecars alongside hardware binding. | accepted | safekeys/control-plane-api |
| policy-at-both-points | Evaluate policy at issuance and again locally at resolve. | accepted | safekeys/policy-engine |
| default-deny | Default to deny when no rule matches. | accepted | safekeys/policy-engine |
| enterprise-features-later | Keep SSO, compliance reporting, and rich policy authoring out of the MVP. | accepted | safekeys/policy-engine |
| policy-via-database-rules | Evaluate policy from operator-authored rules in Postgres, rebuilt per evaluation so a change takes effect without a restart. | accepted | safekeys/policy-engine |
| resolve-time-rules-now-loaded | The sidecar now loads real resolve-time rules from the control plane (cached, default-deny) instead of the previous hardcoded allow. | accepted | safekeys/policy-engine |
| policy-fail-closed-warm-cache | Policy evaluation denies when rules cannot be loaded and no cache exists; a warm cache serves last-known-good. | accepted | safekeys/policy-engine |
| systemd-single-vm-first | Ship systemd units plus a production Compose file targeting a single hardened VM as the reference deployment; defer Kubernetes manifests. | accepted | safekeys/deployment-packaging |
| os-isolation-via-systemd | Fold the sidecar's OS isolation into the systemd unit's hardening directives, with an AppArmor profile where the host supports it, rather than deferring it as separate work. | accepted | safekeys/deployment-packaging |
| socket-shared-group | Change the sidecar socket from 0600 to group-access (sidecar user plus a dedicated shared group, group-only mode) so agent processes running as a distinct user can connect. | accepted | safekeys/deployment-packaging |
| publish-by-digest | Publish CI-built images to a registry and have production pin them by digest. | accepted | safekeys/deployment-packaging |
| signing-key-holding-pattern | Deployment provisions the Ed25519 signing seed as a root-owned credential delivered to the control plane only; HSM or secure-element custody remains the Phase 1 target. | accepted | safekeys/deployment-packaging |
| credentials-as-files | Every credential is resolved from a file when a *_FILE variable is set, falling back to the environment only otherwise; the production profile refuses the environment path outright for the signing key and the key-store token. | accepted | safekeys/deployment-packaging |
| esbuild-pattern-for-cli | Distribute the CLI as @smithgray/safekeys-cli with optionalDependencies on per-platform packages containing the prebuilt binary. | accepted | safekeys/distribution |
| ghcr-canonical-dockerhub-mirror | Publish images to ghcr.io/smith-gray-pty-ltd as canonical and Docker Hub org safekeys as a mirror. | accepted | safekeys/distribution |
| no-agent-publishes | Every first publish and every account/org creation is performed by James; agents prepare packages, workflows, and the runbook only. | accepted | safekeys/distribution |
| cloudflare-pages | Host the docs and site on Cloudflare Pages, matching how USM is hosted. | — | safekeys/docs-hosting |
| two-projects-per-audience | Publish the contributor and help docs as two separate Pages projects on separate subdomains. | — | safekeys/docs-hosting |
| direct-upload-not-git-integration | Deploy by uploading the built directory from GitHub Actions, rather than connecting Pages to the repository. | — | safekeys/docs-hosting |
| correct-canonical-urls-post-build | Rewrite the generated sitemap's domain after each build as a known workaround. | — | safekeys/docs-hosting |
| marketing-site-deploys-separately | Wire the docs deploy now and add the marketing site when it is built. | — | safekeys/docs-hosting |
| cheapest-option-first | Order hardware options cheapest first: TPM 2.0, cloud confidential computing, USB token or dongle, soldered secure element. | accepted | safekeys/hardware-root |
| drop-shipped-provisioning | Support factory-provisioned devices that are drop-shipped to customers. | accepted | safekeys/hardware-root |
| no-custom-silicon-day-one | Do not require custom silicon for the MVP or Phase 1. | accepted | safekeys/hardware-root |
| defer-to-phase-2 | Keep threshold crypto and post-quantum ratchets out of the MVP and Phase 1. | accepted | safekeys/threshold-crypto |
| hybrid-not-pq-only | Use a hybrid classical plus ML-KEM-class construction rather than post-quantum only. | accepted | safekeys/threshold-crypto |
| threshold-over-single-device | Split knowledge across element and authority rather than trusting a single device. | accepted | safekeys/threshold-crypto |
| mcp-is-first | Make the MCP server the first harness integration shipped. | accepted | safekeys/integration-mcp-server |
| three-harnesses-only | Limit MVP integrations to the MCP server, the CLI exec wrapper, and the Python SDK. | accepted | safekeys/integration-mcp-server |
| examples-not-runtimes | Support further harnesses later as examples calling the same SDK or MCP tools. | accepted | safekeys/integration-mcp-server |
| mcp-holds-no-credential | The MCP server holds no control-plane API key and no key material; list and revoke are proxied through the sidecar rather than called directly. | accepted | safekeys/integration-mcp-server |
| create-takes-a-source-file | create_secret accepts a source_file path, never a value parameter. | accepted | safekeys/integration-mcp-server |
| stdio-transport-single-server | Use standard MCP over stdio with no vendor-specific code. | accepted | safekeys/integration-mcp-server |
| no-interactive-secret-prompt | create_secret takes a file path the sidecar reads; it never prompts the operator interactively and never accepts a literal value parameter. | accepted | safekeys/integration-mcp-server |
| python-first | Ship the Python SDK as the first language binding, with LangChain and LangGraph tools. | accepted | safekeys/integration-python-sdk |
| unrepresentable-plaintext | Design the API so plaintext cannot be passed or received. | accepted | safekeys/integration-python-sdk |
| delegate-all-crypto | Keep the SDK free of decryption and key handling. | accepted | safekeys/integration-python-sdk |
| zero-dependency-core | Keep the core SDK dependency-free; make LangChain/LangGraph an optional extra. | accepted | safekeys/integration-python-sdk |
| value-becomes-a-temp-file | Even the in-process value parameter is written to a 0600 temp file that the sidecar reads, rather than being sent over the socket. | accepted | safekeys/integration-python-sdk |
| return-type-is-the-guarantee | Rely on return types (CreatedSecret, ResolveResult, ObjectMetadata) having no value-bearing field, rather than on documentation. | accepted | safekeys/integration-python-sdk |
| local-channel-for-create | Send plaintext from caller to sidecar over the local authenticated Unix socket, never over the network. | accepted | safekeys/secret-creation |
| stdin-not-argv | Accept values via stdin or file only; never as a command-line argument. | accepted | safekeys/secret-creation |
| create-not-a-web-console-flow | Do not build a web console for creation in the MVP. | accepted | safekeys/secret-creation |
| transport-is-the-differentiator | Differentiate on transport — folders and tokens that agents create and move through arbitrary flows — rather than on use-time brokering alone. | accepted | safekeys/secret-transport |
| bus-agnostic-payload | Carry only folder URIs and tokens over MCP, A2A, and other agent buses. | accepted | safekeys/secret-transport |
| denylist-plus-ttl | Use a jti denylist alongside short TTLs rather than one or the other. | accepted | safekeys/token-revocation |
| authoritative-check-at-resolve | Check revocation at resolve time in the sidecar rather than trusting token validity alone. | accepted | safekeys/token-revocation |
| uri-form | Express tokens as a URI: safekey://v1/<id>?scope=<action>&aud=<env>&exp=<unix>&kid=<key-id> | accepted | safekeys/capability-token |
| short-ttl-over-long-lived | Use short TTL plus a jti denylist rather than long-lived tokens with periodic rotation. | accepted | safekeys/capability-token |
| generic-denials | Denials return a generic failure rather than the specific violated check. | accepted | safekeys/capability-token |
| jws-over-query-string | Carry the token as a standard RFC 7515 compact JWS in the URI fragment (safekey://v1/<sid>#<JWS>) rather than the blueprint's bespoke query-string claims with a separate sig claim. | accepted | safekeys/capability-token |
| alg-allowlist | Permit only EdDSA and ES256; reject alg 'none' and all symmetric algorithms (HS256/384/512). | accepted | safekeys/capability-token |
| key-custody-hsm | Require the token signing key to be HSM- or secure-element-backed from Phase 1; never a bare file in production. | accepted | safekeys/capability-token |
| ordinary-directory | Use an ordinary directory or object prefix rather than a custom container format. | accepted | safekeys/encrypted-folder |
| aes-gcm-or-chacha | Encrypt objects with AES-256-GCM or ChaCha20-Poly1305. | accepted | safekeys/encrypted-folder |
| readme-is-a-feature | Ship a README.safekeys in every folder, designed to be model-readable. | accepted | safekeys/encrypted-folder |
| manifest-is-metadata-only | The manifest may hold a wrapped DEK but never plaintext, an unwrapped DEK, or a KEK, enforced structurally via additionalProperties: false. | accepted | safekeys/encrypted-folder |
| objects-path-constraint | Require every object path to match ^objects/[A-Za-z0-9][A-Za-z0-9._-]*.enc$. | accepted | safekeys/encrypted-folder |
| openbao-or-vault | Use OpenBao or Vault Transit/KV as the MVP key store. | accepted | safekeys/envelope-encryption |
| envelope-not-direct | Wrap keys rather than encrypting secrets directly under a master key. | accepted | safekeys/envelope-encryption |
| keep-insecure-keystore-name | Keep SAFEKEYS_ALLOW_INSECURE_KEYSTORE as the file-mode opt-in rather than renaming to SAFEKEYS_DEV_INSECURE_KEYFILE. | accepted | safekeys/dev-key-custody |
| keychain-is-a-speed-bump-not-a-boundary | Document the macOS Keychain as a storage improvement, not an access boundary, and name the separate-user mode as the strong local boundary. | accepted | safekeys/dev-key-custody |
| openbao-dev-is-the-linux-default | Make the containerised dev OpenBao the default Linux dev keystore instead of the local file. | accepted | safekeys/dev-key-custody |
| exec-is-framework-agnostic | Ship the exec wrapper as a first-class MVP harness integration. | accepted | safekeys/exec-wrapper |
| minimal-env | Give the child a minimal, explicit environment rather than inheriting and augmenting the parent's. | accepted | safekeys/exec-wrapper |
| redaction-in-sidecar-not-mcp | Implement redaction in the sidecar's relay path rather than in the MCP server. | accepted | safekeys/output-control |
| mcp-deny-by-default | MCP-initiated resolves require an explicit command allowlist; without one they are refused regardless of the denylist. | accepted | safekeys/output-control |
| denylist-is-a-backstop | Keep a denylist of known dumpers for CLI and SDK resolves and document it as a backstop, not the control. | accepted | safekeys/output-control |
| commands-in-policy-not-claims | Command restrictions live in policy rules, not token claims. | accepted | safekeys/output-control |
| substrings-not-whole-value | Redact substrings of the secret of 8+ characters (or the full value when shorter), in every listed encoding. | accepted | safekeys/output-control |
| four-methods-not-one | Support env, 0600 temp file, socket/pipe, and exec rather than a single injection mode. | accepted | safekeys/secret-injection |
| exec-wrapper-preferred | Make the exec wrapper the preferred and best-documented path. | accepted | safekeys/secret-injection |
| placeholder-over-value | Return a placeholder name or path instead of a value whenever a return is needed. | accepted | safekeys/secret-injection |
| mvp-scope-socket-pipe-deferred | Ship env, file, and exec injection in the MVP; defer the long-running socket/pipe method. | accepted | safekeys/secret-injection |
| sidecar-is-the-only-resolver | Concentrate all token resolution and decryption in the privileged sidecar. | accepted | safekeys/sidecar-resolution |
| socket-request-response | Expose resolution to local callers over a Unix domain socket. | accepted | safekeys/sidecar-resolution |
| no-shared-memory | The sidecar shares no memory with agent processes. | accepted | safekeys/sidecar-resolution |
| sidecar-holds-public-keys-only | Split protocol.Signer (mint) from protocol.Verifier (public keys only). The sidecar and CLI hold a Verifier and never a Signer. | accepted | safekeys/sidecar-resolution |
| verifier-fails-closed-cold | A verifier with a cold key cache and an unreachable control plane denies every token; a warm cache serves last-known-good. | accepted | safekeys/sidecar-resolution |
| exec-is-primary-injection | The exec wrapper is the preferred injection mechanism over returning values on stdout. | accepted | safekeys/cli |
| postgres-not-embedded | Use Postgres rather than an embedded store (SQLite) for the control plane. | accepted | safekeys/control-plane-db |
| denylist-not-allowlist | Store the revocation denylist rather than an allowlist of valid tokens. | accepted | safekeys/control-plane-db |
| audit-never-contains-secrets | The audit table stores identifiers and outcomes only, never values. | accepted | safekeys/control-plane-db |
| wrapped-dek-not-in-db | Wrapped DEKs live in the folder manifest, not in Postgres. | accepted | safekeys/control-plane-db |
| go-and-postgres | Implement the control plane in Go backed by Postgres. | accepted | safekeys/control-plane |
| no-plaintext-at-control-plane | The control plane must never accept or store plaintext secret material. | accepted | safekeys/control-plane |
| mcp-first | Ship an MCP server as the first harness integration, ahead of any framework-specific SDK. | accepted | safekeys/mcp-server |
| mcp-not-in-v0-scope | Keep CrewAI, AutoGen, Pydantic AI, smolagents, and custom enterprise harnesses out of MVP scope. | accepted | safekeys/mcp-server |
| token-only-api | The SDK API accepts and returns only tokens and folder paths — never plaintext values. | accepted | safekeys/python-sdk |
| open-protocol-wedge | Position the site around the open protocol as the adoption wedge, with hardware and hosted authority as the commercial layer. | accepted | safekeys/site |
| go-sidecar | Implement the sidecar in Go rather than Rust. | accepted | safekeys/sidecar |
| separate-os-user | The sidecar runs as a different OS user from any agent process, with no shared memory. | accepted | safekeys/sidecar |
| deny-by-default | If the key store or control plane is unreachable, resolution fails closed. | accepted | safekeys/sidecar |
| ts-after-python | Ship the TypeScript SDK immediately after the MVP, not inside it. | accepted | safekeys/typescript-sdk |
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. |
Future Items (15)
| Item | Source |
|---|---|
| Windows binary. | safekeys/cli |
| Shell completion packages. | safekeys/cli |
| Partition the audit table by month and export to cold storage for retention. | safekeys/control-plane-db |
| Row-level policy scoping for the multi-tenant hosted authority. | safekeys/control-plane-db |
| Multi-tenant hosted authority with SSO and compliance reporting. | safekeys/control-plane |
| mTLS device identity binding for sidecars. | safekeys/control-plane |
| Claude Agent SDK / Claude Code hook for coding-agent .env leaks. | safekeys/mcp-server |
| TypeScript SDK and OpenAI Agents SDK adapter. | safekeys/mcp-server |
| TypeScript SDK with an identical API surface. | safekeys/python-sdk |
| OpenAI Agents SDK adapter built on the same tools. | safekeys/python-sdk |
| Interactive protocol explorer for tokens and folders. | safekeys/site |
| Hosted documentation portal for the open core. | safekeys/site |
| Secure element / TPM / cloud enclave backend for the long-term key share. | safekeys/sidecar |
| Threshold reconstruction of key material inside the element. | safekeys/sidecar |
| Framework adapters built on top of the core SDK rather than bespoke runtimes. | safekeys/typescript-sdk |
Change Governance Principles
- The LLM is never on the decryption path: No language model ever holds, receives, or can derive plaintext secret material or long-term keys.
- Agents see only opaque capability tokens: The only secret-bearing artefact an agent reasons about is a short-lived, scoped, audience-bound capability token containing zero secret material.
- Stable agent-facing interface: The public interface (tokens plus folders) stays constant as backends harden from software isolation to hardware to threshold crypto.
- Plaintext is materialised only for the consumer, then zeroised: Plaintext exists only transiently inside the sidecar's injection path for the consuming non-LLM process, and is zeroised immediately after use.
- Open protocol, commercial authority: Token and folder specifications, the sidecar reference implementation, CLI, and core SDKs are open source; the hosted authority, hardware, and enterprise controls are commercial.