# Production checklist ```{warning} Version 4 is a release candidate: it is not independently audited, and it is under public review before 4.0.0. The envelope format is frozen for 4.0. This checklist describes how the SDK is meant to be deployed once it is released. ``` ## Keys - [ ] The primary key lives in a key service or HSM, where it cannot be exported. - [ ] Every envelope has at least two recipients that fail independently: a key service and an offline escrow key, a [quorum](quorum-recovery.md), or a second region or cloud. ([Rotation and recovery](rotation-and-recovery.md)) - [ ] Recovery from the escrow or quorum key is rehearsed on a schedule. - [ ] Sealing services hold only wrap permission or public keys; opening services hold unwrap permission. ([Key services](key-services.md)) - [ ] Retired keys stay in `decryption_keys` until a rewrap job has moved every envelope; alias re-pointing is planned around the five-minute resolution cache. - [ ] Keys that must not change silently, such as an escrow key, are pinned to a version. ## Policy and context - [ ] Services use `Policy.enterprise` (or `Policy.fips`) with an explicit provider list, and an audit sink. ([Policies](policy.md)) - [ ] Policy documents are kept in version control and reviewed like code; `policy_id` is logged with deployments. - [ ] Every envelope is bound to its owner and purpose through the context, for example tenant, table, and record; `required_context_keys` enforces the keys that must be present. - [ ] No secrets are put in the context. It is authenticated, not encrypted, and it must be supplied again to open. ## Key-service clients - [ ] Client timeouts fit within `provider_timeout_ms` (30 seconds by default). boto3 clients make one attempt per call (`total_max_attempts: 1`, enforced) and hvac clients have a timeout within the deadline; the policy's bounded retries apply instead. - [ ] `verify_provider` has passed against a test key in each environment. - [ ] High-volume paths use [hierarchical keys](multi-tenant.md), so the key service sees one call per branch key per cache period, not one per envelope. ## Audit and monitoring - [ ] Events go to an `AuditChain` whose signing key the data path cannot use, and checkpoints are published where the writer cannot change them. ([Audit and observability](audit-and-observability.md)) - [ ] Metrics alert on `AUTHENTICATION_FAILED`, `KEY_NOT_FOUND`, and on key service errors and latency. - [ ] Error handling branches on `ErrorCode`, never on messages, and never retries authentication or context failures. ([Errors](../reference/errors.md)) ## Data handling - [ ] Data over 16 MiB goes through `seal_stream` and `open_stream`, with a transactional sink; output is never consumed before the operation returns. - [ ] `open_range` is used for random access only; full verification uses `open` or `open_stream`. - [ ] The metadata an envelope exposes (key identifiers, recipient count, sizes) is acceptable where envelopes are stored, or the storage is access-controlled. - [ ] Where the origin of data matters, it is signed as well: envelopes authenticate recipients, not senders. ## Platform - [ ] `cryptosuite doctor` passes on the production image, and reports ML-KEM when post-quantum recipients are used and `fips_backend` when FIPS mode is required. - [ ] Hosts are hardened as for any service that handles keys: Python cannot guarantee that secrets are erased from memory, and code in the same process can read what the SDK reads. - [ ] One `Protector` per configuration is shared across threads; it is immutable and thread-safe. ## Incidents - [ ] The [runbooks](runbooks.md) for key compromise, escrow compromise, key-service outage, authentication failures, and audit-trail failures have been adapted to your deployment and rehearsed. ## Before upgrading - [ ] The [changelog](https://github.com/Psychevus/cryptography-suite/blob/main/CHANGELOG.md) has been read. Until the format is frozen at the first release candidate, envelopes written by one pre-release are not guaranteed to open in the next.