Engineering · Nov 22, 2026 · 4 min read
Your agent's tools don't need API keys

Since June, you can call the Claude API without an API key. Anthropic's Workload Identity Federation lets a server trade an identity it already has, like an AWS IAM role or a Kubernetes service account, for a short-lived access token. In November 2025, AWS launched outbound identity federation, which lets code running on AWS present an AWS-signed token to services outside AWS. In both cases, a trusted party vouches for the caller, so there's no static credential to leak.
When an AI agent calls one of your tools, your server needs to know that the call really comes from your agent and which of your users it's acting for. A signed token from the platform that runs the agent can answer both.
API keys and OAuth fit agents poorly
An API key is a shared secret, so anyone who copies it can use it until someone revokes it. AWS's IAM best practices recommend temporary credentials over long-term access keys.
MCP's authorization spec is based on OAuth 2.1, but many MCP servers take an API key or bearer token in a header instead. That key tells your server that your app is calling, but not which user the agent works for.
OAuth's consent flow was built for a person granting one app access to their account, like a scheduling app reading their Google Calendar. If your agents use that flow for many users, your agent backend has to store a refresh token for each user and keep trading it for new access tokens. Third-party APIs like Google's still require this, but tool servers you run don't have to.
Who holds the private key
A signature can replace the shared secret in two ways, which differ in who holds the private key. With SSH and passkeys, the caller holds the private key and signs something unique to that login.
Between services, a common pattern is an identity token. An issuer that the receiving server trusts holds the private key and signs a short statement about the caller, like which server or CI job is calling. The server checks that statement against the issuer's public keys. An identity token is a bearer token, so anyone who holds it can use it until it expires.
A valid signature only proves who signed the token
In GitHub Actions, each job can get an OIDC token from GitHub that names its repository and workflow. AWS checks the token against GitHub's public keys and returns short-lived credentials, so no AWS secrets are stored in GitHub. But GitHub signs these tokens for jobs in anyone's repository. Your AWS role has to accept only tokens that name your repository, which is why GitHub's docs require at least one condition on the token's claims. A condition on the audience alone still lets every stranger's workflow in.
Let the agent platform sign each tool call
The platform that runs an agent can play the role GitHub plays for CI jobs. It knows which agent is calling and which user your app said the agent works for, so it can sign both into every tool call. Your tools then get the user behind each call without anyone storing a refresh token.
For agents, the biggest gain is that the model never sets the user. Your app sets the user, and the platform signs it. A model can be tricked into passing someone else's user id as a tool argument, but it can't change the user that the token names.
When several people share an agent, the token also names who sent the current message. If Bob asks an agent that works for Alice to open Alice's files, the tool sees that Bob sent the message and can check Bob's access instead. Otherwise the agent becomes a confused deputy, using Alice's access for Bob.
With these tokens, a tool server stores no credentials for its callers, so there's nothing of theirs to steal or rotate. It checks each token against the platform's published keys, which work for every tool server you run. A leaked token is worth far less than a leaked key, because it expires within minutes and names the one server that should accept it.
Your tool server now trusts the platform's signing key, the way AWS trusts GitHub's. The one secret you still hold is your app's API key for the platform, because that key creates agents and sets the user they work for.
How camelRun signs tool calls
For each request to an MCP server that opts in, camelRun, our agent runtime, signs a fresh JWT that lasts two minutes, with claims like these:
{
"aud": "https://tools.example.com/mcp",
"tenant": "tnt_3f9a1c27e8b04d55",
"agent": "agt_7c2e91b04f6a3d18",
"sub": "alice",
"act": "bob",
"exp": 1790000120
}
tenant is the camelRun account that created the agent. Like the repository in a GitHub token, it tells your server that your own app set sub, not someone else's.
Summary
- Identity tokens replace a shared secret with a short-lived token from an issuer the server trusts, as GitHub Actions, AWS, and the Claude API already do.
- When an agent platform signs each tool call, every call names its agent and user. Your app sets that user and the platform signs it, so the model can't change it.
camelRun is open source at github.com/qaml-ai/run. The identity docs list every claim in its tokens.