# Who can read a secret

> For any secret, see who can read it, check every grant and nomination, and know what the store keeps out.

Before you put something sensitive in the store, you want to know who can read it. Each secret is sealed under its
owner's own key, so only a short list of users can reach it, and you can check each of them.

**Before you start:** you own the secret: it is in your own vault, a group's vault you're a member of, or, as a realm
administrator, the realm's vault. A realm administrator can also check the grants on a group's secret. You are signed
in with your session in `$CVYUH_SESSION` ([Call the API](/develop/api/) shows how).

## Who can reach what

| Vault | Every right | View or use | Anyone else |
|---|---|---|---|
| A user's | the user | whoever holds a grant; a nominee let in by [emergency access](/secrets-store/emergency-access/) | told it isn't there (`404`) |
| A group's | every member, while a member | whoever holds a grant | refused (`403`) |
| The realm's | the realm's administrators | whoever holds a grant | refused (`403`) |

A realm administrator acting as themselves can't read a user's secrets: they can't open the user's vault, reach the
user's key, or grant themselves access. A secret copied anywhere outside the store never opens, and only the store can
make a grant.

## Check a secret

<Steps>

1. See who holds grants on a secret, here `db/staging` in your own vault (for a group's or the realm's vault, use its
   address in place of `me`):

   ```sh
   curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/grants/db/staging \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

   Each grant shows who it names, its access, its end time, who gave it, and whether it is `live`.

2. See what has been granted to you:

   ```sh
   curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/shared \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

3. See who may reach your vault in an emergency:

   ```sh
   curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

</Steps>

Every request and every change, to a secret, a grant, a share or a nomination, is also recorded on the realm's
[audit trail](/secrets-store/keys-and-protection/audit-trail/), with values left out. Those records can't be read
back through the API yet, so the three calls above are how you check today.

## What the store can't stop

The store keeps secrets from the database, its copies and its backups, and from administrators acting as themselves.
Managed vaults trust the realm's sign-in and the platform that holds the keys, so it doesn't stop:

- an administrator who resets a user's credentials, and then signs in as them;
- an administrator who changes a group's members, and so decides who shares its vault;
- an administrator of a realm above yours, who holds authority over your realm's keys;
- a nominee let in by [emergency access](/secrets-store/emergency-access/), for that one personal vault.

The first two are on the audit trail where they happen. Keep those rights to the people you would trust with the
secrets, and keep secrets the realm must never be able to open for [Sealed vaults](/secrets-store/sealed-vaults/).
[Known limitations](/reference/known-limitations/#secrets-store) lists every exception.

## Related

- [Sealing per owner](/secrets-store/keys-and-protection/sealing/): which key seals what.
- [Grants](/secrets-store/sharing/grants/): `view` and `use`.
