Workload identity federation can replace stored model API keys in GitHub Actions

A DEV Community article explains that stored model API keys in CI can be avoided by using workload identity federation, which Anthropic's own documentation recommends. In this setup, a GitHub job obtains a short-lived OIDC token and exchanges it for a temporary model token, with a rule defining which repositories, branches, or environments may do so. The author warns that overly broad rules, such as matching all repositories in an organization without branch limits, could let fork pull-request runs obtain tokens. Support status is mixed: Claude Code Action and the Claude API support federation, OpenAI documents it for its API, and Codex federation remains in beta. The article also notes that long-lived, shared keys are risky because they stay valid after deletion and can be exploited quickly once exposed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in