Skip to content

ci(OP-3891): authenticate Claude with workload identity federation - #779

Closed
fubezz wants to merge 2 commits into
mainfrom
chore/OP-3891-claude-wif
Closed

fubezz wants to merge 2 commits into
mainfrom
chore/OP-3891-claude-wif

Conversation

@fubezz

@fubezz fubezz commented Nov 13, 2026 •

Copy link
Copy Markdown

Why

Claude in CI should use Anthropic workload identity federation instead of the ANTHROPIC_API_KEY secret, so the key can be retired (OP-3891, OP-3890). This repository is public, so it gets a dedicated federation rule and repository-level ANTHROPIC_* variables instead of the org ones.

Impact

  • Claude workflows authenticate with a short-lived token; no secret is passed.
  • Merge only after the rule exists and the four repository variables are set, or Claude runs fail with 401.

Verification and rollback

  • Before merge: one test run with a temporary github_token commit; the log must show Workload identity federation configured.
  • After merge and one real run: gh secret delete ANTHROPIC_API_KEY -R aignostics/python-sdk.
  • Rollback: revert this PR (keep the secret until verified).

🤖 Generated with Claude Code

The reusable Claude workflow takes the four ANTHROPIC_* repository
variables instead of the ANTHROPIC_API_KEY secret. Public repositories do
not see the org variables, so the values are set on this repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ox-security

ox-security Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

✔ No issues found

Branch chore/OP-3891-claude-wif → main

View scan in OX Security →

@fubezz fubezz added claude and removed claude labels Nov 13, 2026
@fubezz
fubezz force-pushed the chore/OP-3891-claude-wif branch from 7654cd0 to 9f54fcc Compare November 13, 2026 14:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fubezz
fubezz marked this pull request as ready for review November 13, 2026 15:01
@fubezz
fubezz requested a review from a team as a code owner November 13, 2026 15:01
@olivermeyer

Copy link
Copy Markdown
Collaborator

I am removing the Claude workflows entirely in #778.

@fubezz

fubezz commented Nov 13, 2026

Copy link
Copy Markdown
Author

Superseded by #778, which removes the Claude Code workflows entirely.

@fubezz fubezz closed this Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing the API-key input disables buffered inline-comment classification in the pinned action, allowing test or probe comments to be posted to PRs because the classifier does not support federated credentials.

1 open issue
What changed in this PR

Migrates the SDK’s Claude CI workflows from a static Anthropic API key to workload identity federation, enabling the secret to be retired after verification.

Changes:

  • Configures both Claude action modes with four repository-level federation variables.
  • Removes API-key secret declarations and forwarding from caller workflows.
  • Updates CI documentation and permission comments to describe federated authentication.
File Description
.github/​workflows/​claude-code-interactive.yml Removes secret forwarding and clarifies the existing token permission.
.github/​workflows/​claude-code-automation-pr-review.yml Removes secret forwarding for automated PR reviews.
.github/​workflows/​claude-code-automation-operational-excellence-weekly.yml Removes secret forwarding for weekly automation.
.github/​workflows/​_claude-code.yml Replaces API-key inputs with federation variables in both modes.
.github/​CLAUDE.md Documents federation and removes the API key from the secrets list.

Review effort: Balanced

Comment on lines +78 to +81
anthropic_federation_rule_id: ${{ vars.ANTHROPIC_FEDERATION_RULE_ID }}
anthropic_organization_id: ${{ vars.ANTHROPIC_ORGANIZATION_ID }}
anthropic_service_account_id: ${{ vars.ANTHROPIC_SERVICE_ACCOUNT_ID }}
anthropic_workspace_id: ${{ vars.ANTHROPIC_WORKSPACE_ID }}
@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 1 file with indirect coverage changes

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants