Store and inject secrets safely into agent sessions.
Agents often need to access third-party services — GitHub, Jira, databases, or custom MCP servers. Vaults provide secure credential storage so you can hand tokens to us and have them injected into Sessions on demand without hard-coding secrets in your code.
Example response:
Q: What happens when an MCP OAuth token expires? A: If the provider returned a refresh token, CAS refreshes the credential when needed before MCP discovery or execution. If refresh is unavailable or no longer valid, run the OAuth authorization flow again.
Q: Can I update a Credential's token? A: Yes. Rotate secrets in place with Update a credential, then confirm an MCP OAuth credential with Validate an MCP OAuth credential.
Q: How many Vaults can a Session reference? A: There's no hard limit, but group by service for clarity.
Q: My token leaked. What now? A: Delete the Credential immediately, revoke the token in the third-party platform, and create a new Credential.
Q: Can I read stored tokens? A: No. For security, credential secrets are write-only — you can only delete and recreate.
Core concepts
| Concept | Description |
|---|---|
| Vault | A credential container that can hold multiple Credentials |
| Credential | A single credential bound to a specific MCP server URL |
auth.type | Credential auth type: static_bearer or mcp_oauth |
vault_ids | The list of Vault IDs referenced when creating a Session |
Security
access_tokenis never returned in API responses.- Other secrets such as
token,refresh_token, andclient_secretare also never returned. - Credentials are encrypted at rest.
- Only the linked Sessions can read credential contents at runtime.
End-to-end flow
1
Create a vault
2
Add a credential
For a static Bearer token, add a Credential with nested The response returns Open the returned
auth:type: "vault_credential" and a sanitized auth object. It does not include secret values.For MCP OAuth, use the browser authorization flow:authorization_url. After the provider redirects to the CAS callback, CAS exchanges the code and creates an mcp_oauth Credential in the Vault. See Start MCP OAuth for PKCE, client registration, and callback behavior.If you already hold an OAuth access token and refresh configuration, you can instead import them through Create a credential.3
Use in a Session
Reference Vaults via At runtime, the Agent automatically gains access to every Credential in the Vault to authenticate to the corresponding MCP servers.
vault_ids when creating the Session:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
display_name | string | Yes | Display name for the Vault |
metadata | object | No | Custom metadata |
auth.type | string | Yes for credentials | static_bearer or mcp_oauth |
auth.mcp_server_url | string | Yes for MCP credentials | MCP server URL |
auth.token | string | Yes for static_bearer | Bearer token value; write-only |
auth.access_token | string | Yes when importing mcp_oauth | OAuth access token; write-only |
auth.expires_at | string | No | OAuth access-token expiration time in RFC 3339 format |
auth.refresh | object | No | OAuth refresh configuration; see Vault schemas |
FAQ
Q: What happens when an MCP OAuth token expires? A: If the provider returned a refresh token, CAS refreshes the credential when needed before MCP discovery or execution. If refresh is unavailable or no longer valid, run the OAuth authorization flow again.
Q: Can I update a Credential's token? A: Yes. Rotate secrets in place with Update a credential, then confirm an MCP OAuth credential with Validate an MCP OAuth credential.
Q: How many Vaults can a Session reference? A: There's no hard limit, but group by service for clarity.
Q: My token leaked. What now? A: Delete the Credential immediately, revoke the token in the third-party platform, and create a new Credential.
Q: Can I read stored tokens? A: No. For security, credential secrets are write-only — you can only delete and recreate.
Use separate Vaults per environment (development vs. production) to avoid mixing credentials.