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 |
| HashiCorp Vault, KV version 2 | A token or an AppRole | HashiCorp Vault |
A connection alone gives no session access. A session reaches a provider's logins only through a binding 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_KEYenvironment variable, for the API, SDK and CLI steps. See API keys. - For the SDK examples, a client named
client, made withnew Steel()in TypeScript orSteel()in Python. - For the CLI examples, the Steel CLI. It reads the same
STEEL_API_KEY. - With an organization key, add your project's ID as
projectId(project_idin Python,--project-idin the CLI) to each request that creates or tests a connection. See Choose a scope.
Create a connection
Each provider's guide gives the steps and the fields:
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 https://api.steel.dev/v1/secret-connections \
-H "steel-api-key: $STEEL_API_KEY"const { connections } = await client.secretConnections.list();
console.log(connections);connections = client.secret_connections.list().connections
print(connections)steel secret-connections listEach 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 -X POST https://api.steel.dev/v1/secret-connections/$CONNECTION_ID/test \
-H "steel-api-key: $STEEL_API_KEY"await client.secretConnections.test(connectionId);client.secret_connections.test(connection_id)steel secret-connections test $CONNECTION_IDA 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 -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"'" } }'await client.secretConnections.update(connectionId, {
auth: { serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN! },
});client.secret_connections.update(
connection_id,
auth={"service_account_token": os.environ["OP_SERVICE_ACCOUNT_TOKEN"]},
)printf '{ "auth": { "serviceAccountToken": "%s" } }' "$OP_SERVICE_ACCOUNT_TOKEN" \
| steel secret-connections update $CONNECTION_IDFor 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 -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 }'await client.secretConnections.update(connectionId, { enabled: false });client.secret_connections.update(connection_id, enabled=False)echo '{ "enabled": false }' | steel secret-connections update $CONNECTION_IDcurl -X DELETE https://api.steel.dev/v1/secret-connections/$CONNECTION_ID \
-H "steel-api-key: $STEEL_API_KEY"await client.secretConnections.delete(connectionId);client.secret_connections.delete(connection_id)steel secret-connections delete $CONNECTION_IDA 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 -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 } }'await client.secretConnections.update(connectionId, {
tokenBudget: { burst: 20, refillPerSecond: 0.01 },
});client.secret_connections.update(
connection_id,
token_budget={"burst": 20, "refill_per_second": 0.01},
)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 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 or HashiCorp Vault 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 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.