Use workload identity federation for Claude auth in CI workflows#61584
Merged
Conversation
Replace the static ANTHROPIC_API_KEY secret with Workload Identity Federation inputs in claude.yml, claude-issue-triage.yml, and claude-dedupe-issues.yml. The federation rule, organization, service account, and workspace IDs are read from repository variables.
MaxLeiter
approved these changes
May 22, 2026
This was referenced May 23, 2026
sjbrenchley89
pushed a commit
to sjbrenchley89/claude-code
that referenced
this pull request
Jun 1, 2026
…hropics#61584) Replace the static ANTHROPIC_API_KEY secret with Workload Identity Federation inputs in claude.yml, claude-issue-triage.yml, and claude-dedupe-issues.yml. The federation rule, organization, service account, and workspace IDs are read from repository variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Switches this repository's Claude automation workflows from the static
ANTHROPIC_API_KEYsecret to Workload Identity Federation: the workflow's GitHub OIDC token is exchanged for a short-lived Claude API access token at runtime, so no long-lived API key needs to be stored in the repository.claude.ymlanthropic_api_key→ federation inputs (already requestsid-token: write)claude-issue-triage.ymlanthropic_api_key→ federation inputs, plusid-token: writeclaude-dedupe-issues.ymlanthropic_api_key→ federation inputs, plusid-token: writeThis is the same feature
claude-code-actionships for its users (anthropics/claude-code-action#1338,docs/setup.md).How it activates
The federation rule, organization, service account, and workspace IDs are read from repository variables (
vars.ANTHROPIC_FEDERATION_RULE_ID,vars.ANTHROPIC_ORGANIZATION_ID,vars.ANTHROPIC_SERVICE_ACCOUNT_ID,vars.ANTHROPIC_WORKSPACE_ID). These are identifiers, not credentials. Until a repo admin sets them, the action fails fast at env validation with a clear "authentication required" message — so this PR is safe to merge ahead of that, and switching over is a settings change rather than another PR.The
ANTHROPIC_API_KEYsecret is intentionally left in place until the federated path has produced green runs; rollback is reverting this PR.Behavior notes
pull_requestruns don't receiveid-token: write(GitHub withholds it the same way it withholds secrets), so behavior for forks is unchanged from the secret-based setup.