Skip to content

Fill 1Password logins in a Steel session

View as Markdown

Set up your agent

Give your coding agent a Steel browser and the Steel skills, so that it browses and writes Steel code the right way. Learn more

Install the Steel CLI. It signs you in and installs the skills for your coding agents.

curl -fsS https://setup.steel.dev | sh

Or send this prompt to your coding agent, and it does the same:

Read https://setup.steel.dev/install.md and follow it to set up Steel for this coding client.
Then continue my requested task using the installed Steel skill.

Set up your agent →

1Password is a password manager. With a Secret Connection, 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. Secret Connections 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 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 -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"'" }
  }'

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:

ReferenceThe 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 -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"]
    }
  }'

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.

Check that it worked

List what the session can use:

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

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. 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 shows. 1Password's rate limits lists the limit of each plan.

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

Next steps

Was this page helpful?