# Sealed vault settings

> Whether your users may keep sealed vaults, and how large a sealed vault and a sealed item may grow.

Four of the realm's secrets settings are for sealed vaults. Sealed vaults are on by default. You can turn them off for
your realm today, or set how large they may grow, so the rules are in place before your users have a client to use
them with.

What's missing today: no client seals on your users' devices yet, so these settings have nothing to act on until one
ships.

## Before you begin

- **Who:** a realm administrator, with `MODIFY` on the realm's settings, which `RealmOwner` gives. See
  [Delegated administration](/platform/realms/delegated-administration/).
- **Where:** the API. There are no screens yet.
- **First:** the store is on. See [Realm settings](/secrets-store/realm-settings/).

## How it works

The settings sit in the `sealed` section of the realm's `vaultSettings`:

| Setting | What it does | Default | Range |
|---|---|---|---|
| `sealed.enabled` | Whether your users may keep sealed vaults. Off, every sealed call answers `409`, and nothing already sealed is opened | `true` | |
| `sealed.itemMaxBytes` | The largest one sealed item may be, as written | 1 MiB | 1 byte to 16 MiB; a request carries at most 2 MiB today |
| `sealed.vaultMaxItems` | The most live item versions one vault holds | 1000 | 1 to 100,000 |
| `sealed.vaultMaxBytes` | The most one vault's live item versions hold together | 100 MiB | 1 byte to 1 GiB |

Sealed [item shares](/secrets-store/sealed-vaults/whats-next/#item-shares) will take the realm's one-time share
lifetimes, `shareDefaultTtl` and `shareMaxTtl`.

## Set it up

As a realm administrator, once the store is on, change the section, with the `rev` you read from the settings
([Call the API](/develop/api/) shows how to get `$CVYUH_SESSION`):

```sh
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
  -H "Content-Type: application/json" \
  -H 'If-Match: "<rev>"' \
  -d '{ "sealed": { "enabled": false } }'
```

## When it fails

| Answer | When | What to do |
|---|---|---|
| `400` | A field outside the `sealed` section's four, or a value out of range | Send only these fields, under `sealed` |
| `412` | The settings changed since you read their `rev` | Read again and retry |
| `404` | The store isn't on yet | Turn it on first |

## Limits and defaults

Every default and range is in the table above. A request to the store carries at most 2 MiB, so an
`itemMaxBytes` above that has no effect today.

## Audit record

Each change is an `UPDATED` or `PATCHED` change record on `vaultSettings`, with what changed, before and after. See
[Change history](/audit-reports/audit-trail/change-history/).

## Good to know

- **They wait for a client.** These settings take effect for your users once a client that seals on their devices
  ships. See [What's next for sealed vaults](/secrets-store/sealed-vaults/whats-next/).
- **Lowering a bound doesn't remove anything.** A vault already past a new bound keeps what it holds; its next write
  past the bound is refused.

## Related

- [Set the realm's defaults](/secrets-store/guides/set-the-realms-defaults/): every setting, in one task.
- [Realm settings](/secrets-store/realm-settings/): turning the store on, and every other setting.
- [What's next for sealed vaults](/secrets-store/sealed-vaults/whats-next/#item-cap): what the bounds are for.
