Skip to content
Secrets StoreMarkdown

Grants

Let another user or a group read one secret, for as long as you choose, and take it back at any time.

Available, with limitsAPI

A grant opens one secret to someone who doesn’t own it: a colleague who needs the database password, or a team that needs the deploy key. You choose who, how much they may see, and when it ends. Everything else in your vault stays closed to them.

Grants are how secrets are shared day to day. For a secret someone needs only once, send a one-time share instead; for a secret a whole team owns, keep it in the group’s vault (Vaults).

What’s missing today: a grant on a group’s or the realm’s secret can pause when the user who last wrote the secret is deleted or has their key replaced. See Good to know.

  • Who: the secret’s owner gives and lists grants: you for your own vault, any member for a group’s vault, a realm administrator for the realm’s vault. A realm administrator may also list the grants on a group’s secret, and take back any grant. No privilege is needed for your own vault.
  • Where: the API. There are no screens yet.
  • First: the grantee has used the store once, so they have a key to seal their copy to; for a group, a member has opened the group’s vault once.

A grant names one user or one group, an access level, and optionally an end time.

AccessThey canThey can’t
viewRead every version, its metadata and subkeys; see it when they list your vault; send it on as a one-time shareWrite, delete, or grant it to anyone else
useRead the latest versionEverything else, including seeing it in a listing

Give use when someone needs the value, such as a service reading a password at start-up. Give view when they need to manage it with you.

The grantee gets their own sealed copy. When you give a grant, the realm seals a copy of the secret to the grantee’s own key, which opens only when they sign in. A copy for a group is sealed to the group’s key and opens for any member. Each time the secret is written, the copy is sealed again, so the grantee reads the current versions. A realm administrator acting as themselves can’t open that copy.

A grant to a group follows its membership. Someone who joins the group can read the secret; someone who leaves can’t, from their next request. Where a user holds several grants on one secret, the widest one counts.

As the secret’s owner (Call the API shows how to get $CVYUH_SESSION):

  1. Give the grant. Here maya gives ben view on db/staging in her own vault, until a time she chooses:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/grants/db/staging \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "user": "ben", "access": "view", "validTo": "<RFC 3339 time>" }'

    Send "group": "engineering" in place of user to grant a group. Leave out validTo for a grant with no end. The realm answers 201 with the grant, including its edgeId.

  2. The grantee finds it with a GET on https://foobar.cvyuh.com/api/v0/vault/managed/v1/shared, which lists every secret granted to them or their groups, with its vault, path and access.

  3. They read it in the owner’s vault:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/user/maya/data/db/staging \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

To see a secret’s grants, GET https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/grants/db/staging: each shows edgeId, who it names, access, validTo, grantedBy and live. To take one back:

Terminal window
curl -X DELETE https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/grants/db/staging/<edgeId> \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

The realm answers 204, and their copy is gone.

No message is sent: tell the grantee the path. The secret appears in their GET …/shared list from the moment the grant is given, and leaves it when the grant is taken back. After its end time, reading it is refused: 404 in a personal vault, 403 in a group’s or the realm’s.

AnswerWhenWhat to do
404 naming the granteeThe user or group doesn’t exist, or hasn’t used the store yetCheck the id; the grantee uses the store once, or a group member opens its vault once
404 on the pathThe secret isn’t thereWrite it first; a grant needs an existing secret
400, “a grant names one user or one group”The body named both, or neitherSend one of user or group
400, the grant would expire before it startsvalidTo is already pastSend a time in the future
400 on validToNot an RFC 3339 timeSend a time such as 2026-12-31T00:00:00Z
403The caller isn’t the owner of the vaultAsk the owner, a member of the group, or a realm administrator
404 taking a grant backThe edgeId isn’t a grant on that secretList the grants and use an edgeId from the list
LimitValue
Grants per secretno fixed limit
Grant lifetimeno end unless you set validTo; any time in the future
Access levelsview, use
Who can be grantedusers and groups of the same realm
SymptomCauseFix
A grantee’s read answers 404 though the grant shows "live": trueThe user who last wrote the secret was deleted, or had their key replaced after emergency access once they no longer had the vault’s rightSomeone with the vault’s right writes the secret again; every grant’s copy is sealed again
A grant to a new user answers 404They haven’t used the store yetThey make any call to the store once, such as GET …/config
A grant shows "live": falseIt reached its validToTake it back, or give a new one

Giving or taking back a grant is an UPDATED change record on the secret, under who did it. Each grantee read is an ACCESS record under the grantee. See Secrets audit trail.

  • Only the owner gives a grant. For your own vault that’s you; for a group’s vault, any member; for the realm’s vault, its administrators. A realm administrator acting as themselves can’t grant anyone access to your personal secrets.
  • A grant can pause when its secret’s last writer goes. Each copy opens from the key of the user who last wrote the secret. In a group’s or the realm’s vault, if that user is deleted, or has their key replaced after emergency access once they have left the group or stopped being an administrator, grants on that secret stop working until someone writes it again. Write it again after removing a member.
  • Anyone who may view a secret can share it. A view grantee can send it on as a one-time share to anyone in the realm. Give use where that matters.
  • End times are checked on every request. After its end time a grant gives nothing. It stays in the secret’s list, marked not live, until you take it away.
  • Offboarding takes everything back at once. A realm administrator can remove every grant to a user, in every vault, without reading any of the secrets. See Offboard someone.
  • Taking a grant back can’t take back what was read. Change the secret if the grantee shouldn’t keep the value.
  • Someone with no grant sees nothing. Your secret reads as not there (404), so they can’t even learn that the path exists.
FieldWhat it sets
user or groupWho the grant is for, by user id or group id. One of the two
accessview or use
validToWhen it ends, as an RFC 3339 time. Leave it out for no end. A time already past is refused