stable

`@noy-db/at-*` — Sealing-key providers (trusted hosts)

The sealing-key providers: at-* hosts (env, keychain, cloud KMS) that unseal a vault without a typed secret — the one non-zero-knowledge family.

How a vault goes online without the user holding a key. noy-db encrypts everything on the client under keys derived from a secret, so normally only the user can open their vault. The at-* family covers the server-side case: a host you control — a Lambda, an EC2 box, a microservice — holds a sealing key that encrypts ("seals") a machine-generated vault secret, so your server code can open the vault and work on behalf of a user who never logs in and never memorizes a secret.

The at- prefix reads as "sealed at a trusted host." Each package supplies the sealing key from the host's environment — an env var, the OS keychain, or a cloud KMS — never hard-coded, always under your account's own access controls and rotation policy.

Be clear about the trust boundary. Unlike to-* stores and by-* transports — which only ever see ciphertext — an at-* host can decrypt the vault it unseals. This is the one non-zero-knowledge family in noy-db, and it's the point: the safeguard is scope, not secrecy. The sealed secret is stored per vault (at _meta/sealed-secret inside that vault), so a host holding a sealing key can open exactly the vaults sealed under it — nothing else. Offline-first stays the default; online is least-privilege, on infrastructure you own.

Catalog

Start with an on-host provider for local dev and single-instance / single-machine deployments — no cloud dependency, no extra credentials. Move to a cloud KMS provider once you need key rotation, an access-control audit trail (every seal/unseal is an authenticated KMS call, so the cloud's audit log records every vault open for free), or multiple instances sharing one sealing key without sharing a secret file.

On-host

PackageOne-liner
envBase64-encoded AES-256-GCM key from an environment variable — zero infrastructure.
macos-keychainKey stored in the user's macOS login Keychain — desktop apps, "logged into my Mac" = vault open.

Cloud KMS

PackageOne-liner
aws-kmsAWS KMS Encrypt/Decrypt, IAM-controlled, CloudTrail-logged; also ships a recipient-target extension.
gcp-kmsGoogle Cloud KMS Encrypt/Decrypt, IAM-controlled, Cloud Audit Logs-logged.
azure-keyvaultAzure Key Vault RSA encrypt/decrypt, RBAC-controlled, Key Vault-audit-logged; version-bound key id.

Every provider implements the same NoydbSealer contract (id, seal, unseal), so switching backends is a one-line change to sealingKey.

Compare

ProviderWhere the sealing key livespid formatKey rotation
envenv varenv:<envVar>✗ — static key; no built-in rotation
macos-keychainOS keychainmacos-keychain:<service>/<account>✗ — static key; no built-in rotation
aws-kmsAWS KMSaws-kms:<keyId>✓ — automatic rotation for symmetric keys, no app-side changes
gcp-kmsGCP KMSgcp-kms:<keyName>✓ — automatic key-version rotation, no app-side changes (cross-key migration is manual)
azure-keyvaultAzure Key Vaultazure-kv:<keyId>✗ — version-bound; rotation is a deliberate manual re-seal migration