Today we're launching OpenID Connect (OIDC) support on Trigger.dev Cloud.
OIDC allows your tasks to request a short-lived token to access AWS, Anthropic and other services, instead of you storing secrets. Each token expires after 5 minutes.
It's available now for all Trigger.dev Cloud users.
Workload identity for tasks
OIDC is an open standard for proving who you are with a signed token. A service like Anthropic checks the token's signature and decides what it's allowed to do, so it doesn't need a stored key.
This is safer than storing an API key because:
- There's no long-lived key that can leak from your code, logs or environment variables.
- A token that does leak stops working within 5 minutes.
- To revoke access, you change the rule in the service you're connecting to, for example Anthropic. There's no key to rotate.
You can set it up in the dashboard under Security → OIDC. After that, a task asks for a token when it needs one:
const { token } = await auth.getOIDCToken({ audience: "https://api.anthropic.com" });
Tokens are signed with RS256 and expire after 5 minutes. The subject identifies the organization, project and environment, so Production, Staging and each Preview environment can get different permissions. For example, Production and Preview can use separate Anthropic workspaces, each with its own billing and rate limits.
Here's a task calling Anthropic without a long-lived API key:
You'll need the SDK and CLI at v4.8.3 or later. Redeploy after upgrading, then start a new run on that deployment. Local trigger dev runs can't mint tokens, so keep using your own credentials there.

