---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/integrations/1password
markdown_url: https://steel.dev/docs/integrations/1password.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Fill 1Password logins in a Steel session
description: Connect a 1Password service account to Steel and bind a vault or an item to a session, so the session fills logins that stay in 1Password.
summary: Connect a 1Password service account to Steel and bind a vault or an item to a session, so the session fills logins that stay in 1Password.
type: integration-guide
prerequisites: []
related:
  - https://steel.dev/docs/integrations/hashicorp-vault.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# Fill 1Password logins in a Steel session

1Password is a password manager. With a [Secret Connection](https://steel.dev/docs/logins/secret-connections), a Steel session fills a login from 1Password into a sign-in form. The login stays in 1Password: Steel reads it when the session needs it and does not store a copy. Your code and your agent never get the password.

Steel signs in to 1Password with a service account token. A session can use only the 1Password vaults or items that you bind to it.

## Before you begin

- A 1Password account that can create service accounts.
- 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). [Secret Connections](https://steel.dev/docs/logins/secret-connections#before-you-begin) says what the SDK and CLI examples need.
- A login item in 1Password with a website address. Steel fills the item only on a page whose origin equals one of the item's websites.

## Set up the integration

### Create a service account

In 1Password, create a service account and give it read access to the vaults that your sessions need. [Get started with 1Password Service Accounts](https://developer.1password.com/docs/service-accounts/get-started/) shows the steps. Copy the token and put it in the `OP_SERVICE_ACCOUNT_TOKEN` environment variable.

Give the service account only the vaults that Steel needs. You cannot change a service account's vaults later in 1Password, so a new vault needs a new service account.

### Connect 1Password

In the dashboard:

1. Open **Credentials** in the sidebar, then the **Connections** tab.
2. Click **Connect provider**.
3. Type a **Name**, and choose **1Password** as the **Provider**.
4. Paste the **Service account token**.
5. Click **Test**, then **Connect provider**.

With the API, an SDK or the CLI:

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/secret-connections \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "team-1password",
    "provider": "1password",
    "auth": { "serviceAccountToken": "'"$OP_SERVICE_ACCOUNT_TOKEN"'" }
  }'
```

**TypeScript**

```ts
const connection = await client.secretConnections.create({
  name: "team-1password",
  provider: "1password",
  auth: { serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN! },
});
console.log(connection.id);
```

**Python**

```python
connection = client.secret_connections.create(
    name="team-1password",
    provider="1password",
    auth={"service_account_token": os.environ["OP_SERVICE_ACCOUNT_TOKEN"]},
)
print(connection.id)
```

**CLI**

```sh
printf '{ "name": "team-1password", "provider": "1password", "auth": { "serviceAccountToken": "%s" } }' \
  "$OP_SERVICE_ACCOUNT_TOKEN" | steel secret-connections create
```

The response has the connection's `id`, `name`, `provider` and `enabled`. It never has the token.

### Bind a vault or an item to a session

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

| Reference | The session can use |
| - | - |
| `steel://connections/<connection>/vaults/<vault>` | Every item in the 1Password vault, and each one that you add later |
| `steel://connections/<connection>/vaults/<vault>/<item>` | One item |

`<connection>` is the connection's name or ID. `<vault>` and `<item>` are a 1Password name or ID. Percent-encode a character that is not a letter, a digit, `-`, `.`, `_` or `~`. For example, write a space as `%20`.

Steel stores a binding by ID. If you later delete an item and make a new one with the same name, a binding to the old item does not follow.

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 **External provider item**, then choose the connection.
4. Type the **Provider Vault name or ID**.
5. Under **Provider access**, choose **Whole provider Vault**, or choose **Individual item** and type the **Item name or ID**.
6. Click **Start session**.

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://connections/team-1password/vaults/Automation/Acme%20billing"]
    }
  }'
```

**TypeScript**

```ts
const session = await client.sessions.create({
  credentials: {
    bindings: ["steel://connections/team-1password/vaults/Automation/Acme%20billing"],
  },
});
```

**Python**

```python
session = client.sessions.create(
    credentials={
        "bindings": ["steel://connections/team-1password/vaults/Automation/Acme%20billing"],
    },
)
```

[Change what a running session can use](https://steel.dev/docs/logins/credentials#change-what-a-running-session-can-use) shows how to add or remove a binding later.

### Open the sign-in page

Open the site's sign-in page in the session. Steel finds the bound items whose website matches the page, and fills the username, the password and, if the item has one, the one-time password. Steel makes the one-time password code itself. The item's one-time password secret never reaches the browser.

Steel matches an item to a page by these rules:

- The page's origin must equal the origin of one of the item's websites: the same scheme, host and port. A subdomain is another origin.
- A website with no scheme, such as `app.example.com`, counts as `https://app.example.com`.
- Steel skips a website whose autofill behavior in 1Password is **Never fill on this website**.

When two bound items match one page, Steel does not choose between them and fills nothing. Bind one item, or choose one with [`Steel.credentials.fill`](https://steel.dev/docs/logins/fill-a-sign-in-form#choose-between-credentials).

## Check that it worked

List what the session can use:

**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
```

The response has `"lookup": "explicit"` and your reference in `bindings`, with IDs in place of names. Then open the sign-in page in the session's [live view](https://steel.dev/docs/observability/live-view). Steel fills the form shortly after the page loads.

## Troubleshooting

### The sign-in form stays empty

**Cause:** No bound item matches the page. The item has no website, its website has another origin than the page, or the item is new. Steel keeps the list of a vault's items for up to 30 seconds.

**Fix:** In 1Password, set the item's website to the sign-in page's address. Wait 30 seconds, then load the page again.

**Verify:** Steel fills the form.

### `reference_not_found`

**Cause:** The service account cannot see the vault or the item that the reference names, or the name is wrong. The request fails with `400`.

**Fix:** Check the names, and percent-encode them. Give the service account read access to the vault.

**Verify:** The session starts, and `GET /v1/sessions/$SESSION_ID/credentials` lists the binding.

### `credential_rate_limited`

**Cause:** The connection used up its request budget. The default budget fits a 1Password Business account. Other plans have lower limits.

**Fix:** Set a lower budget for the connection, as [Limit requests to the provider](https://steel.dev/docs/logins/secret-connections#limit-requests-to-the-provider) shows. [1Password's rate limits](https://developer.1password.com/docs/service-accounts/rate-limits/) lists the limit of each plan.

**Verify:** Sessions fill the form again after the budget refills.

## Next steps

- [Secret Connections](https://steel.dev/docs/logins/secret-connections): Test a connection, replace its token, or disable it.
- [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.
- [Credentials](https://steel.dev/docs/logins/credentials): Store a login in Steel instead.
