`@noy-db/at-*` — Sealing-key providers (trusted hosts)
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
| Package | One-liner |
|---|---|
| env | Base64-encoded AES-256-GCM key from an environment variable — zero infrastructure. |
| macos-keychain | Key stored in the user's macOS login Keychain — desktop apps, "logged into my Mac" = vault open. |
Cloud KMS
| Package | One-liner |
|---|---|
| aws-kms | AWS KMS Encrypt/Decrypt, IAM-controlled, CloudTrail-logged; also ships a recipient-target extension. |
| gcp-kms | Google Cloud KMS Encrypt/Decrypt, IAM-controlled, Cloud Audit Logs-logged. |
| azure-keyvault | Azure 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
| Provider | Where the sealing key lives | pid format | Key rotation |
|---|---|---|---|
| env | env var | env:<envVar> | ✗ — static key; no built-in rotation |
| macos-keychain | OS keychain | macos-keychain:<service>/<account> | ✗ — static key; no built-in rotation |
| aws-kms | AWS KMS | aws-kms:<keyId> | ✓ — automatic rotation for symmetric keys, no app-side changes |
| gcp-kms | GCP KMS | gcp-kms:<keyName> | ✓ — automatic key-version rotation, no app-side changes (cross-key migration is manual) |
| azure-keyvault | Azure Key Vault | azure-kv:<keyId> | ✗ — version-bound; rotation is a deliberate manual re-seal migration |