Skip to main content

Render Now Mints Short-Lived OIDC Tokens for Anthropic and OpenAI: The Beginning of the End for LLM API Keys in Env Vars

10 min readDora NodaDora Noda
Share
On this page

GitGuardian's scan of public GitHub repositories found nearly 13 million leaked secrets — and a 1,212-fold increase in leaked OpenAI API keys. A separate September 2026 sweep of 28,000 exposed git repositories recovered 123 OpenAI keys plus hundreds of AWS and Stripe credentials, many of them still active when tested. The LLM API key in an env var has become the most-copied credential in software: pasted into dashboards, committed by accident, screenshotted into runbooks, and now handed to AI agents that carry it in their context wherever they go.

Against that backdrop, a short entry in Render's July 24, 2026 changelog matters more than its length suggests: managed OIDC now supports Anthropic and OpenAI in addition to AWS. Render services can authenticate to both LLM providers without storing long-lived API keys — Render issues short-lived identity tokens for each service and automatically rotates them as needed. This post explains how that federation actually works, maps the setup step by step on each provider, shows why the equivalent is native on self-hosted Kubernetes, and argues that keyless auth matters most for agent workloads.

How workload identity federation actually works

Workload identity federation replaces a shared secret with a three-party handshake. The moving parts are the same whether the issuer is Render, GitHub Actions, or your own Kubernetes cluster:

  1. The platform is the OIDC issuer. Instead of you pasting a provider API key into an env var, the platform mints a short-lived signed JWT that says "I am service X in environment Y." The token carries standard OIDC claims — issuer (iss), subject (sub), audience (aud) — and expires in minutes, not months.
  2. The provider holds the trust configuration. On the Anthropic or OpenAI side, you register the platform's issuer URL and audience once, then map token claims to a principal (a service account). This is the step where "Render service api-prod" becomes "allowed to act as the api-prod service account" — no shared secret crosses the boundary.
  3. At runtime, the SDK exchanges identity for access. The workload presents its identity token, the provider validates the signature against the registered issuer, and returns a short-lived access token scoped to the mapped service account. When the identity token rotates, the next exchange just uses the fresh one. There is nothing to rotate by hand and nothing long-lived to leak.

On Render specifically, the managed part is step 1 and the last mile of step 3. With a Pro workspace or higher, you configure which providers a service may federate to; at deploy time Render detects the federation env vars and injects one additional variable pointing at the service's OIDC credential file. Your code (or the provider SDK) reads the token from that file. You never see the token material, and you never paste a key.

The per-provider setup map: Anthropic vs OpenAI

Both providers converged on the same shape — service accounts as principals, an identity-provider registration plus trust step, a token file the SDK reads — but the details differ enough that a side-by-side map earns its place.

AnthropicOpenAI
Provider-side federationWorkload Identity Federation, GA June 17, 2026; any OIDC-compliant issuerNative workload identity federation; official guides for cloud and Kubernetes issuers
Trust configurationCreate a service account, then add Render as an identity provider (issuer URL + api.anthropic.com audience) with a federation rule mapping claimsSecurity → Workload Identity Provider tab (issuer URL + api.openai.com audience), then a service-account mapping bound to the account's User ID
Env vars you setANTHROPIC_FEDERATION_RULE_ID, ANTHROPIC_ORGANIZATION_ID, ANTHROPIC_SERVICE_ACCOUNT_ID, ANTHROPIC_WORKSPACE_IDOPENAI_IDENTITY_PROVIDER_ID, OPENAI_SERVICE_ACCOUNT_ID
Env var Render injectsANTHROPIC_IDENTITY_TOKEN_FILE (file path of the OIDC credentials — never set it manually)OPENAI_IDENTITY_TOKEN_FILE (same file-path pattern, same warning)
Runtime exchangeSDK auto-detects the env vars; new Anthropic() just works. Exchange happens against Anthropic's OAuth token endpointClient reads the token file at runtime to initialize; exchange follows RFC 8693 token exchange at auth.openai.com/oauth/token
CoverageAll Claude API endpoints, including first-party SDKs and Claude Code — headless CI runs need no static keyAPI principals are platform service accounts; the same federation shape extends to Codex surfaces

Two details in that table deserve emphasis. First, Anthropic's framing is explicit that the static key is meant to disappear entirely: with federation for workloads and ant auth login for interactive sessions, their words, developers never have to handle a static API key on the Claude Platform. Second, migration has a trap: in current SDK behavior a set ANTHROPIC_API_KEY outranks federation variables, so going keyless means actually unsetting the old key — leaving it in place while adding federation config silently keeps you on the static credential.

Render's docs also give you a way to verify the plumbing before trusting it: SSH into the service, read the identity token file into a variable, and run the provided test exchange. Do that once per provider. Federation misconfigurations fail at the trust step with unhelpful errors, and a two-minute manual exchange distinguishes "issuer not registered" from "claim mapping wrong" faster than redeploying blind.

The self-hosted equivalent is already in your cluster

Here is the part Render's changelog implies but doesn't say: nothing in the three-party handshake requires a PaaS. The issuer can be your own Kubernetes cluster, because every ServiceAccount already carries a projected OIDC token your cluster signs.

The primitives:

  • Projected ServiceAccount tokens. A pod can mount a token volume whose contents the kubelet keeps fresh — audience-bound, short TTL (minutes, configurable via the TokenRequest API), automatically rotated without a restart. This is the exact analog of Render's per-service identity token file, except you control the issuer key.
  • Cluster OIDC discovery. kubectl get --raw /.well-known/openid-configuration exposes the issuer URL and JWKS endpoint any OIDC relying party needs. Point Anthropic's identity-provider registration or OpenAI's workload-identity-provider screen at it, upload or reference the JWKS, and your cluster is a first-class issuer to both LLM providers.
  • Claim mapping as policy. The sub claim on a projected token names the namespace and ServiceAccount (system:serviceaccount:prod:api), so the provider-side mapping — "this subject may act as that service account" — doubles as least-privilege scoping per workload. One ServiceAccount per deployable, one mapping per account, and a leaked token is bound to one workload with minutes of life.

Both providers meet you halfway here. Anthropic's federation accepts any OIDC issuer and explicitly lists Kubernetes among the supported identity sources. OpenAI publishes a dedicated Kubernetes workload-identity guide walking through the ServiceAccount, issuer discovery, and JWKS steps. The ecosystem is following the same env-var shape Render uses — LiteLLM's federation support reads the same OPENAI_IDENTITY_PROVIDER_ID / OPENAI_SERVICE_ACCOUNT_ID / OPENAI_IDENTITY_TOKEN_FILE trio — so tooling written against the managed path ports to the self-hosted path with the issuer URL as the only real change.

The honest accounting: running your own issuer means operating the trust configuration yourself (registering the issuer per provider, scoping each claim mapping) instead of clicking through a PaaS dashboard. What you keep in return is the signing key and the rotation policy. For a fleet on owned machines, that is the same trade self-hosting always offers — and for workload identity, the operational delta is small because Kubernetes already mints, rotates, and serves the tokens whether you federate them or not.

Why keyless matters most for agents

Static LLM credentials were already leaking at industrial scale before agents. Agents make the blast radius worse in three specific ways:

  • Credentials ride in the context. An agent debugging a failing deploy reads env vars, prints them into tool results, and summarizes them into transcripts. Every one of those surfaces — traces, logs, session replays — becomes a place a long-lived key can rest. A short-lived token bound to the workload's identity is worthless minutes after the trace is written.
  • Config files are the new env files. Agent frameworks concentrate credentials in JSON configs (.mcp.json and friends) that get committed, screenshotted, and pasted into support threads with even less ceremony than a .env file. Federation moves the credential out of every file the agent touches: the only thing configured is the issuer registration and the claim mapping, neither of which is a secret.
  • Attribution needs workload identity anyway. When five agents share one sk-ant- key, the provider's audit log shows one principal and your incident review shows a mystery. Federation's per-workload service accounts give each agent its own identity, its own rate limits, and its own audit trail — the "which agent did this" question answers itself.

This is also why the agent angle cuts against staying on Render specifically: the platform that mints the identity doesn't have to be the platform that runs the workload. A deploy-from-chat agent running on your own cluster can federate its cluster-issued identity straight to Anthropic or OpenAI with no PaaS in the loop — the same handshake, one fewer intermediary holding the keys to the mint.

What still needs care

Keyless is not careless. Four things to get right before declaring victory:

  1. The claim mapping is the new policy surface. Federation replaces "who holds the key" with "which subjects map to which principals." A wildcard subject mapping (system:serviceaccount:prod:* → full-access service account) recreates the shared-credential problem with extra steps. Scope each mapping to one workload's exact subject, and review mappings with the same seriousness you once reviewed key distribution.
  2. Unset the static keys — everywhere. The SDK precedence trap from the Anthropic column applies broadly: a lingering ANTHROPIC_API_KEY or OPENAI_API_KEY in the environment silently wins over federation config. Migration checklists should end with a grep for the old variables across dashboards, CI secrets, and container images, not just the deploy that added federation.
  3. Protect the token file like a short-lived secret. Minutes of lifetime is not zero lifetime. The identity token file should be readable only by the workload user, never logged, and never mounted into debug sidecars that don't need it. Projected volumes and Render's managed injection both get the permissions right by default — custom plumbing must match that.
  4. Know what the managed path gates. Render's managed OIDC needs a Pro workspace or higher, and each provider's trust screen is still manual setup per service. Budget the per-service onboarding time honestly; the payoff is zero ongoing rotation toil, not zero setup.

None of these is an argument against federation. They are the actual work items, and they are smaller than the work they replace: no rotation calendars, no leaked-key incident response, no 1,212-fold growth curve to be on the wrong side of.

The env var era is ending — plan the migration

Render extending managed OIDC to Anthropic and OpenAI is a signal about where the ecosystem's default is heading: both model providers now accept federated workload identity as a first-class path, the SDKs auto-detect it, and the remaining setup is trust configuration, not secret management. Teams on Render should walk the setup map above service by service; teams on self-hosted Kubernetes should register their cluster issuer directly and skip the middleman. Either way, the goal is the same — an LLM credential that cannot be pasted, committed, or screenshotted because it only exists for minutes inside the workload that earned it.

Running your own fleet instead of renting Render's? Bex.co is the open-source, AI-native Render alternative — push a git repo, get a running HTTPS service on machines you own, with your cluster's own identity primitives under your control. Star the repo on GitHub or deploy your first app today.

Related articles

Give your agents a chain backend

Autonomous agents hit RPC endpoints very differently than people do. See what bex router handles on their behalf.

Read the agents guide