Skip to content
Docs · Architecture

Security

How the Vault is built

The parts of the Vault, what each one can read, and how a Sensitive secret is stored, revealed and kept safe when the vault wakes up. With a diagram.

Updated

On this page

The Vault is spread over a few parts on purpose, so that no single one of them can read your secrets. A Sensitive secret is encrypted in the browser of the person who stores it and opened only in the browser of someone who holds it. Everything on our side, from the app’s database to the vault service and its storage, holds ciphertext and public keys.

This page shows the parts, what each one can read, and three things that happen: storing a secret, revealing it, and the vault waking up. It zooms in on the Vault box of the whole system’s diagram, in How Yomenie is built.

The Vault's architecture. On your side: your browser, where your passkey's PRF output unwraps your holder key (an X25519 key pair) and Sensitive values are sealed and opened with HPKE, the only place they exist in plain text; and the workspace recovery sheet, on paper with an owner. Inside Cloudflare: the Worker at yomenie.us handles sign-in and step-up, routes /app and /api to the app container (1, 2), keeps the Worker secrets and hands each one only to the container that needs it (5), and once a day copies each audit chain's head to a locked R2 bucket (7). The app container runs the web app and the API, checks who may do what, and calls the vault over vault.internal with a JWT signed for that one call, valid 60 seconds (3). The vault container, written in Rust after OpenBao and with no internet access, holds the key hierarchy (seal key, root key, keyring, a keyring per workspace, a data key per version), unseals itself at start, checks recovery shares (any 2 of 3, held by three people), enforces its ACL and keeps holder copies it can't open in KV v2, with an HMAC'd, hash-chained audit log; it stores everything as ciphertext in its own D1 database, yomenie-vault, over vaultdb.internal (4). Outside Cloudflare, the API's Postgres, a private server reached over Workers VPC (6), keeps key records, who holds each, holder public keys, passkey wraps and the recovery public key. Standard values are off for now. YOUR SIDE Your browser a holder's device Passkey PRF output, never sent Holder key X25519, private half wrapped by the passkey Sensitive value sealed and opened here with HPKE, shown 30 s Recovery sheet workspace recovery key, on paper with an owner Postgres the API's database, private, reached over Workers VPC · key records and holders · holder public keys · passkey wraps (sealed) · recovery public key CLOUDFLARE Worker yomenie.us Sign-in email links, passkeys, step-up Daily anchor audit chain heads to R2 Routes /app, /api with who you are Worker secrets each only to its container App container Next web app + API Checks who may roles, access, step-up A JWT per call Ed25519, 60 s, once: one key, one action Vault container Rust, after OpenBao, no internet Barrier and keys seal key → root key → keyring, one per workspace → a data key per version AES-256-GCM; unseals at start recovery shares: any 2 of 3 ACL a 60 s token, one secret KV v2 copies it can't open Audit HMAC'd, hash-chained D1 yomenie-vault ciphertext only R2 anchors one a day, locked 1 2 3 4 5 6 7 Plaintext Sensitive values: only in a holder's browser Ciphertext and public keys only Offline, on paper Standard values: off for now
Numbers mark the connections the flows below refer to.

The parts

Your browser. The only place a Sensitive value is ever readable. The first time you use your passkey in Yomenie, in that same passkey touch, your browser makes your holder key, an X25519 key pair. Its private half is wrapped with a key derived from your passkey’s PRF output (a secret your passkey computes and never sends), so it opens only with that passkey or your backup. Your browser seals values to holders with HPKE (RFC 9180) and opens your own copy. An unlocked holder key stays in that tab’s memory for 10 minutes, then it’s gone; nothing is kept after a reload.

The recovery sheet. The workspace recovery key’s private half, printed once by an owner and kept on paper. Every Sensitive value also gets a copy sealed to its public half, so a secret isn’t lost when everyone holding it loses every passkey. It’s never sent anywhere. See What you need to keep.

The Worker (yomenie.us). Signs you in with email links and passkeys, asks you to confirm it’s you before sensitive actions, and passes your requests to the app container with who you are (1, 2). It holds the Worker secrets and gives each container only its own: the seal key and the two public keys to the vault container, the two signing keys to the app container (5). Once a day it copies each audit chain’s head to R2 (7).

The app container. Yomenie’s web app and API. It checks every request: your role, whether you have access to the key, and step-up. It never sees a Sensitive value, only sealed copies passing through. To ask the vault for anything it signs a short JWT (Ed25519, valid 60 seconds, used once) naming the workspace, the person, one action and one secret, and calls vault.internal, a private address that only the app container can reach through the Worker (3). The vault has no public route.

Postgres (the API’s database). A private server, reached over Workers VPC (6). For the Vault it keeps the register (names, owners, levels, who has access, who holds a copy), each person’s holder public key and passkey wraps, and the workspace’s recovery public key. No secret value is ever stored here.

The vault container. A small Rust service built after OpenBao, with no internet access. Every entry it writes goes through its barrier: AES-256-GCM with the entry’s path as associated data, so an entry can’t be moved to another path or workspace. Its keys form a chain: the seal key unwraps the root key, the root key opens the keyring and one keyring per workspace, and each keyring wraps a fresh data key per secret version. It unseals itself from the seal key when it starts. Three people each hold one of three recovery shares; any two together authorise operator actions (seal it, rotate its keys), and one alone does nothing. Its ACL lets each 60-second token reach one secret with one action. Sensitive copies sit in its KV v2 store as blobs it can’t open, and every request goes into an audit log that is HMAC’d and hash-chained per workspace.

D1 yomenie-vault. The vault’s own database, separate from Postgres, reached over vaultdb.internal (4). It holds ciphertext only: even secret names are encrypted or stored as salted HMACs. The audit chain lives here too, append-only.

R2 anchors. One small file a day with the head of every audit chain, in a bucket with a lock, so it can’t be changed or deleted. A chain that was later cut short or rewritten no longer matches its anchor.

Standard values are off for now. Standard secrets are records only: the vault would open those itself, and its seal key and database are with the same cloud provider today. They come back once the seal key moves to a separate key service. Coming: The Vault's key in a separate key service, on the roadmap Why.

Storing a Sensitive secret

  1. You type the value on the secret’s page. Your browser seals one copy to each holder’s public key (the owner and everyone it’s shared with) and one to the workspace recovery key, with HPKE. The value never leaves the page in plain text.
  2. The sealed copies go through the Worker to the API (1, 2). The API checks you may store it, and that the copies cover exactly the people who should have one, sealed to their current keys and the current recovery key.
  3. The API signs a write JWT for that one secret and sends the copies to the vault (3). The vault stores each as a holder blob, encrypted again under the workspace’s keyring, and writes the request to the audit chain in the same batch.
  4. The vault writes it all to D1 as ciphertext (4). Postgres records who holds a copy of which version (6), never the value.

Revealing a Sensitive secret

  1. You press Reveal and touch your passkey once. That one touch confirms it’s you to the Worker and gives your browser the PRF output that unwraps your holder key.
  2. The API checks you have access, then signs a reveal JWT naming the secret and you as the holder (1, 2, 3). Its token can read only your copy.
  3. The vault returns your copy, still sealed to your holder key, and logs the request (3, 4). The API passes it on without being able to open it.
  4. Your browser opens it and shows the value for 30 seconds. If you aren’t the secret’s owner, the owner is told.

Sharing works the same way in reverse: a holder opens their copy in their browser and seals a new one to the person they share with.

The vault waking up

The vault’s container sleeps after 15 minutes without requests, and holds no keys while it sleeps.

  1. The next save or reveal calls vault.internal (3). Cloudflare starts the vault’s container, and the Worker passes it the seal key and the API’s public keys, nothing else (5). Opening the Vault pokes the vault in advance, so it’s usually awake by the time you press Reveal.
  2. The vault reads its sealed root key from D1 (4), unwraps it with the seal key, and opens its keyrings. Nobody types anything: this is auto-unseal. With a missing or wrong seal key, or a damaged entry, it stays sealed and refuses every request rather than guess.
  3. Meanwhile the page says Opening the vault… with a progress bar, and the API retries for about 35 seconds. Waking takes a few seconds (4 to 29 measured).

What someone gets if they take…

What’s taken What it opens
The Postgres database The register: names, owners, who has access. Public keys and passkey wraps, which open only with the passkeys. No values.
The vault’s D1 database Nothing. Every entry is encrypted, and the root key inside is sealed by the seal key.
The seal key Nothing on its own. It only unwraps the root key stored in D1.
D1 and the seal key together The vault’s own records, and Standard values if any were stored (they’re off for now). Sensitive values stay closed: the vault only ever had copies sealed to people’s holder keys.
One recovery share Nothing.
Two recovery shares Operator actions on the running vault (seal it, rotate keys, manage workspaces). They are also the vault’s escrow: if its seal is ever lost, two of them open it, so together with a copy of D1 they would open Standard values. That’s why three different people hold them and no two are ever kept together. The vault has no public route, and Sensitive values stay closed.
A person’s laptop, without their passkey No Sensitive values. The holder key isn’t stored on the laptop; its wraps are in Postgres and open only with the passkey. An unlocked key lives in an open tab for at most 10 minutes.
The recovery sheet Nothing without owner access to the workspace. With it, every Sensitive secret’s recovery copy, and every owner is told the moment it’s used.
One holder’s passkey, for a Critical secret One share, which gives nothing away. A Critical secret opens only when a second holder approves with their own passkey, and it has no recovery copy, so the recovery sheet doesn’t open it either.

The seal key and the recovery shares are held by the people who run Yomenie, apart from your workspace’s data. You keep only your passkeys and, if you’re an owner, the recovery sheet.

How it follows OpenBao

The vault follows OpenBao, the open-source fork of HashiCorp Vault, for every security mechanism: the barrier’s stored format and keyring byte for byte, auto-unseal (a static seal key now, a Google Cloud KMS key once it moves), recovery shares that authorise operations, namespaces for workspaces, JWT login (EdDSA only), the ACL policy engine, KV v2 and HMAC’d audit entries. Where it differs, the reason is written down: each workspace has its own keyring, there’s no root token, two recovery shares can also open the vault if its seal is lost (an escrow OpenBao doesn’t have), a reveal is encrypted to your tab with HPKE in place of response wrapping, and the audit log is hash-chained and anchored daily.

What’s coming