Agent Tokens
Agent Tokens give every AI agent — an MCP client, a LangChain assistant, a custom copilot — its own bounded, auditable, revocable identity, instead of sharing a human's session or a long-lived static API key. Each token delegates a scoped subset of one user's permissions and can be revoked independently at any time.
How It Works
Step 1 — Issue a Token (Self-Service, Org Admin)
Issuance requires the users resource permission — any org admin, not just
a superadmin. In the admin console, open Agent Tokens and click
Issue token: pick the delegating user, an agent_id (e.g.
claude-mcp-v1), a scope, and a TTL. The signed token is shown once.
ttl_seconds max
7776000). Prefer short-lived tokens for interactive agent sessions.
Step 2 — Predefined MCP Scopes
Discover the current scope catalog (public endpoint, no auth):
| Scope | Grants |
|---|---|
| mcp:read | Read access to MCP server resources (list tools, read outputs) |
| mcp:write | Write access to MCP server resources (invoke tools, store data) |
| mcp:tools:call | Permission to call any tool exposed by the MCP server |
| mcp:tools:list | Permission to list available tools without invoking them |
| mcp:resources:read | Read MCP resource URIs (files, databases, APIs) |
| mcp:resources:write | Write or update MCP resources |
| mcp:prompts:read | Read prompt templates from the MCP server |
| mcp:admin | Full administrative access to the MCP server (superscope) |
Scope down to a single tool with a custom scope (e.g. mcp:tools:search) —
the predefined list above is a reference, not an enforced enum. Combine with standard
OIDC scopes (openid profile email) as needed.
Step 3 — Authenticate the Agent
The agent presents the token as a standard Bearer credential against Clavex's built-in MCP server (JSON-RPC 2.0 over HTTP) or any resource server that trusts Clavex's JWKS.
Clavex's built-in MCP server exposes audit-copilot and identity-risk-advisor tools for
natural-language compliance queries; see the standalone
MCP server package (@clavex/mcp-server) for the
npm-distributed client and full tool catalog rather than duplicating it here.
Cross-Cloud Audience (STS / Workload Identity Federation)
By default a token's aud claim is the Clavex issuer itself. Set
audience to target an external OAuth2/OIDC-federation-aware resource server —
e.g. AWS STS (sts.amazonaws.com), Azure AD (api://AzureADTokenExchange),
or a GCP Workload Identity Federation pool provider. The requested audience must be present
in the org's agent_token_allowed_audiences allowlist, otherwise the request is
rejected with invalid_target — the same allowlist model used for RFC 8693
token-exchange audiences on OIDC clients.
Self-Service Revocation ("My Active Agents")
Any user — not just admins — can review and revoke the agents acting on their behalf:
$ curl -s -X DELETE https://id.clavex.eu/api/v1/me/agent-tokens/$TOKEN_ID \ -H "Authorization: Bearer $USER_TOKEN"
agent.token.issued /
agent.token.revoked) and fires a webhook, so security teams can track exactly
which agents hold live grants and who created them.