Implementation Governance (TOGAF Phase G)
Auto-generated from USM feature contracts and system risks.
Feature Contracts (85)
| Feature | Contract ID | Description | Applies After | Must Have |
|---|---|---|---|---|
| safekeys/audit-logging | zero-plaintext-in-audit | Audit records must never contain plaintext or key material. | — | Records carry identifiers and outcomes only; No record contains a secret value, DEK, or KEK; Stealing the entire audit log yields no secret |
| safekeys/audit-logging | append-only | Audit records cannot be altered or deleted through the application. | — | No update or delete endpoint exists for audit records; Records are immutable once written; Storage is retained according to policy |
| safekeys/audit-logging | denials-recorded | Failed attempts are recorded alongside successful ones. | — | Denied resolves are written with a denial outcome; Denial records name the requester and target; Denial-rate analysis is possible from the log alone |
| safekeys/audit-logging | complete-attribution | A record is sufficient to answer who used what, where, and when. | — | Requester identity, scope, jti, object id, host, outcome, and timestamp present; Records join to the issuance event for the token; No record is ambiguous about which object was involved |
| safekeys/control-plane-api | no-plaintext-in-api | No endpoint may accept or return plaintext secret material. | — | Request and response bodies carry identifiers, scopes, and metadata only; The API has no create-with-value endpoint; Contract enforced by schema tests on every handler |
| safekeys/control-plane-api | authenticated-clients | Every endpoint requires an authenticated, authorised client. | — | API key authentication in the MVP; mTLS for sidecars later; Per-client scopes limit which operations are reachable; Unauthenticated requests are rejected before any state change |
| safekeys/control-plane-api | idempotent-issue-and-revoke | Issue and revoke tolerate retries without duplicating or corrupting state. | — | Revoking an already-revoked jti is not an error; A retried issue does not mint two live tokens for one logical request; State changes are transactional in Postgres |
| safekeys/control-plane-api | token-issuance-is-audited | Every issuance and revocation is recorded. | — | Principal, object, scope, audience, jti, and timestamp are recorded; Records are append-only; Records never contain secret material |
| safekeys/policy-engine | least-privilege-scope | Policy grants the narrowest scope that satisfies the request. | — | Scope is one of read, unwrap, inject-env, inject-file, sign; A broad request is denied rather than silently reduced unless a rule permits the reduction; No wildcard scope is granted implicitly |
| safekeys/policy-engine | local-policy-default-deny | Absent an explicit local allow, the sidecar denies. | — | Undefined rules do not default to permit; The default is documented and tested; Local policy is operator-editable without redeploying the sidecar |
| safekeys/policy-engine | environment-binding | Policy can bind resolution to a specific environment or audience. | — | Rules can require a matching audience or environment; A staging policy cannot be satisfied by a production token; Binding is enforced at resolve, not only at issuance |
| safekeys/policy-engine | policy-decisions-audited | Both allow and deny decisions are recorded. | — | Denials are recorded with the rule that denied; Allows are recorded with the matched rule; The audit trail explains a decision without exposing the secret |
| safekeys/deployment-packaging | no-dev-credentials-in-prod | Production artifacts must be unable to select a development credential path. | — | Production uses a persistent OpenBao server, never server -dev, and never a fixed root token; The signing seed is delivered from root-owned secret material, not a shell export or the dev key file; No production artifact sets SAFEKEYS_ALLOW_INSECURE_KEYSTORE or SAFEKEYS_REVOCATION_OFFLINE; The development Compose file is not a supported production artefact |
| safekeys/deployment-packaging | least-privilege-containers | Each image runs with the minimum privilege it needs and nothing more. | — | Both services run as a fixed non-root UID/GID; The runtime image contains no shell, package manager, or build toolchain; No image layer contains a signing key, KEK, API key, or plaintext secret; Containers drop all Linux capabilities except those a service genuinely requires; The sidecar's root filesystem is read-only apart from its socket and folder directories |
| safekeys/deployment-packaging | sidecar-host-isolation | The OS-level confinement the architecture promises is enforced by the unit and asserted by a test. | — | The sidecar runs as an OS user distinct from any agent user; The unit sets NoNewPrivileges, a system-call filter, and the Protect* / Restrict* families; The sidecar shares no memory with agent processes (private tmp, no shared dev/shm, IPC removed); An AppArmor profile or SELinux type confines the binary on hosts that support one; A hardening regression fails systemd-analyze security against a pinned exposure threshold |
| safekeys/deployment-packaging | socket-access-model | The socket is reachable by agents running as a distinct user, and by no one else. | — | The socket is owned by the sidecar user and a dedicated shared group; Socket mode grants the group access and denies all others; a world-accessible socket is a failure; A process not in the group cannot connect, even as a local user; The access model is consistent with the separate-user decision rather than contradicting it |
| safekeys/deployment-packaging | fail-closed-on-boot | A production start that cannot verify authority must not serve. | — | The sidecar refuses to start when it cannot load public keys or resolve-time policy; The sidecar refuses to start when the configured key store is unreachable or sealed; Services declare dependencies and restart policy so ordering is enforced, not assumed; Deny-by-default policy is retained; production exposes no offline or cached-allow fallback |
| safekeys/deployment-packaging | reproducible-deploy | A host runs exactly the artefact that was tested. | — | Images are referenced by immutable digest, never by a moving tag such as latest; The build is reproducible from the committed Dockerfiles and pinned base images; A rollback to a prior digest requires no rebuild; The deploy inputs (units, Compose file, config) are version-controlled |
| safekeys/distribution | official-names-only | Every distributable carries a name that is either owned by Smith & Gray or defensively reserved, and documentation names only the official channels. | — | {"npm packages publish under @smithgray":"safekeys-mcp, safekeys-sdk, safekeys-cli"}; The CLI meta package @smithgray/safekeys-cli resolves the prebuilt binary through optionalDependencies on per-platform packages (@smithgray/safekeys-cli-darwin-arm64, -darwin-x64, -linux-x64, -linux-arm64, -win32-x64 as applicable) — the esbuild pattern: no download at install time and no lifecycle scripts; Unscoped npm safekeys-mcp and safekeys-cli exist as 0.0.1 placeholders with no code and no install scripts; PyPI safekeys is the real SDK; safekeys-mcp and safe-keys are 0.0.1 placeholders pointing at safekeys; Docker images publish as safekeys/sidecar and safekeys/control-plane with ghcr.io/smith-gray-pty-ltd/safekeys-* as the canonical mirror; A crates.io safekeys 0.0.1 placeholder crate reserves the Rust name; Docs and install snippets reference only official names and never the unscoped npm safekeys package owned by a third party; SECURITY.md states the official package names so impersonation is detectable |
| safekeys/distribution | gated-release-pipeline | Publishing is gated, reproducible, and provenance-carrying; nothing ships without a human click. | — | A v* tag runs build, the full test suite, and the red-team job before any publish job; Every publish job targets a GitHub release environment whose required reviewer is James; npm packages carry publishConfig access public and provenance true, published via npm provenance from Actions OIDC — including every per-platform CLI package; PyPI publishes via Trusted Publishing (OIDC) with no stored API tokens; Container images are multi-arch (amd64, arm64), signed with cosign keyless and accompanied by an SBOM attestation, pushed to GHCR as canonical and Docker Hub as mirror; Docker Hub authenticates with a scoped access token (push on the safekeys org only) held in the release environment, the one registry without an OIDC option; Go binaries, checksums, and SBOMs attach to the GitHub Release; a Homebrew formula update is generated for a future tap; A dry-run mode exercises the whole pipeline without publishing |
| safekeys/distribution | verify-your-install | Installers can verify what they installed, and the verification commands are documented where operators will look for them. | — | Container images verify with cosign keyless, pinned to the repository's workflow identity, with the command documented for both GHCR and Docker Hub; npm packages expose provenance and the docs say npm audit signatures to confirm it; Release binaries come with sha256 checksums and a documented verification command; The verify commands are in SECURITY.md and on the docs security page, and fail loudly when identity or checksum does not match |
| safekeys/distribution | release-runbook | The reservation surface is documented so a human can execute the one-time and per-release steps. | — | docs/RELEASING.md lists every reserved name with registry, name, status, owner account, and publisher — including every per-platform CLI binary package; The one-time human steps (org creation, trusted publishing, environment, tap repo) are listed in order and marked as James's actions; Per-release steps are listed separately; {"The empty npm org hold for @safekeys/* is noted":"create it, publish nothing"}; A vanity Go module path (safekeys.ai/go) is recorded as a future TODO in the site spec, not switched now |
| safekeys/distribution | package-hygiene | The packages themselves are hardened against supply-chain abuse. | — | No postinstall or any lifecycle scripts in any npm package; Minimal runtime dependencies in every real package; npm 2FA required for the smithgray org and PyPI 2FA on the accounts that publish; Versions align at 0.1.0 across Go, npm, and PyPI with a CHANGELOG.md entry covering output-control and dev-key-custody; README and package descriptions mark 0.1.0 as early/preview; A curl | sh fallback for the CLI documents downloading the GitHub Release binary and verifying its sha256 checksum; it is secondary to the npm packages |
| safekeys/docs-hosting | audience-separation | The public site must never contain pages intended only for contributors. | — | The help docs are a filtered set, not a copy; Architecture, design and data-model pages are absent from the public build; The deploy asserts the filter rather than trusting the flag; A failed assertion blocks publication |
| safekeys/docs-hosting | canonical-urls-are-ours | Published pages must identify themselves as belonging to safekeys.ai. | — | The sitemap references the safekeys.ai domains, never a third party's; No published page advertises another project's canonical URL; The correction is applied on every build, because the generator rewrites it |
| safekeys/docs-hosting | deploy-uses-the-pinned-toolchain | What is published is what CI validated. | — | The deploy job pins the same USM version as CI; The deploy runs only from a passing validation; Generated files are not committed, so the site cannot drift from the specs |
| safekeys/docs-hosting | cache-policy-preserves-freshness | A redeploy must be visible immediately without losing asset caching. | — | HTML responses revalidate rather than being served stale from the edge; Hashed assets are cached immutably; Headers are written after the build, since each build clears the output directory |
| safekeys/docs-hosting | deploy-artifacts-carry-no-secrets | What is uploaded is content only. | — | The upload token exists only in the workflow environment; No credential is embedded in the built site; The token is scoped to Pages deployment, not account-wide |
| safekeys/docs-hosting | rollback-is-possible | A bad publish can be undone without a rebuild. | — | Each deployment is recorded against its commit; A previous deployment can be promoted; The workflow can be run manually for a deliberate republish |
| safekeys/hardware-root | key-not-in-host-ram | In the hardware phase the long-term share must not exist in general-purpose host memory. | — | Unwrap occurs at or behind the device boundary; The sidecar never receives the long-term share; An OS-level compromise cannot extract the share |
| safekeys/hardware-root | agent-api-unchanged | Adding hardware must not change the agent-facing interface. | — | Tokens and folders are unchanged; No SDK or MCP tool change is required; Only the sidecar's backend configuration changes |
| safekeys/hardware-root | attestation-before-unwrap | The device proves its identity and state before any unwrap. | — | Mutual attestation occurs at binding and on unwrap; A failed attestation denies the operation; Binding is recorded against customer policy |
| safekeys/hardware-root | tamper-and-loss-handling | Physical compromise and device loss both fail closed. | — | Tamper response zeroises device state; Lost devices are revocable by serial; Revocation takes effect at the authority |
| safekeys/threshold-crypto | no-single-holder | No single component may be able to reconstruct the key. | — | Key knowledge is split with a threshold policy; The secure element alone is insufficient; The authority alone is insufficient |
| safekeys/threshold-crypto | attest-before-unwrap | Remote attestation is required before any unwrap. | — | Attestation covers device identity and state; Failure denies the operation; Attestation is not optional or bypassable |
| safekeys/threshold-crypto | ephemeral-only | Reconstructed key material exists only inside the secure element, only for one operation. | — | No reconstruction in host memory; Material is destroyed after the operation; Nothing persists between operations |
| safekeys/threshold-crypto | post-quantum-sessions | Control-plane sessions are protected against harvest-now-decrypt-later. | — | Hybrid classical plus PQ key establishment; Forward-secret ratcheting of session keys; Documented as Phase 2, not MVP |
| safekeys/integration-mcp-server | token-only-tool-results | MCP tool results never contain resolved plaintext. | — | Results carry tokens, folder paths, or status codes; No tool returns a resolved value; Tool arguments carry tokens, not values; Relayed command output is redacted and size-capped by the sidecar before it reaches a tool result |
| safekeys/integration-mcp-server | single-server-many-runtimes | One MCP server serves all compatible runtimes without per-vendor code. | — | Implementation uses the standard MCP protocol and stdio transport; No vendor-specific branching exists; Adding a runtime requires no change to the server |
| safekeys/integration-mcp-server | delegate-to-sidecar | The MCP server performs no crypto and owns no key material. | — | All resolution is delegated to the local sidecar; The server holds no keys and no ciphertext handling; Sidecar unavailability surfaces as an error, never a fallback |
| safekeys/integration-mcp-server | out-of-scope-harnesses | Non-MCP harnesses are explicitly out of MVP scope. | — | CrewAI, AutoGen, Pydantic AI, smolagents, and custom enterprise harnesses are not built in v0; They are supported later as examples calling the same SDK or MCP tools; No dedicated runtime adapters are created |
| safekeys/integration-python-sdk | token-only-surface | The SDK's public API accepts and returns tokens and paths, never values. | — | No public function returns a resolved plaintext value; create_secret returns a token, not the value; resolve_for_tool returns a status or placeholder |
| safekeys/integration-python-sdk | no-plaintext-in-context | Using the SDK cannot place plaintext into model context. | — | Values are read from the sidecar channel, not passed as literals from the agent; Tool call arguments carry tokens; The SDK's docstrings and examples never suggest pasting a value |
| safekeys/integration-python-sdk | sidecar-is-the-transport | The SDK delegates all resolution to the sidecar rather than implementing crypto. | — | The SDK contains no decryption or key handling code; Communication is over the local Unix socket; Failure to reach the sidecar is surfaced as an error, never a fallback |
| safekeys/integration-python-sdk | langchain-tool-parity | The LangChain and LangGraph tools behave identically to the raw SDK calls. | — | Tool definitions wrap the same SDK functions; Tool schemas expose tokens and paths only; Tool outputs never include values |
| safekeys/secret-creation | plaintext-not-through-model | Creation must never require the plaintext to pass through model context, logs, or tool arguments. | — | The caller hands the value to the sidecar directly over a local channel; Values are supplied via stdin or file, not as command arguments; Only a token is returned to the agent |
| safekeys/secret-creation | encrypt-before-persist | Plaintext is encrypted before anything durable is written. | — | A fresh DEK is generated per object; Only ciphertext is written to the folder; The plaintext buffer is zeroised after encryption |
| safekeys/secret-creation | token-returned-not-value | The creation response contains a handle, never the secret. | — | Response carries a capability token and/or folder path; No value is echoed back; The token contains no secret material |
| safekeys/secret-transport | transport-is-inert | Moving a secret must not require or reveal key material. | — | Transport carries folders and tokens only; No unwrap occurs during transport; Compromise of a transport channel yields ciphertext and tokens, not values |
| safekeys/secret-transport | tokens-bounded-to-audience | A token valid in one environment is not automatically valid in another. | — | aud binds the token to its intended resolver or environment; A token used outside its audience is denied; Cross-environment use requires a new token |
| safekeys/secret-transport | transcripts-stay-clean | Agent-to-agent handoff leaves no plaintext in any transcript, log, or tool call. | — | Handoff payloads contain only paths and tokens; The two-agent demo asserts no transcript contains plaintext; Tool-call arguments never carry values |
| safekeys/token-revocation | immediate-effect | Revocation must take effect without waiting for token expiry. | — | The denylist is consulted on every resolve; No caching path can serve a revoked token; Effect is observable on the next resolve attempt |
| safekeys/token-revocation | revoke-is-audited | Revocation is itself an auditable event. | — | The revoking principal, target, and timestamp are recorded; The audit record survives in the append-only log; Revocations are queryable alongside resolve history |
| safekeys/token-revocation | device-revocation-by-serial | In the hardware phase, a lost device can be revoked by its serial. | — | Device identity is bound at provisioning; Revocation invalidates the binding at the authority; No re-provisioning of the same serial without operator action |
| safekeys/capability-token | token-contains-no-secrets | A capability token must never contain plaintext, key material, or anything that yields it. | — | Claims are limited to object identifier, scope, audience, time bounds, unique id, and signature; No field may carry the secret value, a DEK, or a KEK; A token captured from a prompt or log is not sufficient to decrypt a folder without a reachable sidecar and key authority |
| safekeys/capability-token | short-lived-and-scoped | Tokens are least-privilege and short-lived by construction. | — | TTL measured in minutes to hours, never days; scope is one of read, unwrap, inject-env, inject-file, sign; aud binds the token to an intended resolver identity or environment |
| safekeys/capability-token | revocable | Every token can be invalidated immediately, independent of its TTL. | — | A unique jti is issued and recorded at mint time; Revocation is enforced by a denylist checked on every resolve; Revocation takes effect without waiting for expiry |
| safekeys/capability-token | signature-verifiable | The sidecar can verify authenticity offline of the issuing control plane's authority. | — | Tokens are signed and carry a key id; Signature verification happens before any key-store interaction; An unverifiable token is denied |
| safekeys/encrypted-folder | folder-is-inert | A folder on its own must be useless without a live token and a reachable key authority. | — | Only ciphertext objects, a manifest, and a no-secret README are present; No key material, DEK, or KEK is stored in the folder; Copying the folder does not increase cryptographic exposure |
| safekeys/encrypted-folder | manifest-is-metadata-only | The manifest describes structure and references but never values. | — | Object ids, content-type hints, token references, wrapping key ids, and hashes only; No plaintext, no recoverable key bytes; A manifest leaking entirely must not yield any secret |
| safekeys/encrypted-folder | readme-is-agent-safe | The README is deliberately readable by humans and models. | — | Explains what the folder is and how to use it; Contains no secrets and no key material; Safe to surface in an agent's context |
| safekeys/envelope-encryption | kek-never-leaves-store | The long-term key-encryption key must never be exported from the key store in the MVP, and never leave the secure element in later phases. | — | Only wrapped DEKs are persisted outside the key store; The sidecar receives unwrapped DEKs transiently, never KEKs; No code path writes a KEK to disk, a log, or a response |
| safekeys/envelope-encryption | per-object-dek | Every object is encrypted under its own random DEK. | — | A DEK is generated fresh per object, never reused across objects; Compromise of one DEK exposes exactly one object; DEKs are high-entropy random values from a CSPRNG |
| safekeys/envelope-encryption | transient-and-zeroised | Unwrapped key material and plaintext exist only for the duration of a resolve. | — | The DEK is zeroised immediately after use; The plaintext buffer is zeroised immediately after injection; Neither is written to logs, traces, or crash dumps by design |
| safekeys/envelope-encryption | no-ai-cloud-kms-root | A multi-tenant AI-cloud KMS must not serve as the root of trust. | — | The root key store is self-hosted, then an HSM or secure element; The MVP key store is OpenBao or Vault, not a model provider's KMS; Documented explicitly so an integrator does not substitute a provider KMS |
| safekeys/dev-key-custody | default-dev-no-readable-kek | The default development flow must not leave a key-encryption key readable by the same OS user the coding agent runs as. | — | The default dev flow leaves no key material — KEK or token signing seed — readable by the agent user as a plaintext file in the repo or home directory; macOS stores the dev KEK and signing seed as Keychain items outside the working tree; the ACL raises the bar but is NOT an access boundary (measured: same-user processes read silently), so the separate-user mode is the named boundary; Linux stores the dev KEK in a containerised OpenBao dev instance running as its own user, never a plaintext file; The plaintext key-file path is removed from the default dev flow; dev-up refuses to start when a stale plaintext key file exists without the insecure opt-in, and prints the one-line migration command |
| safekeys/dev-key-custody | insecure-file-strict | The plaintext key-file mode is opt-in, loud, and refuses unsafe permissions. | — | File mode requires SAFEKEYS_ALLOW_INSECURE_KEYSTORE=1 explicitly; Startup prints a loud warning naming the mode not for real secrets when file mode is active; The sidecar refuses to start with a key file that is group- or world-readable; Documentation marks file mode as not for real secrets |
| safekeys/dev-key-custody | separate-user-socket | A documented local mode reproduces the deployment's user separation on a developer machine. | — | A documented mode runs the sidecar as a dedicated user with agents in a shared group; The sidecar verifies socket peer credentials on every connection; A process outside the allowed group is denied even if filesystem permissions change; Key material and .dev/ state are gitignored and excluded from image build contexts |
| safekeys/exec-wrapper | env-scrubbed | The wrapped command must not inherit the full ambient environment. | — | The child gets a minimal, explicit environment; The child does not inherit the agent's or shell's full variable set; Only the requested secrets are added by name |
| safekeys/exec-wrapper | exit-code-only | The wrapper returns a status, never a value. | — | Success is communicated by exit code; The wrapper does not echo resolved values to stdout or stderr; Arguments to the wrapper never contain plaintext |
| safekeys/exec-wrapper | token-not-plaintext-argv | The command line carries a token, not a secret. | — | The token appears in argv, which is not sensitive; No plaintext ever appears in argv; Process listings reveal nothing sensitive |
| safekeys/output-control | output-redacted-in-sidecar | Any output the sidecar captures and relays through its API is scanned for the resolved value before it leaves the sidecar. | — | Redaction is implemented in the sidecar, not the MCP server — every socket client benefits and the agent-adjacent process is never trusted to redact; Scanned encodings cover raw bytes, base64, base64url, hex, percent-encoding, JSON string escaping, and the value split across adjacent output lines or chunks; Substrings of the value of 8+ characters (or the full value when it is shorter) are matched in every listed encoding, so partial echoes like cut -c1-20 are caught; Each match is replaced with [REDACTED:safekeys]; A redaction event is recorded in the audit log containing no value material |
| safekeys/output-control | status-only-default | The default resolve_for_tool response carries an exit code and redacted output capped at 4 KiB; larger or uncapped output requires explicit policy. | — | The default response carries the exit code, redacted stdout and stderr capped at 4 KiB; Uncapped or full-output mode is granted only by an explicit policy allowance for the token's scope and object; Redaction applies in every output mode, including policy-allowed full output; Exec-wrapper runs that inherit the operator's terminal streams are documented as out of scope (a human watching their own terminal is not the threat) |
| safekeys/output-control | command-policy | Policy rules can bind the commands a resolve may run, per object and scope; MCP-initiated resolves are denied unless an allowlist exists. | — | A policy rule may carry allowed command specifications: exact executable path plus argument patterns; When a rule governing the request carries commands, the requested command must match one specification or the resolve is denied; An MCP-initiated resolve with no command allowlist governing its token and scope is refused, with a clear error telling the operator to add an allowlist; Command restrictions live in policy rules, not token claims — the token schema stays frozen and conformance vectors are unaffected; The MCP tool description states that output is redacted and that commands are policy-limited |
| safekeys/output-control | backstop-denylist | When no command allowlist governs a CLI or SDK request, known secret-dumping commands are refused as a backstop; the backstop never applies to MCP-initiated resolves, which require an allowlist outright. | — | With no allowlist, env, printenv, set, export, cat, head, tail, less, more, echo, printf, tee, cp, mv, dd, base64, xxd, od, hexdump, strings, and any interpreter invoked with an inline-code flag (sh/bash/zsh/fish -c, python/python3 -c, node -e/--eval, perl -e, ruby -e, php -r, awk, osascript -e) are refused for CLI and SDK resolves; The denial is audited with a reason and no value; Documentation states the denylist is a backstop, not the control — the controls are the allowlist and redaction |
| safekeys/output-control | no-secret-on-argv | The resolved value reaches the consumer only through its environment or a 0600 file, never the command line. | — | Injection passes values via child environment or 0600 temp file only; No code path places the resolved value in argv; Tests assert /proc-style argument inspection cannot reveal the value |
| safekeys/output-control | audit-and-honest-claims | Redactions and command denials are recorded without values, and the security claims are written down honestly. | — | Redaction events and command denials appear in the audit log with no secret material; The README gains a Security guarantees and limits section stating what is now mitigated and what remains — network exfiltration by a malicious allowed command, a file the allowed command can write for the agent to read later, and a rooted host; That section is written so the marketing site may quote it verbatim |
| safekeys/secret-injection | prefer-exec-and-env | Exec-wrapper and env injection are preferred over returning values to a caller. | — | Documentation steers integrators to exec-wrapper and inject-env first; Returning resolved values on an agent's stdout is not a supported mode; A placeholder name or path is returned in place of a value |
| safekeys/secret-injection | value-scoped-to-consumer | An injected value is visible only to the intended consuming process. | — | Temp files are mode 0600 and owned by the consumer; Env injection targets the child process, not the agent's own environment; The agent's process cannot read the injected value back |
| safekeys/secret-injection | injection-is-cleaned-up | Transient injection artefacts do not outlive the consumer. | — | Temp files are removed when the consumer exits; Plaintext buffers are zeroised after delivery; No injection artefact is left in a world-readable location |
| safekeys/sidecar-resolution | resolution-only-in-sidecar | No component other than the sidecar may resolve a token or decrypt an object. | — | The sidecar runs as a different OS user from any agent process; No shared memory exists between the sidecar and agents; SDKs, MCP server, and CLI delegate resolution to the sidecar rather than implementing it |
| safekeys/sidecar-resolution | verify-before-unwrap | No key-store interaction may occur before the token passes every check. | — | Signature, expiry, audience, scope, and denylist checks all precede unwrap; A failed check results in no unwrap attempt; Verification is not skippable by configuration |
| safekeys/sidecar-resolution | deny-by-default | Absent, ambiguous, or failed authorisation results in denial. | — | No implicit trust from network origin or process identity alone; Unreachable key store or control plane fails closed; Local policy default is deny when unspecified |
| safekeys/sidecar-resolution | agent-gets-status-not-value | The agent-side caller receives a success or deny signal, never the resolved value. | — | Resolution responses carry a status code, a placeholder name, or a path; Values are never returned on the agent's stdout; The caller cannot read the injected value back through the sidecar API |
| safekeys/sidecar-resolution | audit-without-plaintext | Every resolve attempt is recorded without recording the secret. | — | Records include requester, scope, jti, object id, host, and outcome; Records never contain plaintext, DEKs, or KEKs; Denials are recorded as well as successes |
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. |
Risk Summary
| Severity | Count |
|---|---|
| high | 5 |
| medium | 3 |