---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/logins/vaults
markdown_url: https://steel.dev/docs/logins/vaults.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Vaults
description: Group credentials in a Vault, then give a session access to the whole Vault or to one item in it with a binding.
summary: Group credentials in a Vault, then give a session access to the whole Vault or to one item in it with a binding.
type: how-to
prerequisites:
  - https://steel.dev/docs/logins/browser-state.md
related:
  - https://steel.dev/docs/logins/profiles.md
  - https://steel.dev/docs/logins/session-context.md
  - https://steel.dev/docs/logins/credentials.md
  - https://steel.dev/docs/logins/secret-connections.md
  - https://steel.dev/docs/logins/fill-a-sign-in-form.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# Vaults

A Vault is a named group of [credentials](https://steel.dev/docs/logins/credentials) in a project. Vaults are optional. Use one to keep a set of logins together, such as one customer's accounts, and to give a session access to exactly that set.

A credential in a Vault does not fill by namespace and origin. A session uses it only through a [binding](https://steel.dev/docs/logins/credentials#choose-what-a-session-can-use) to the Vault or to the item.

## Before you begin

- A Steel API key in the `STEEL_API_KEY` environment variable, for the API, SDK and CLI steps. See [API keys](https://steel.dev/docs/account/api-keys).
- For the SDK tabs, `client` is `new Steel()` in [TypeScript](https://steel.dev/docs/reference/sdks/typescript) and `Steel()` in [Python](https://steel.dev/docs/reference/sdks/python).
- For the CLI tabs, the [Steel CLI](https://steel.dev/docs/control/cli), which uses the same key.
- With an organization key, add your project's ID as `projectId` to each request (`project_id` in Python, `--project-id` in the CLI). See [Choose a scope](https://steel.dev/docs/account/api-keys#choose-a-scope).

## Create a Vault

A Vault name has 1 to 63 lowercase letters, digits, dots, underscores or hyphens, and starts with a letter or a digit. The name is unique in its project. The description is optional.

In the dashboard:

1. Open **Credentials** in the sidebar, then the **Vaults** tab.
2. Click **New Vault**.
3. Type a **Vault name** and, if you want one, a **Description**.
4. Click **Create Vault**.

With the API, an SDK or the CLI:

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/vaults \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "acme-prod", "description": "Logins for the Acme account" }'
```

**TypeScript**

```ts
const vault = await client.vaults.create({
  name: "acme-prod",
  description: "Logins for the Acme account",
});
console.log(vault.id);
```

**Python**

```python
vault = client.vaults.create(
    name="acme-prod",
    description="Logins for the Acme account",
)
print(vault.id)
```

**CLI**

```sh
steel vaults create acme-prod --description "Logins for the Acme account"
```

The response has the Vault's `id`, `name`, `description`, `projectId`, `createdAt` and `updatedAt`. Keep the `id`: you need it to add credentials. In the dashboard, the copy icon beside a Vault's name copies its ID.

## Add a credential to a Vault

You can create a credential in a Vault, or move one in. A move keeps the credential's ID and its stored values.

In the dashboard:

- To create one, click **Open Vault** on the Vault's row, then **New credential**.
- To move one, open the **All credentials** tab, open the credential's menu, and click **Move credential**. Choose the Vault, or **Unassigned** to take it out.

With the API, set `vaultId` when you create the credential. The SDKs and the CLI cannot put a credential in a Vault yet, so these two requests are cURL only.

```sh
curl -X POST https://api.steel.dev/v1/secrets \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "credential",
    "vaultId": "'"$VAULT_ID"'",
    "name": "billing",
    "origin": "https://app.example.com",
    "value": { "username": "'"$SITE_USERNAME"'", "password": "'"$SITE_PASSWORD"'" }
  }'
```

To move a credential, send its new `vaultId`. Send `null` to take it out of its Vault.

```sh
curl -X PATCH https://api.steel.dev/v1/secrets/$CREDENTIAL_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "vaultId": "'"$VAULT_ID"'" }'
```

To list a Vault's credentials, call `GET /v1/secrets?kind=credential&vaultId=$VAULT_ID`.

Item names are unique in a Vault. A credential with no name takes its origin as its name, so two credentials for one origin in the same Vault each need a name of their own.

## Give a session access to a Vault

A binding names what a session can use. You write it as a reference:

| Reference | The session can use |
| - | - |
| `steel://vaults/<vault>` | Every credential in the Vault, and each one that you add later |
| `steel://vaults/<vault>/<item>` | One credential. The binding follows it if you move it to another Vault |

`<vault>` and `<item>` are a name or an ID. Percent-encode a character that is not a letter, a digit, `-`, `.`, `_` or `~`. For example, write a space as `%20` and a `/` as `%2F`. An item's name is the **Label** that the dashboard shows.

> **Warning**
>
> A whole-Vault binding includes every credential that anyone adds to the Vault while the session runs. Bind single items when the session must reach a fixed set.

In the dashboard:

1. Open **Sessions**, and click **Start session**.
2. Under **Credential access**, choose **Choose what this session can use**.
3. Under **Binding type**, choose **Steel Vault**, then choose the Vault.
4. Click **Start session**.

The dashboard binds one whole Vault. To bind one item, choose **Individual credential** instead. To bind several Vaults or items, use the API.

With the API or an SDK, pass the references in `credentials.bindings` when you create the session:

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/sessions \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "credentials": { "bindings": ["steel://vaults/acme-prod"] } }'
```

**TypeScript**

```ts
const session = await client.sessions.create({
  credentials: { bindings: ["steel://vaults/acme-prod"] },
});
```

**Python**

```python
session = client.sessions.create(
    credentials={"bindings": ["steel://vaults/acme-prod"]},
)
```

The session fills only what its bindings cover. Each credential still fills only on its own origin and its additional allowed origins. To change the bindings while the session runs, see [Change what a running session can use](https://steel.dev/docs/logins/credentials#change-what-a-running-session-can-use).

## Rename or delete a Vault

A rename keeps the Vault's ID and its items. A binding that a session already holds keeps working, because Steel stores the binding by ID. A reference that you write later must use the new name.

You can delete only an empty Vault. Move or delete its credentials first. Deleting a Vault never deletes credentials.

In the dashboard, open the Vault's menu on the **Vaults** tab and click **Rename Vault** or **Delete Vault**. The dashboard changes the name only. To change the description, use the API.

**cURL**

```sh
curl -X PATCH https://api.steel.dev/v1/vaults/$VAULT_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "acme-production", "description": "Production logins for Acme" }'
```

**TypeScript**

```ts
await client.vaults.update(vaultId, {
  name: "acme-production",
  description: "Production logins for Acme",
});
```

**Python**

```python
client.vaults.update(
    vault_id,
    name="acme-production",
    description="Production logins for Acme",
)
```

**CLI**

```sh
steel vaults update $VAULT_ID \
  --name acme-production \
  --description "Production logins for Acme"
```

**cURL**

```sh
curl -X DELETE https://api.steel.dev/v1/vaults/$VAULT_ID \
  -H "steel-api-key: $STEEL_API_KEY"
```

**TypeScript**

```ts
await client.vaults.delete(vaultId);
```

**Python**

```python
client.vaults.delete(vault_id)
```

**CLI**

```sh
steel vaults delete $VAULT_ID
```

A successful delete returns `204` with no body.

## Check that it worked

List the session's bindings:

**cURL**

```sh
curl https://api.steel.dev/v1/sessions/$SESSION_ID/credentials \
  -H "steel-api-key: $STEEL_API_KEY"
```

**TypeScript**

```ts
const access = await client.sessions.credentials.list(session.id);
console.log(access.lookup, access.bindings);
```

**Python**

```python
access = client.sessions.credentials.list(session.id)
print(access.lookup, access.bindings)
```

**CLI**

```sh
steel sessions credentials list $SESSION_ID
```

A session with only a whole-Vault binding returns:

```json
{
  "credentialsEnabled": true,
  "lookup": "explicit",
  "bindings": ["steel://vaults/<vault-id>"],
  "credentials": []
}
```

`bindings` has the Vault. `credentials` lists only the credentials that you bound one by one, so it is empty here, and the session can still fill from the Vault. To see what the Vault holds now, call `GET /v1/secrets?kind=credential&vaultId=$VAULT_ID`.

Then open a sign-in page of one of the Vault's credentials in the session. Steel fills the form.

## Troubleshooting

### `vault_item_name_taken`

**Cause:** The Vault already has an item with this name. The request fails with `409` and the message `An item named <name> already exists in this vault`.

**Fix:** Give the credential another `name`, then create or move it again.

**Verify:** The request returns the credential with the Vault's ID in `vaultId`.

### `Vault contains live items`

**Cause:** You tried to delete a Vault that still holds credentials. The request fails with `409`.

**Fix:** Move each credential to another Vault or to **Unassigned**, or delete it. Then delete the Vault.

**Verify:** The delete returns `204`.

### A credential stopped filling after you moved it into a Vault

**Cause:** The session matches by namespace and origin, and that match skips credentials in a Vault.

**Fix:** Start the session with a binding to the Vault or to the item. Or move the credential back to **Unassigned**.

**Verify:** `GET /v1/sessions/$SESSION_ID/credentials` has the Vault's reference in `bindings`, or the item in `credentials`. Then open the sign-in page in the session. Steel fills the form.

## Next steps

- [Credentials](https://steel.dev/docs/logins/credentials): Store a login, and choose how a session finds it.
- [Secret Connections](https://steel.dev/docs/logins/secret-connections): Bind logins that stay in 1Password or HashiCorp Vault.
- [Fill a sign-in form from code](https://steel.dev/docs/logins/fill-a-sign-in-form): Decide when Steel fills and submits a form.
