Back to catalog / Agent workflows
Isolate each user’s SaaS credential in a separate vault
Create a vault for a fictional user, attach a bearer credential, verify agent access, and clean up resources.
Goal
Keep multi-tenant user tokens out of shared agent configuration and prompts.
Steps
- Create one vault per internal user with
client.beta.vaults.create(display_name=..., metadata=...). [operate] - Bind the user’s MCP credential with
vaults.credentials.create(vault_id=..., auth={"type":"static_bearer", ...}); read the token only from a secret store. [operate] - Verify the identity and audit metadata after the run; archive the credential and vault when access is revoked. [operate]
How to verify
A test user sees only their mock resources, another user’s vault lacks the token, and revocation archives the credential.
Troubleshooting
If the MCP credential is not resolved, confirm it is attached to the session’s vault and the server URL matches; do not fall back to shared environment variables.
Permissions
Prerequisites
- Python 3.11+, Managed Agents beta SDK/API key, an MCP SaaS test tenant, and a short-lived bearer token.
Permissions
- Use a test tenant and minimum read-only scope; inject and rotate tokens through vaults, never logs or repositories.
Limitations
Vaults do not replace server-side authorization, tenant mapping checks, or rotation; the cookbook example uses GitHub MCP.
Pinned upstream source
- Repository
- anthropics/anthropic-cookbook
- File path
- managed_agents/CMA_operate_in_production.ipynb
- Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Main topic
Make Agent behavior safer and easier to verify