Skip to main content
Status: Draft design, pending independent security review. Nothing here is built. Every rule is Planned until its slice lands with the regression coverage listed under Delivery. Implementation starts only after the review approves. Tuturuuu Vault is a personal vault. Each user stores encrypted notes and files that only they can open, behind Tuturuuu Auth, with a passkey ceremony on every read and write. Its first use is keeping the two backup age identities (the owner key and the escrow key) that decrypt production backups.

Scope and default

  • Default: off. A user enables the vault by enrolling a vault passkey and a recovery key. Nothing is created for users who never open it.
  • Owner: one user per vault. There is no sharing, delegation or workspace ownership in version 1.
  • Not in scope: workspace secrets and environment variables, which belong to the Secrets vault; public.workspace_secrets; the server-held deployment vaults.

Relationship to the secrets vault

The personal vault is a separate product built on the reviewed secrets vault foundations. It reuses them and does not fork them. A user who later joins a workspace secrets vault keeps the same strong identity, passkeys and recovery key. The PIN unlock tier is never available for personal items. New here: item formats, the Keeper Worker that holds the master key, the per-operation authorization, deletion fences, and the personal audit trail.

Protection classes

Every item has a class, fixed at creation. Changing it creates a new item and deletes the old one through the normal deletion path. Items can also be marked critical. Critical items must be Sealed, need two enrolled vault passkeys on different providers plus a confirmed recovery key before creation, have a delayed delete, and notify the user on every reveal. The backup age identities are Sealed and critical.

Envelope encryption

Data keys

Each item version has a fresh 256-bit data key (DEK). Content is encrypted with vault-crypto’s symmetric envelope: AES-256-GCM under a one-time subkey HKDF(DEK, salt = enc_id, info = "tuturuuu/vault/personal-item/v1" ‖ ctx), where ctx is the canonical CBOR of {deployment, vault_user_id, item_id, version, kind, class, enc_id}.
  • Notes are UTF-8 text up to 64 KiB, encrypted as one message and stored in Postgres.
  • Files up to 25 MiB are split into 64 KiB chunks. Chunk i uses enc_id ‖ i in its subkey salt and {…ctx, chunk: i, last: bool} in its aad, so reordering, truncation and extension fail. Files of at most 64 KiB are stored in Postgres; larger ones in a dedicated private R2 bucket.
  • The title, file name, MIME type and any note on a file are encrypted inside the item payload. Only kind, class, critical, a size bucket and timestamps are plaintext.

Wraps

  • The inner wrap is created on the client, so the Sealed DEK never exists outside the user’s browser.
  • The outer wrap gives every class one server-side gate (no unwrap without a consumed ceremony), per-user rate limits, and crypto-shredding: destroying a Keeper wrap makes a database copy useless even to someone holding the user’s recovery key.
  • Wrap contexts reuse the wrap purpose with key_kind: personal-dek and scope_id: item_id ‖ version.

The Keeper

The Keeper is the master-key service. It is a Cloudflare Worker, apps/vault-keeper, with one SQLite Durable Object per vault_user_id. It deploys from the same dedicated Cloudflare account as the witness, with its own deploy credentials. Neither the Web API nor Vercel holds its key.
  • Master key. KEEPER_ROOT_KEY_<generation> Worker secrets. The per-user KEK is HKDF(root, salt = vault_user_id, info = "tuturuuu/vault/keeper/kek/v1" ‖ generation). The KEK is derived per request and never stored.
  • Wrap. Takes a DEK (Protected) or an inner wrap (Sealed) with its context, returns the outer wrap and a wrap_id. Wrapping a new version needs a consumed write authorization.
  • Unwrap. Needs a consumed read authorization for exactly that (item_id, version). The result is HPKE-sealed to an ephemeral key that the client generated for this request and bound into the authorization, so the Web API relays only ciphertext. For a Sealed item the result is still the inner wrap, which only the user’s strong identity opens.
  • Destroyed keys. Purge adds the wrap_id to a destroyed set in the Durable Object. The Keeper refuses to unwrap a destroyed wrap_id even if a restored database presents it. Keeper state is never restored from Postgres.
  • Restore fence. Every destruction increments a per-user destruction epoch, and the Keeper commits a signed destruction receipt {vault_user_id, wrap_id, epoch} to the user’s KeyringWitness before it confirms the purge. Before every unwrap the Keeper compares its own epoch with the witness-attested epoch and fails closed if it is behind, which catches a Durable Object point-in-time restore. Clients also refuse any item whose latest record in the item map is a tombstone or purge.
  • Root rotation adds a generation, re-wraps outer wraps in bounded, resumable batches, and retires the old generation only after every live wrap has moved.
  • Escrow. Each root generation is escrowed through a dispatch-only workflow, as for the interim server keys, to age recipients held offline by the owners. A recipient whose identity is stored inside the vault is refused: escrow must never depend on the vault it protects.
  • Metering. Bounded request size, per-user and global operation caps, at most 3 retries with backoff, idempotent wrap_id and request keys, and a durable KEEPER_STOPPED flag that fails every call closed, with restart tests and recorded cost evidence (gate VG-12).

Authorization on every read and write

Listing item metadata needs the vault child session at aal2. Every other operation needs a fresh operation authorization, used once:
  1. The client asks the Keeper, through the vault API, for a challenge. The Keeper stores {challenge_id, nonce, act, paramsHash(act, params), exp}; the challenge lives 120 seconds.
  2. The user completes one passkey ceremony, either:
    • Vault passkey assertion (required for Sealed items): a WebAuthn assertion at rpId vault.tuturuuu.com with userVerification: "required" whose challenge is SHA-256(nonce ‖ paramsHash). The same ceremony returns the PRF output that unlocks the strong identity, so a Sealed read costs one prompt. The Keeper verifies it against the credential log, never against a database row.
    • ttr+stepup proof (Protected items only): aud: stepup:vault-keeper, the act above, amr containing passkey, proof delivery by one-time code as the secrets vault specifies. TOTP is accepted only if the user turns on “Allow authenticator codes” for Protected items, which is off by default and needs vault.method-manage.
  3. The Keeper consumes the nonce and jti (or assertion counter) in one transaction, then checks central session liveness (sid, gen). Only then does it charge the rate limit and perform the operation, in a later transaction.

Ceremony record

Each challenge is one durable record in the Keeper Durable Object, keyed by challenge_id, with a client-chosen operation_id bound into the parameters hash. Its state only moves forward: issued → consumed → authorized → completed | failed | expired.
  • consumed stores the nonce, jti or assertion, in the same transaction that rejects any earlier use.
  • authorized is written only after a live liveness answer; anything else ends in failed with no charge.
  • Liveness is a remote call, so it cannot share a transaction with consume. A record left in consumed for more than 60 seconds, for example after a crash, moves to expired with no charge and no effect, and the user repeats the ceremony.
  • From authorized, the rate-limit charge, the effect (wrap, unwrap, destroy, credential change, all computed inside the Durable Object) and the move to completed with its stored result happen in one storage transaction. A crash leaves either nothing applied or everything applied.
  • A retry with the same operation_id returns the stored result, never a second effect. A new operation needs a new ceremony. Database writes that follow (records, ciphertext) are made by the API idempotently by operation_id through staged publication, and readers trust only what the witness committed.
  • Single Durable Object threading per vault_user_id serialises all of this, so concurrent Workers cannot double-spend a ceremony.

WebAuthn verification

The Keeper verifies a vault passkey assertion with @simplewebauthn/server and these exact rules, rejecting anything else:
  • The client sends only id, rawId, type, clientDataJSON, authenticatorData, signature and userHandle. Extension results, including PRF output, never leave the browser.
  • clientDataJSON.type is webauthn.get, origin is exactly https://vault.tuturuuu.com, crossOrigin is absent or false, no topOrigin is present, and challenge equals the stored SHA-256(nonce ‖ paramsHash).
  • rpIdHash is SHA-256("vault.tuturuuu.com"); the UP and UV flags are set.
  • The credential ID and COSE public key (ES256 or EdDSA only) come from the credential log, and its state there is active.
  • Sign counter: if the stored floor or the new value is non-zero, the new value must exceed the floor; a regression freezes the vault and notifies the user. The Keeper commits each non-zero floor to the KeyringWitness as a Keeper-signed entry inside the same ceremony, before releasing the result, and compares its local floor with the witnessed floor on every use, so a Durable Object restore cannot reset it. Synced passkeys that always report 0 are accepted, so the counter is a clone signal, not a guarantee.
  • The client derives the unlock KEK only from the PRF result of the same navigator.credentials.get call whose assertion the Keeper accepted. A Sealed read proceeds only when both the Keeper result and the local unlock succeed.

Credential log

Vault passkey public keys live in a public, signed credential log witnessed by KeyringWitness, beside the encrypted keyring. Each entry is signed by the strong identity’s Ed25519 key: {vault_user_id, seq, prev_hash, credential_id, cose_public_key, aaguid, provider_label, state (active | removed), issued_at}.
  • Registration and removal each append one entry under vault.method-manage. The first entry is signed at enrolment, which is also when the strong identity public key is pinned in the witness.
  • The Keeper accepts a credential only from a witness attestation of the log at most 10 minutes old. A database or API compromise cannot add a key, revive a removed one, or swap a public key.
  • private.vault_passkeys remains a cache for listing; it is never an authority.
There is no unlocked window. Opening three items takes three ceremonies. Plaintext is kept only in component memory and is dropped on navigation, tab close, two minutes of inactivity, or lock. The four acts are added to STEP_UP_ACTS together with an independent review of packages/session. Until then only vault passkey assertions are accepted, which means only Sealed items ship first.

Integrity and freshness

  • Every item version has an item record signed by the strong identity’s Ed25519 key: {deployment, vault_user_id, item_id, version, kind, class, critical, state, enc_id, ciphertext_hash, outer_wrap_hash, prev_record_hash, written_at}. Deletes and restores are records too.
  • The user’s keyring holds an item map: item_id → latest record hash. Every write is a keyring head update through KeyringWitness, which accepts only the next counter signed by the strong identity. A client accepts an item only if its record verifies and is the latest entry in a keyring head the witness attested at most 10 minutes ago.
  • So the server cannot swap ciphertexts between items, roll an item back to an older version, revive a deleted item, or hide a newer version from a client that checks the witness.
  • Protected items are also signed by the strong identity. A user who lost every strong method and restored Protected items through account recovery enrols a new strong identity; the recovery flow re-signs the surviving items under it in a witnessed rotation.

No CI or export path

  • Vault routes accept only the __Host- vault child session. They reject Authorization headers, API keys, personal access tokens, ttr device sessions, app coordination tokens and satellite handoffs.
  • No machine grant, workload, CI credential or sync target exists for personal items. The Keeper has no unattended unwrap route.
  • No bulk export, archive, backup download or “download all”. Each reveal and download is one item, one ceremony.
  • Account data export (privacy requests) lists vault item metadata and states that content is encrypted and must be downloaded by the user from the vault.
  • A repository validator fails CI if a route under the personal vault API accepts a bearer credential, if any workflow calls the Keeper unwrap route, or if the Keeper gains a route outside the reviewed list.
  • Critical items have no copy or print. Their content is masked until the user holds a reveal control, is never written to the clipboard, and is dropped from memory 60 seconds after the ceremony. A critical file leaves the vault only by download: one ceremony, one file, written through a Blob URL that is revoked immediately, audited and notified. Standard items allow copy, and the vault clears the clipboard after 30 seconds where the browser allows it.
  • The only other way out is the disaster recovery kit, which holds ciphertext only.
  • Intentional exceptions. Critical file download and the kit both put data outside the vault on purpose: an age identity is useless unless it can be used during a restore. Both are user-initiated, one item per ceremony, audited and notified, and neither exists for CI, machines or API keys.
  • Screenshots, screen recording and a compromised device cannot be prevented. Export prevention covers server paths and the vault’s own UI, not the user’s screen.

Rate limits

Limits are enforced in the Keeper Durable Object. Upstash-backed abuse limits fail open, so they are a first line only. Charges happen only after a consumed, live authorization, so a dead session never spends quota. A user can always freeze their vault (below) regardless of limits.

Recovery

  • Account recovery for Protected items. After an account recovery event (password reset, MFA reset, or the first passkey added from a new device), the vault enters a 72-hour cooldown: no reads or writes, the user is notified by email and on every signed-in device. Only a pre-existing strong method (a vault passkey from the credential log or the recovery key) can cancel, because a session could belong to whoever ran the recovery. Any session can still freeze. The cooldown start, cancel and end are entries in the witnessed credential log, so the server cannot shorten or hide them. After the cooldown the user enrols a new strong identity and Protected items are re-signed under it. Sealed items stay sealed to the old identity.
  • Support and admins cannot recover anything. There is no admin read or unwrap path. Support can only freeze a vault on the user’s verified request.
  • Freeze. “Lock my vault” works from any signed-in session with no ceremony and blocks every read and write. Unfreezing needs vault.method-manage with a vault passkey and waits 24 hours, unless the user also presents the recovery key.
  • Enrolment rules. Enrolment needs one vault passkey that returns PRF, a recovery key the user re-types one group of, and the vault child session at aal2. Critical items need a second passkey from a different provider. The UI recommends printing the recovery key and storing it offline, apart from the devices that hold the passkeys.
  • Disaster recovery. The vault runs on the same production platform whose backups the first-use keys decrypt. See Disaster recovery kit.
  • Restore drill. The vault shows “last verified” per critical item. The drill is to reveal the item on a machine with no local state, once with a passkey and once with the recovery key only, and record the date.

Disaster recovery kit

Items needed to restore the platform cannot depend only on the platform. If production Postgres, R2, the Keeper or the vault origin is lost, the vault is gone with it, and so would be the backup age identities stored in it. So critical items need one copy that works with no Tuturuuu service. The disaster recovery kit is a per-item file the user downloads with a vault.item-read ceremony:
  • It can be made only for an item whose latest record in a fresh witness attestation is live, not tombstoned or purged.
  • It is a canonical CBOR file with a manifest {v, suite, deployment, vault_user_id, item_id, version, class, kind, recovery_epoch, kit_id, kit_salt, created_at}, the item record, the item ciphertext, and the DEK sealed with AES-256-GCM under HKDF(recovery, salt = kit_salt, info = "tuturuuu/vault/dr-kit/v1" ‖ CBOR(manifest)), with the canonical manifest as the aad. kit_salt is 32 random bytes per kit. Changing any manifest field, or moving the sealed DEK into another kit, fails decryption.
  • The manifest and the item record are signed by the strong identity’s Ed25519 key, and the kit carries that public key. The recovery sheet printed at enrolment shows the recovery key and the strong identity fingerprint. The decoder requires that fingerprint as an input, checks both signatures against it, and checks that the record’s item_id, version, class, enc_id and ciphertext_hash match the manifest and the ciphertext. A kit signed by any other key is rejected, so a forged kit cannot pass even if it decrypts.
  • It has no Keeper outer wrap and no plaintext.
  • An open-source offline decoder in packages/vault-crypto (a single command that runs without network access) opens it with the recovery key.
  • Each kit release is recorded with its kit_id and recovery_epoch in the item record chain, so the vault lists outstanding kits per item.
  • The user stores the kit and the printed recovery key in separate offline places. Kit downloads are audited and notified like reveals.
  • A critical item shows “kit verified” only after the user opens a kit with the offline decoder on a machine with no vault session and confirms the restored content hash.
  • A kit cannot be revoked, and the design does not pretend otherwise. It is offline ciphertext sealed to the recovery key in force at recovery_epoch; anyone holding both can open it with their own decoder, so an epoch check in the official decoder would protect nothing. Rotating the recovery key increments recovery_epoch and lists every outstanding kit from older epochs. The user either destroys those kits together with the old recovery sheet, or, if the old sheet may be exposed, treats the item’s secret as exposed and rotates it at its source (for an age identity: a new identity and re-encrypted backups).
  • Purge does not reach kits. Deleting or purging an item lists its outstanding kits and warns that they still open with the recovery key of their epoch. As in the secrets vault, removal cannot unsee.
First-use gate. The backup age identities go into the vault only when both of these hold, so that no private identity is recoverable only from the vault:
  1. Each identity has a verified disaster recovery kit, or an independent offline copy chosen by its owner, and
  2. no Keeper root escrow recipient is one of those identities. The escrow workflow checks this against the public recipients and refuses otherwise.

Deletion and fences

  • Order is fixed: destroy the Keeper wrap first, confirm, then delete the ciphertext. If ciphertext deletion fails, the item is already unreadable and the purge retries. Ciphertext is never deleted while its wrap is live.
  • Replacing a version writes and verifies the new version (record accepted by the witness, ciphertext read back and hash checked) before the old version enters its fence. A failed or partial write never deletes the original. The newest 10 versions are kept, older ones are fenced like deletes.
  • Database backups keep ciphertext and outer wraps after purge. They are unreadable because the Keeper refuses destroyed wrap_id values and its state is not restored from Postgres.
  • The purge Worker is bounded (at most 200 items per run), idempotent per wrap_id, records a terminal state per item, and stops on KEEPER_STOPPED or its own durable stop flag.

Audit

private.personal_vault_audit_events is append-only: the definer role has no update or delete. Each row holds vault_user_id, event, item_id, version, class, result, authorization kind, truncated IP prefix, user-agent family and a hash-chain link. It never holds titles, content, keys, wraps, PRF output, challenges or tokens.
  • Events: enrolment, method changes, list, reveal, download, create, update, delete, restore, cancel, purge, freeze, unfreeze, failed ceremony, rate limit, cooldown start and cancel.
  • The chain head is written into each keyring head, so the witness timestamps it and rewriting earlier history is detectable.
  • The user sees their own activity on the vault origin. Reveals and downloads of critical items, method changes, freezes and cooldowns also send an email and a push notification.
  • Events are kept for 400 days, and survive item purge.
  • Audit is server-trusted between keyring heads, as in the secrets vault.

Threat model

Escrow separation. Keeping the owner and escrow age identities behind one Tuturuuu identity means one compromised strong method exposes both. That is an explicit owner decision for the first use. The stronger option is a second vault identity (a separate account with its own passkeys, held by the escrow holder) for the escrow key.

Data model

All tables are in private, revoked from public, anon, authenticated and service_role, and reached only through vault_definer functions called by server routes. Passkeys, unlock wraps and keyrings reuse private.vault_passkeys, private.vault_unlock_wraps and private.vault_keyrings.
  • Only the purge function may null outer_wrap, ciphertext and r2_key, and only after the Keeper confirms destruction of that wrap_id.
  • on delete restrict stops an auth.users delete from cascading past the deletion fence; account deletion calls the vault purge first.
  • pgTAP covers: no grants to client roles or service_role, append-only versions and audit, the critical-implies-sealed check, purge ordering, and rejection of a purge without a Keeper confirmation.

API routes

Routes live under apps/web/src/app/api/v1/vault/personal/**, are served only on vault.tuturuuu.com (the proxy returns 404 on every other host), and use data access in packages/internal-api/src/vault/personal/*. Chunk grants. A successful open of a large file returns one grant signed by the Keeper naming item_id, version, the exact R2 object keys, byte ranges, chunk count, a nonce and a 60-second expiry. The chunk route redeems it once and presigns only those keys. The client checks the chunk count, the last flag on exactly the final chunk and the item context, and rejects any missing, duplicate, reordered, extra or oversized chunk. Every route uses await connection(), returns Cache-Control: no-store, and never logs request or response bodies.

UI surfaces

Built on the vault origin with @tuturuuu/ui, no native dialogs, no useEffect data fetching, and every string in English and Vietnamese.

Delivery

Each slice gets an independent security review. Migrations need an exact-SQL review, a full local reset with pgTAP, and the gated production workflow. Workers need release-authority approval for their first publication. Slices V2 to V6, with V5a, are the shortest path to the first use. Protected items, large files and TOTP never block it.

Regression coverage