-
Notifications
You must be signed in to change notification settings - Fork 15
fix(claude): forward workload identity credentials #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 2 commits into
NVIDIA:main
from
AjayThorve:ajay/claude-wif-auth-forwarding
Jul 15, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| title: "Authenticate the Claude Adapter" | ||
| description: "Configure cached login, bearer token, API key, or Workload Identity Federation authentication for the NeMo Fabric Claude adapter." | ||
| --- | ||
| {/* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 */} | ||
|
|
||
| # Authenticate the Claude Adapter | ||
|
|
||
| The `nvidia.fabric.claude` adapter uses the Claude Agent SDK and its bundled | ||
| Claude Code runtime. Fabric preserves Claude's native credential precedence and | ||
| forwards only supported operating-system, configuration, and authentication | ||
| variables plus values explicitly configured in `harness.settings.env`. | ||
|
|
||
| ## Choose an Authentication Mode | ||
|
|
||
| Use the mode that matches the execution environment: | ||
|
|
||
| | Mode | Credential Source | Recommended Use | | ||
| | --- | --- | --- | | ||
| | Claude Code login | Cached Claude.ai or Anthropic Console login | Interactive local development | | ||
| | Bearer token | `ANTHROPIC_AUTH_TOKEN` | LLM gateways or proxies that authenticate with an `Authorization: Bearer` header | | ||
| | API key | `ANTHROPIC_API_KEY` | Local development, prototypes, and controlled servers | | ||
| | Workload Identity Federation (WIF) | Anthropic profile or direct federation environment variables | CI, cloud workloads, and Kubernetes without static API keys | | ||
|
|
||
| Claude Code selects `ANTHROPIC_AUTH_TOKEN` before `ANTHROPIC_API_KEY`. Both | ||
| environment credentials take precedence over WIF and cached login credentials. | ||
| An empty value still occupies its precedence slot, so unset an unused variable | ||
| instead of setting it to an empty string. | ||
|
|
||
| Claude Code can use a Claude.ai Pro or Max login, an Anthropic Console login, or | ||
| supported enterprise providers. Refer to the | ||
| [Claude Code authentication documentation](https://docs.anthropic.com/en/docs/claude-code/getting-started) | ||
| for the current subscription and enterprise options. | ||
|
|
||
| ## Use a Cached Claude Code Login | ||
|
|
||
| Authenticate Claude Code outside Fabric. The adapter inherits `HOME` and | ||
| `CLAUDE_CONFIG_DIR`, so the bundled runtime can reuse the same cached login. | ||
| Fabric does not copy the credential store into its configuration or artifacts. | ||
|
|
||
| ## Use an API Key | ||
|
|
||
| Set the API key in the process that invokes Fabric: | ||
|
|
||
| ```bash | ||
| export ANTHROPIC_API_KEY=sk-ant-api03-example | ||
| ``` | ||
|
|
||
| The adapter also forwards the selected model's `api_key_env` when the model | ||
| configuration names a different environment variable. | ||
|
|
||
| ## Use Workload Identity Federation | ||
|
|
||
| For a named WIF profile, set the profile and optional nondefault configuration | ||
| directory: | ||
|
|
||
| ```bash | ||
| export ANTHROPIC_CONFIG_DIR=/etc/anthropic | ||
| export ANTHROPIC_PROFILE=production | ||
| ``` | ||
|
|
||
| For direct environment configuration, provide the federation rule, | ||
| organization, service account, and one identity-token source: | ||
|
|
||
| ```bash | ||
| export ANTHROPIC_FEDERATION_RULE_ID=fdrl_example | ||
| export ANTHROPIC_ORGANIZATION_ID=00000000-0000-0000-0000-000000000000 | ||
| export ANTHROPIC_SERVICE_ACCOUNT_ID=svac_example | ||
| export ANTHROPIC_WORKSPACE_ID=wrkspc_example | ||
| export ANTHROPIC_IDENTITY_TOKEN_FILE=/var/run/secrets/anthropic.com/token | ||
| ``` | ||
|
|
||
| Use `ANTHROPIC_IDENTITY_TOKEN` instead of | ||
| `ANTHROPIC_IDENTITY_TOKEN_FILE` when the platform injects the identity token as | ||
| an environment variable. Refer to the | ||
| [Anthropic WIF reference](https://platform.claude.com/docs/en/manage-claude/wif-reference) | ||
| for credential precedence, profile structure, required claims, and provider | ||
| setup. | ||
|
|
||
| Unset `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` before using WIF. These | ||
| variables take precedence over federation even when their value is empty. | ||
|
|
||
| ## Use Authentication with Relay | ||
|
|
||
| NeMo Relay does not authenticate Claude. A Relay-enabled Fabric invocation | ||
| starts the gateway as a supervised sidecar and sets `ANTHROPIC_BASE_URL` for the | ||
| Claude runtime. Claude still resolves its credential through the selected mode, | ||
| and Fabric does not write authentication values to Relay configuration or | ||
| artifacts. | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.