Skip to content

docs: add Anthropic WIF as a first-class Claude auth option#39241

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-auth-docs-anthropic
Jun 14, 2026
Merged

docs: add Anthropic WIF as a first-class Claude auth option#39241
pelikhan merged 4 commits into
mainfrom
copilot/fix-auth-docs-anthropic

Conversation

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

auth.mdx incorrectly stated ANTHROPIC_API_KEY is the only Claude auth method. Anthropic WIF (keyless OIDC-based auth via engine.auth.type: github-oidc + provider: anthropic) has been supported since v0.79.6 and was entirely undocumented.

docs/reference/auth.mdx

  • "Which secret do I need?" — Claude bullet: replaced "Required / Alternative: None" with two labelled paths: ANTHROPIC_API_KEY (standard) and engine.auth Anthropic WIF (keyless)
  • ANTHROPIC_API_KEY section: removed false "only supported method" claim; added forward-link to new WIF section. Statement that CLAUDE_CODE_OAUTH_TOKEN is unsupported is preserved.
  • New ### Anthropic Workload Identity Federation (WIF) section: prerequisites, full frontmatter example, field reference table, emitted AWF_AUTH_ANTHROPIC_* env var table, link to Anthropic's GitHub Actions WIF docs, available-since version.
permissions:
  contents: read
  id-token: write

engine:
  id: claude
  auth:
    type: github-oidc
    provider: anthropic
    federation-rule-id: fdrl_xxxxxxxxxxxx
    organization-id: org_xxxxxxxxxxxx
    service-account-id: svac_xxxxxxxxxxxx
    workspace-id: ws_xxxxxxxxxxxx

docs/reference/engines.md

  • "Available Coding Agents" table — Claude row: auth column now links to both ANTHROPIC_API_KEY (standard) and the new WIF section (keyless).

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot validate all env vars with awf specification

Copilot AI and others added 2 commits June 14, 2026 16:16
- Update auth.mdx Claude section to list both standard (ANTHROPIC_API_KEY)
  and keyless (Anthropic WIF) options
- Fix false "only supported method" claim in ANTHROPIC_API_KEY section
- Add new Anthropic Workload Identity Federation (WIF) subsection with
  frontmatter example, field table, and emitted env var table
- Update engines.md Claude row to link to both auth options

Closes #39237

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix documentation for Anthropic auth methods docs: add Anthropic WIF as a first-class Claude auth option Jun 14, 2026
Copilot AI requested a review from pelikhan June 14, 2026 16:19
Validated against pkg/workflow/schemas/awf-config.schema.json:
- Added AWF_AUTH_TYPE (from type: github-oidc)
- Added optional AWF_AUTH_OIDC_AUDIENCE with default
- Added optional AWF_AUTH_ANTHROPIC_TOKEN_URL with default
- Updated field table to show required vs optional fields
- Added commented examples of optional fields in frontmatter

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot validate all env vars with awf specification

Validated against pkg/workflow/schemas/awf-config.schema.json. Added missing env vars:

  • AWF_AUTH_TYPE (from type: github-oidc)
  • AWF_AUTH_OIDC_AUDIENCE (optional, default: https://api.anthropic.com)
  • AWF_AUTH_ANTHROPIC_TOKEN_URL (optional, default: https://api.anthropic.com/v1/oauth/token)

All documented env vars now match the AWF specification. Commit: 7a8b9c1

@pelikhan pelikhan marked this pull request as ready for review June 14, 2026 16:30
Copilot AI review requested due to automatic review settings June 14, 2026 16:30
@pelikhan pelikhan merged commit f2481e1 into main Jun 14, 2026
7 checks passed
@pelikhan pelikhan deleted the copilot/fix-auth-docs-anthropic branch June 14, 2026 16:31
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. PR #39241 only modifies documentation files (auth.mdx and engines.md). Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #39241 does not have the implementation label (has_implementation_label=false) and has 0 new lines of code in business logic directories (default_business_additions=0, threshold=100). Neither enforcement condition is met.

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

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.

Pull request overview

Updates the documentation to describe Anthropic Workload Identity Federation (WIF) as a first-class, keyless authentication option for the Claude engine, correcting prior guidance that implied ANTHROPIC_API_KEY was the only supported method.

Changes:

  • Updates the Claude authentication guidance in auth.mdx to include a new Anthropic WIF section and cross-links from the ANTHROPIC_API_KEY section.
  • Updates the “Available Coding Agents” table to link Claude authentication to both ANTHROPIC_API_KEY and the new WIF section.
Show a summary per file
File Description
docs/src/content/docs/reference/engines.md Updates the Claude engine row to reference both standard API key auth and keyless WIF docs.
docs/src/content/docs/reference/auth.mdx Documents Anthropic WIF configuration and updates Claude auth guidance/cross-links.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 5

|--------|-----------------|-----------------|
| [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli) (default) | `copilot` | [`copilot-requests: write`](/gh-aw/reference/auth/#copilot-requests-write-permission) (recommended) or [`COPILOT_GITHUB_TOKEN`](/gh-aw/reference/auth/#copilot_github_token) |
| [Claude by Anthropic (Claude Code)](https://www.anthropic.com/index/claude) | `claude` | [ANTHROPIC_API_KEY](/gh-aw/reference/auth/#anthropic_api_key) |
| [Claude by Anthropic (Claude Code)](https://www.anthropic.com/index/claude) | `claude` | [`ANTHROPIC_API_KEY`](/gh-aw/reference/auth/#anthropic_api_key) (standard) or [`engine.auth` Anthropic WIF](/gh-aw/reference/auth/#anthropic-workload-identity-federation-wif) (keyless) |
**`CLAUDE_CODE_OAUTH_TOKEN`**:

`CLAUDE_CODE_OAUTH_TOKEN` is not supported by GitHub Agentic Workflows. The only supported authentication method for the Claude engine is `ANTHROPIC_API_KEY`. Provider-based OAuth authentication (such as billing through a Claude Teams or Claude Max subscription) is not supported. If you have set `CLAUDE_CODE_OAUTH_TOKEN` as a repository secret, it will be ignored — configure `ANTHROPIC_API_KEY` instead.
`CLAUDE_CODE_OAUTH_TOKEN` is not supported by GitHub Agentic Workflows. Provider-based OAuth authentication (such as billing through a Claude Teams or Claude Max subscription) is not supported. If you have set `CLAUDE_CODE_OAUTH_TOKEN` as a repository secret, it will be ignored — configure `ANTHROPIC_API_KEY` instead. For keyless authentication via Workload Identity Federation, see [Anthropic WIF](#anthropic-workload-identity-federation-wif) below.
Comment on lines +234 to +237
# Optional: override OIDC audience claim (default: https://api.anthropic.com)
# oidc-audience: https://api.anthropic.com
# Optional: override token exchange endpoint (default: https://api.anthropic.com/v1/oauth/token)
# token-url: https://api.anthropic.com/v1/oauth/token
Comment on lines +248 to +249
| `oidc-audience` | Optional | Audience claim for GitHub OIDC token (default: `https://api.anthropic.com`) |
| `token-url` | Optional | Token exchange endpoint override (default: `https://api.anthropic.com/v1/oauth/token`) |
Comment on lines +268 to +269
| `oidc-audience` | `AWF_AUTH_OIDC_AUDIENCE` | `https://api.anthropic.com` |
| `token-url` | `AWF_AUTH_ANTHROPIC_TOKEN_URL` | `https://api.anthropic.com/v1/oauth/token` |
@github-actions github-actions Bot mentioned this pull request Jun 14, 2026

@github-actions github-actions Bot 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.

REQUEST_CHANGES — one factually wrong version claim, two FAQ entries that directly contradict this PR's stated purpose, and minor consistency issues in the new WIF section.

Blocking issues in faq.md (not in diff — needs a separate fix)

faq.md line 370 — FAQ still declares ANTHROPIC_API_KEY the only supported Claude auth

"No. The Claude engine only supports ANTHROPIC_API_KEY as a GitHub Actions secret."

This PR exists to correct exactly this false claim in auth.mdx, but the identical claim survives untouched in faq.md. Users who read the FAQ will be actively mis-directed. Suggested replacement:

No. The Claude engine does not support `CLAUDE_CODE_OAUTH_TOKEN`. Supported Claude auth methods are [`ANTHROPIC_API_KEY`](/gh-aw/reference/auth/#anthropic_api_key) (standard) and [Anthropic WIF](/gh-aw/reference/auth/#anthropic-workload-identity-federation-wif) (keyless OIDC). Provider-based OAuth (e.g., Claude Teams billing) is not supported.

faq.md line 579 — WIF users have no cost-attribution guidance

"Claude: the Anthropic account tied to the ANTHROPIC_API_KEY secret."

When using WIF there is no ANTHROPIC_API_KEY. The billing identity is the WIF service account/organization. Without updating this line, users who switch to WIF have no idea how costs are attributed.

Non-blocking inline findings (3 comments posted)
  • auth.mdx:271Available since: v0.79.6 contradicts the blog post that places WIF introduction at v0.77.4 (May 31 2026)
  • auth.mdx:216 — Prerequisite says "in the workflow job" but the frontmatter example (and all other auth sections) uses top-level permissions:
  • auth.mdx:258 — Env var table mixes key: value inline notation (rows 1–2) with bare key names (rows 3–6)

🔎 Code quality review by PR Code Quality Reviewer · 529.2 AIC · ⌖ 13.6 AIC · ⊞ 16.7K

| `oidc-audience` | `AWF_AUTH_OIDC_AUDIENCE` | `https://api.anthropic.com` |
| `token-url` | `AWF_AUTH_ANTHROPIC_TOKEN_URL` | `https://api.anthropic.com/v1/oauth/token` |

Available since: v0.79.6 (2026-06-11).

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.

Wrong Available since version — contradicts the repo blog post.

The new section claims Available since: v0.79.6 (2026-06-11), but docs/src/content/docs/blog/2026-06-01-weekly-update.md explicitly states WIF was introduced in v0.77.4 (published May 31, 2026) via PR #35939.

💡 Suggested fix

Change to:

Available since: v0.77.4 (2026-05-31).

Or, if v0.79.6 stabilised the Anthropic-specific provider (as opposed to the generic github-oidc type), add a clarifying note:

Available since: v0.77.4 (2026-05-31); Anthropic provider stable since v0.79.6 (2026-06-11).

Either way, the current claim contradicts repo-owned release documentation and will actively mislead users triaging whether their version supports WIF.

| `oidc-audience` | `AWF_AUTH_OIDC_AUDIENCE` | `https://api.anthropic.com` |
| `token-url` | `AWF_AUTH_ANTHROPIC_TOKEN_URL` | `https://api.anthropic.com/v1/oauth/token` |

Available since: v0.79.6 (2026-06-11).

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.

Wrong Available-since version — contradicts the repo blog post. The new section claims v0.79.6 (2026-06-11), but docs/src/content/docs/blog/2026-06-01-weekly-update.md states WIF shipped in v0.77.4 (May 31 2026).

| Field | Env var |
|---|---|
| `type: github-oidc` | `AWF_AUTH_TYPE=github-oidc` |
| `provider: anthropic` | `AWF_AUTH_PROVIDER=anthropic` |

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.

Inconsistent Field column format: first two rows embed the assigned value, the rest use only the key name.

💡 Details

Rows 1–2 show type: github-oidc and provider: anthropic (key + value inline), while rows 3–6 show bare keys like federation-rule-id. Since type and provider are fixed constants (not user-supplied), the cleanest fix is to drop them from this table entirely — they are already documented in the frontmatter example — and only tabulate the user-configurable mappings. If they must be listed, use a uniform format across all rows.


**Prerequisites:**
- An Anthropic federation rule configured in your Anthropic workspace (obtain the IDs from your [Anthropic Console](https://platform.claude.com/docs/en/manage-claude/wif-providers/github-actions))
- `permissions: id-token: write` in the workflow job

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.

"In the workflow job" is inconsistent with the frontmatter example immediately below, which uses top-level permissions.

💡 Suggested fix

The prerequisite says permissions: id-token: write "in the workflow job", but the frontmatter example shows it at the workflow (top) level — which is how gh-aw frontmatter works. Compare the Copilot section which correctly says "Add copilot-requests: write to the permissions: block of your workflow frontmatter."

Change:

- `permissions: id-token: write` in the workflow job

To:

- `id-token: write` in the workflow frontmatter `permissions:` block

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /grill-with-docs — requesting changes on field name accuracy and docs-vs-implementation alignment.

�� Key Themes & Highlights

Key Issues

  • Field name mismatch: The frontmatter example and field table use oidc-audience but the compiler parses audience (engine_config_parser.go line 121). A user copying the example verbatim will silently skip the audience override.
  • Unverified env-var emission: token-urlAWF_AUTH_ANTHROPIC_TOKEN_URL is described in the schema but not emitted in engine.go; the optional-fields table should reflect actual compiler behaviour.
  • workspace-id cardinality: Schema says "Required when the federation rule covers multiple workspaces" but the table marks it ✅ unconditionally — needs alignment.
  • Prerequisites notation: `permissions: id-token: write` looks like a flat YAML key; clearer as `id-token: write` under `permissions:`.

Positive Highlights

  • ✅ Excellent initiative to document a previously undocumented but already-shipped feature
  • ✅ The env-var mapping tables are a great addition for debugging
  • ✅ The Available since: v0.79.6 note is a useful versioning anchor
  • ✅ The dual-option update to the engines.md quick-reference table keeps it consistent

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 406.3 AIC · ⌖ 13.8 AIC · ⊞ 27.9K


**Prerequisites:**
- An Anthropic federation rule configured in your Anthropic workspace (obtain the IDs from your [Anthropic Console](https://platform.claude.com/docs/en/manage-claude/wif-providers/github-actions))
- `permissions: id-token: write` in the workflow job

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.

[/grill-with-docs] The code span `permissions: id-token: write` reads as a flat YAML key, but permissions and id-token are separate nested keys — a reader unfamiliar with GitHub Actions OIDC config could write this as-is and get an invalid workflow.

💡 Suggested rewording
-- `permissions: id-token: write` in the workflow job
+- `id-token: write` under `permissions:` in the workflow job

Alternatively, drop this bullet and add a brief forward reference to the Frontmatter code block below, which already shows the correct structure.

| `federation-rule-id` | ✅ | ID of the Anthropic WIF federation rule (prefix `fdrl_`) |
| `organization-id` | ✅ | Anthropic organization ID (prefix `org_`) |
| `service-account-id` | ✅ | Anthropic service account ID (prefix `svac_`) |
| `workspace-id` | ✅ | Anthropic workspace ID (prefix `ws_`) |

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.

[/grill-with-docs] workspace-id is marked as always required but the compiler schema says "Required when the federation rule covers multiple workspaces" — it may be optional for single-workspace setups.

💡 Suggested fix

From pkg/workflow/schemas/awf-config.schema.json:

"Anthropic workspace ID. Required when the federation rule covers multiple workspaces. Maps to AWF_AUTH_ANTHROPIC_WORKSPACE_ID."

If conditionally required, update the table row to say "Conditional" instead of ✅ and document the exact condition. If always required in practice, correct the schema description to match.

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