# What's next for sealed vaults

> What sealed vaults will give your users once a client seals on their devices, one capability at a time, the API that client will call, and what to use until then.

Sealed vaults are planned. Each capability below waits for a client that seals and opens on your users' devices.
Until one ships, keep secrets in [Vaults](/secrets-store/vaults/); each section says which managed capability to use
today. Sealing uses published algorithms: Argon2id to stretch the master password, HPKE (RFC 9180) to wrap keys, and
AES-256-GCM to seal items.

## A client on your users' devices

An app in the dashboard, a command line and an SDK that seal every item on the user's device before it leaves, and
open it only after it comes back, with the formats a device sends published. **What to use today:**
[Vaults](/secrets-store/vaults/), read through the API.

## Key file and unlock key

Each user gets a key pair, made on their device. Its private half is sealed under an **unlock key** the device derives
from two things the user holds: their master password and an **account key** kept in a recovery kit. The realm
stores the sealed key file so each device can fetch it, and hands its public half to anyone whose device wraps a key
to that user. A stolen copy can't be guessed open from the password alone, and no one at the realm can recover it for
the user. **What to use today:** [Sealing per owner](/secrets-store/keys-and-protection/sealing/): each user's managed
vault is under their own key.

## Personal sealed vaults

A user keeps as many sealed vaults as they need, each with its own **vault key**, made on their device and wrapped to
their own public key. Anyone who holds no key to a vault can't tell it exists. **What to use today:** each user's
personal vault; see [Vaults](/secrets-store/vaults/).

## Group sealed vaults

A vault a team shares, its key wrapped to each member who holds it. A member's device adds another member by wrapping
the current key to them; the realm refuses a wrap to anyone outside the group. When a holder leaves the group, the
vault is marked due for [rotation](#rotation), and writes wait until a holder rotates it. **What to use today:** a
group's managed vault; see [Share secrets with a team](/secrets-store/guides/team-secrets/).

## Items and versions

Each version of an item is sealed on the device under its own item key, and that key is sealed under the vault key.
Every write is a new version; older versions read again. The device chooses each vault's and item's id, carrying no
meaning, and keeps the item's real name inside its sealed body, so the realm never learns it. A sealed item copied
into another vault, or under another item, fails to open. **What to use today:** [Versions](/secrets-store/secrets/versions/).

## Check-and-set

A write names the version it expects to follow. If the item has moved on, the write is refused and nothing changes.
**What to use today:** [Check-and-set](/secrets-store/secrets/check-and-set/).

## Delete, undelete and destroy

A version is deleted softly, which can be undone, or destroyed, which removes its sealed body for good. **What to use
today:** [Delete, undelete and destroy](/secrets-store/secrets/delete-and-destroy/).

## Metadata

An item's versions, when each was written, the vault key version it is under, and whether it is deleted or destroyed,
without any sealed body. **What to use today:** [Metadata](/secrets-store/secrets/metadata/).

## Listing

A user lists the vaults they hold a key in, each with its owner, its name if it has one, its key version and whether a
rotation is due, and the items in each, by id. A vault they hold no key to is never listed. **What to use today:**
[Listing](/secrets-store/secrets/listing/).

## Item shares

A user's device wraps one version's item key to one other user. That user opens that one version, until the share
expires, and nothing else in the vault. A share takes the realm's one-time share lifetimes. It is time-boxed, not
read-once: the realm can't tell a read from a fetch. **What to use today:**
[One-time shares](/secrets-store/sharing/one-time-shares/) and [Grants](/secrets-store/sharing/grants/).

## Emergency access

The same nomination as managed vaults. The user's device wraps each personal sealed vault's key to the nominee, and the
realm holds those wraps back until the nomination opens: asked for, past its delay, and not refused. Group sealed
vaults can't be nominated. **What to use today:** [Emergency access](/secrets-store/emergency-access/).

## Rotation

A holder's device makes a vault's next key, wraps it to every holder, and rewraps every live item version's key under
it, in one request; item bodies never move. It is how a vault shuts out someone who held its key and no longer may. A
rotation stops a former holder reading anything new, and can't take back what they already read. **What to use
today:** [Key rotation](/secrets-store/keys-and-protection/key-rotation/).

## Item cap

Bounds on a vault's live item versions (1000 by default), its bytes (100 MiB) and one item's size (1 MiB), so every
vault stays small enough to rotate in one request. A write past a bound is refused. You can set the bounds today in
[Sealed vault settings](/secrets-store/sealed-vaults/settings/).

## When an owner is deleted

A deleted user's or group's sealed vaults go with them: their keys, items, shares and emergency wraps. For a user,
their key file goes first, so nothing ever wrapped to them opens again. Group vaults a deleted member made stay with
the group. **What to use today:** [Deleting an owner](/secrets-store/vaults/owner-deletion/).

## Audit trail

Every change to a sealed vault, its keys or its items recorded on the realm's audit trail: who changed what, and
when, with nothing the realm could open. **What to use today:**
[Secrets audit trail](/secrets-store/keys-and-protection/audit-trail/).

## Planned API

The endpoints a sealed vault client will call, under `https://foobar.cvyuh.com/api/v0/vault/sealed/v1`. Each is made
by a user signed in to the realm, as themselves. Every body is what the user's device sealed or wrapped; the realm
stores it and hands it back unopened, and checks only its shape. These are planned for customers: until a client
ships, nothing can make the bodies they take. While sealed vaults are off for the realm (`sealed.enabled`), each
answers `409`.

| Method | Endpoint | What it will do |
|---|---|---|
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/me/keyfile` | The caller's sealed key file |
| `PUT` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/me/keyfile` | First setup, or a rewrap under a new unlock key: `{ "keyFile": … }`, with `If-Match` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/people/<user>/key` | A user's public key, `{ "id", "public" }`, for a device to wrap to |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults` | The vaults the caller holds a key in |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults` | Creates a vault: `{ "id", "owner": "me" or "group/<group>", "name", "wraps": [ { "recipient", "wrapped" } ] }` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>` | One vault, with the caller's wrapped key |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>` | Deletes a vault, its keys and its items |
| `PUT` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/keys/<user>` | A holder adds a group member: `{ "wrapped": … }` |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/rotate` | Rotates the vault key: `{ "keyVersion", "wraps": [ … ], "items": [ { "item", "version", "key" } ] }` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items` | Every item's version map |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>` | One version's sealed item; `?version=N` for an older one |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>` | A new version: `{ "options": { "cas": N }, "keyVersion": N, "item": … }` |
| `DELETE` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>` | Deletes the latest version, softly |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>/delete` | Deletes versions, softly: `{ "versions": [N, …] }` |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>/undelete` | Brings deleted versions back: `{ "versions": [N, …] }` |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>/destroy` | Removes versions' sealed bodies for good: `{ "versions": [N, …] }` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>/metadata` | The version map, without bodies |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/items/<item>/shares` | Shares one version with one user: `{ "recipient", "version", "wrapped", "ttl" }` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/shared` | The item shares made to the caller |
| `POST` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/vaults/<vault>/emergency/<nomination>` | The owner holds a wrap for a nominee: `{ "wrapped": … }` |
| `GET` | `https://foobar.cvyuh.com/api/v0/vault/sealed/v1/emergency/<nomination>/sealed` | The nominee's wraps, once the nomination is open |

**What to use today:** the managed endpoints in the [Secrets Store API](/secrets-store/api/).
