rl client from Client setup.
Before you begin
- You need the organization developer or admin role to create, change, or delete vaults and credentials. The organization user role can list vaults and read credential details, which never include secret values. See Organizations and roles.
- For API calls, create a key under API keys. See API keys.
- Decide how to split your secrets. Put credentials that should travel together in one vault. A common pattern is one vault per project, or one vault per end user, with your own user id in
metadata.
How credentials reach a session
The API also accepts
webhook_secret and integration. webhook_secret (Webhook signing secret) verifies deliveries to an event source and never reaches a sandbox. integration grants a native integration connection through a vault. Built-in integrations don’t use vaults: you grant those apps on the agent.
Create a vault
- Console
- TypeScript
- cURL
- In the sidebar, click Credential vaults.
- Click Create vault.
- Enter a Vault name, then click Create vault.
display_name is required and can be at most 256 characters. Keep vault_id: you grant vaults by id.
Retry a create safely
To make a retried create return the same vault, send anidempotency_key of at most 128 characters in the body. The key has no expiry.
List, read, and rename vaults
listVaults returns every vault in your organization in one response. Each entry has a credential_count, so you don’t need to open each vault. getVault returns one vault in the same shape as the create response.
- Console
- TypeScript
- cURL
- In the sidebar, click Credential vaults.
- To rename a vault, open its actions menu and click Rename.
metadata is replaced as a whole object, not merged.
Add a credential
This example adds an MCP API token. The response describes the credential and never includessecret_value.
- Console
- TypeScript
- cURL
- Open the vault and click Add credential.
- Set Type to MCP API token.
- Enter the Server URL and the API token.
- Optionally enter a Label.
- Under Acknowledgement, confirm that you understand the credential is shared, then click Add credential.
Other credential types
An environment variable needssecret_name, the variable name the sandbox sees. The console asks you to confirm that the agent can read the value.
Credential fields
Grant credentials to a session
A session receives credentials in one of two ways:- Agent defaults. Set
default_vault_idson the agent. Every session started without its ownvault_idsreceives those vaults. Optionally narrow them withdefault_credential_refs. See Agents. - At launch. Send
vault_idsand, optionally,credential_refswhen you start the session.
credential_refs is an allowlist across every granted vault, not a filter inside one vault. If you list credentials from one vault only, the session receives nothing from the other vaults. List every credential the session needs.
Order matters. When two granted vaults hold a credential for the same MCP server URL or the same environment variable name, the vault listed first wins. Within one vault, store only one credential per server URL or variable name. The console marks a duplicate as shadowed, and it never reaches a session.
- Console
- TypeScript
- cURL
- Open the agent and click Start session.
- Under Credential access, check the vaults or individual credentials for this run. The agent’s defaults start checked.
- Fill in the task, then click Launch session.
404 on vault_ids. Credentials are resolved when the session’s sandbox is prepared, not at the start request. See Sessions for the start response.
What success means: each MCP server authenticated by the grant contributes its tools to the session, and each environment variable is set in the sandbox. If an MCP server can’t be reached or rejects the token, the session still starts without that server’s tools and records an mcp_discovery_failed warning in its events.
Credentials in multi-agent sessions
A subagent that is a copy of the same agent receives the same vaults and credential refs as its parent. A different agent from the roster receives only its own default vaults and credential refs, never the parent’s. To share a credential, attach the same vault to both agents. Environment-variable credentials work differently, because every agent in the tree shares one sandbox:- They come only from the vaults granted to the root session, and they’re set once, when the sandbox starts.
- Every agent in the tree, including roster agents, can read them.
- A roster agent’s own environment-variable credentials are not added. Its session records a
delegated_env_credentials_unavailablewarning that names the missing variables. To make a variable available, grant its vault to the root session.
Rotate a credential
Send a newsecret_value to store a new version of the secret. Omit it to keep the current value. You can also change display_name, secret_name, injection_locations, network_mode, allowed_hosts, and metadata. You can’t change credential_type or mcp_server_url; delete the credential and add a new one instead.
- Console
- TypeScript
- cURL
- Open the vault. In the credential’s actions menu, click Edit.
- Enter the new value in the Replace field, for example Replace API token.
- Click Save credential.
Delete a credential or a vault
Deleting a credential removes it from its vault. Deleting a vault hides the vault and every credential in it. In both cases, new sessions don’t receive them, running sessions are not stopped, and there is no undo.- Console
- TypeScript
- cURL
- To remove one credential, open the vault. In the credential’s actions menu, click Remove, then confirm.
- To delete a vault, open it and click Delete, then confirm. The dialog warns you when agents still use the vault as a default.
default_vault_ids still names a deleted vault can’t start sessions with its defaults (404 on vault_ids) until you save a new agent version without that vault, or launch with explicit vault_ids. The console’s Launch a session drawer leaves the deleted vault out and says so.
Read credentials
listVaultCredentials returns a vault’s credentials, newest first, under vault_credentials. The list is empty when the vault is empty. getVaultCredential returns one. Neither returns secret values.
- Console
- TypeScript
- cURL
- Open the vault. The table lists each credential with its type and label.
- Expand a row to see its id, network settings, and, for an MCP API token, a connection check.
What can go wrong
For every error code, see Errors. For limits, see Limits.
Next steps
Connect MCP servers
Add remote tools and authenticate them with a vault credential.
GitHub access
Give
gh a token from a vault.Environments
Set up the sandbox and its network policy.
Security
See what reaches the sandbox and how secrets are protected.