---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/logins/secret-connections
markdown_url: https://steel.dev/docs/logins/secret-connections.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Secret Connections
description: Connect 1Password or HashiCorp Vault to a project, so a session fills logins that stay in your own secret manager.
summary: Connect 1Password or HashiCorp Vault to a project, so a session fills logins that stay in your own secret manager.
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/vaults.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
---

# Secret Connections

A Secret Connection gives a project read access to a secret manager that you already use. A session then fills a login from that provider into a sign-in form. Steel reads the login when the session needs it and does not store a copy.

Steel connects to two providers:

| Provider | Steel signs in with | Guide |
| - | - | - |
| 1Password | A service account token | [1Password](https://steel.dev/docs/integrations/1password) |
| HashiCorp Vault, KV version 2 | A token or an AppRole | [HashiCorp Vault](https://steel.dev/docs/integrations/hashicorp-vault) |

A connection alone gives no session access. A session reaches a provider's logins only through a [binding](https://steel.dev/docs/logins/credentials#choose-what-a-session-can-use) that names the connection.

The steps are: connect the provider, test the connection, bind one item to a session, then open the item's sign-in page.

## 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 examples, a client named `client`, made with `new Steel()` in [TypeScript](https://steel.dev/docs/reference/sdks/typescript) or `Steel()` in [Python](https://steel.dev/docs/reference/sdks/python).
- For the CLI examples, the [Steel CLI](https://steel.dev/docs/control/cli). It reads the same `STEEL_API_KEY`.
- With an organization key, add your project's ID as `projectId` (`project_id` in Python, `--project-id` in the CLI) to each request that creates or tests a connection. See [Choose a scope](https://steel.dev/docs/account/api-keys#choose-a-scope).

## Create a connection

Each provider's guide gives the steps and the fields:

- [Connect 1Password](https://steel.dev/docs/integrations/1password#connect-1password)
- [Connect HashiCorp Vault](https://steel.dev/docs/integrations/hashicorp-vault#connect-hashicorp-vault)

In the dashboard, connections are on the **Connections** tab of **Credentials**. With the API, they are at `/v1/secret-connections`. In the SDKs, they are `client.secretConnections` (`client.secret_connections` in Python), and in the CLI, `steel secret-connections`. The API never returns the authentication that you send.

The CLI reads the body of a create or an update as JSON on standard input, so that the provider's token is never a command-line argument.

To list your connections:

**cURL**

```sh
curl https://api.steel.dev/v1/secret-connections \
  -H "steel-api-key: $STEEL_API_KEY"
```

**TypeScript**

```ts
const { connections } = await client.secretConnections.list();
console.log(connections);
```

**Python**

```python
connections = client.secret_connections.list().connections
print(connections)
```

**CLI**

```sh
steel secret-connections list
```

Each connection has an `id`, `name`, `provider`, `enabled`, `tokenBudget`, `version`, `createdAt` and `updatedAt`.

## Test a connection

A test checks that Steel can authenticate with the provider. It does not change the saved connection, and it does not show that a session can fill a login.

With a HashiCorp Vault AppRole, a test can sign in to Vault again, and each sign-in takes one use of the secret ID.

In the dashboard, open the connection's menu on the **Connections** tab and click **Test**.

With the API, an SDK or the CLI:

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/secret-connections/$CONNECTION_ID/test \
  -H "steel-api-key: $STEEL_API_KEY"
```

**TypeScript**

```ts
await client.secretConnections.test(connectionId);
```

**Python**

```python
client.secret_connections.test(connection_id)
```

**CLI**

```sh
steel secret-connections test $CONNECTION_ID
```

A successful test returns `204` with no body.

You can also test authentication before you save it. In the dashboard, click **Test** in the **Connect provider** dialog. With the API, send the same body as a create, without `name`, to `POST /v1/secret-connections/test`. Steel allows 10 of these tests each minute for an organization. It does not test an AppRole before you save it, because an AppRole sign-in can use up a secret ID.

## Replace the authentication

Replace the authentication when you rotate the provider's token. The connection keeps its ID and name, so your bindings do not change.

In the dashboard, open the connection's menu and click **Replace auth**.

With the API, an SDK or the CLI, send the new `auth`:

**cURL**

```sh
curl -X PATCH https://api.steel.dev/v1/secret-connections/$CONNECTION_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "auth": { "serviceAccountToken": "'"$OP_SERVICE_ACCOUNT_TOKEN"'" } }'
```

**TypeScript**

```ts
await client.secretConnections.update(connectionId, {
  auth: { serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN! },
});
```

**Python**

```python
client.secret_connections.update(
    connection_id,
    auth={"service_account_token": os.environ["OP_SERVICE_ACCOUNT_TOKEN"]},
)
```

**CLI**

```sh
printf '{ "auth": { "serviceAccountToken": "%s" } }' "$OP_SERVICE_ACCOUNT_TOKEN" \
  | steel secret-connections update $CONNECTION_ID
```

For HashiCorp Vault, send the whole `config` with the `auth`, even when the address did not change. The address and the namespace must stay the same.

Before Steel saves the new authentication, it checks that the new authentication can still reach what running sessions have bound. If it cannot, the request fails with `connection_account_mismatch`.

## Disable or delete a connection

A disabled connection stops every later read from the provider, and you can enable it again. A deleted connection is gone. Neither takes back a value that Steel already filled into a page.

In the dashboard, open the connection's menu and click **Disable**, **Enable** or **Delete**.

With the API, an SDK or the CLI:

**cURL**

```sh
curl -X PATCH https://api.steel.dev/v1/secret-connections/$CONNECTION_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'
```

**TypeScript**

```ts
await client.secretConnections.update(connectionId, { enabled: false });
```

**Python**

```python
client.secret_connections.update(connection_id, enabled=False)
```

**CLI**

```sh
echo '{ "enabled": false }' | steel secret-connections update $CONNECTION_ID
```

**cURL**

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

**TypeScript**

```ts
await client.secretConnections.delete(connectionId);
```

**Python**

```python
client.secret_connections.delete(connection_id)
```

**CLI**

```sh
steel secret-connections delete $CONNECTION_ID
```

A successful delete returns `204` with no body.

## Limit requests to the provider

Steel limits how fast a connection calls its provider, so that your sessions do not use up the provider's own quota. Each connection has a token budget. A call to the provider takes one token. By default, a connection holds up to 256 tokens and gets 1 new token each second.

To set another budget, send `tokenBudget` when you create or update the connection. The dashboard cannot set it.

**cURL**

```sh
curl -X PATCH https://api.steel.dev/v1/secret-connections/$CONNECTION_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "tokenBudget": { "burst": 20, "refillPerSecond": 0.01 } }'
```

**TypeScript**

```ts
await client.secretConnections.update(connectionId, {
  tokenBudget: { burst: 20, refillPerSecond: 0.01 },
});
```

**Python**

```python
client.secret_connections.update(
    connection_id,
    token_budget={"burst": 20, "refill_per_second": 0.01},
)
```

**CLI**

```sh
echo '{ "tokenBudget": { "burst": 20, "refillPerSecond": 0.01 } }' \
  | steel secret-connections update $CONNECTION_ID
```

| Field | Type | Range | Description |
| - | - | - | - |
| `burst` | integer | 2 to 10000 | The most tokens that the connection holds. |
| `refillPerSecond` | number | 0.001 to 1000 | The tokens that the connection gets each second. |

Send `"tokenBudget": null` (`None` in Python) to go back to the default.

## Check that it worked

Test the connection, as [Test a connection](https://steel.dev/docs/logins/secret-connections#test-a-connection) shows. The test returns `204`, which shows that the authentication works. It does not show that a session can fill a login.

Then start a session with a binding to one item, as [1Password](https://steel.dev/docs/integrations/1password#bind-a-vault-or-an-item-to-a-session) or [HashiCorp Vault](https://steel.dev/docs/integrations/hashicorp-vault#bind-a-secret-to-a-session) shows, and open the item's sign-in page. Steel fills the form. A HashiCorp Vault binding fills only on the origins in its `allowedOrigins`, so one without them fills nothing.

## Troubleshooting

### `connection_account_mismatch`

**Cause:** The new authentication cannot reach something that a running session has bound through this connection. For example, the new token belongs to another 1Password account. The request fails with `409`.

**Fix:** Give the new token or role the same access as the old one. To use another account, create a second connection for it.

**Verify:** The update returns `200`.

### `credential_rate_limited`

**Cause:** The connection has no tokens left in its budget. The request fails with `429`.

**Fix:** Wait and try again. If it happens often, raise the budget, as [Limit requests to the provider](https://steel.dev/docs/logins/secret-connections#limit-requests-to-the-provider) shows. Keep the budget below your provider's own limits.

**Verify:** The same request succeeds.

### A new item does not fill

**Cause:** Steel keeps a provider's list of items for up to 30 seconds. An item that you added or changed in the provider can take that long to appear.

**Fix:** Wait 30 seconds, then load the sign-in page again.

**Verify:** Steel fills the form.

## Next steps

- [1Password](https://steel.dev/docs/integrations/1password): Connect a service account and bind a 1Password vault or item.
- [HashiCorp Vault](https://steel.dev/docs/integrations/hashicorp-vault): Connect a KV version 2 mount and bind a secret.
- [Credentials](https://steel.dev/docs/logins/credentials#choose-what-a-session-can-use): Choose what a session can use.
