-
Notifications
You must be signed in to change notification settings - Fork 6
fix: pass ANTHROPIC_API_KEY to validation in all Claude workflows #808
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
fix: pass ANTHROPIC_API_KEY to validation in all Claude workflows #808
Conversation
Co-authored-by: lpcox <[email protected]>
Co-authored-by: lpcox <[email protected]>
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
✅ Bun Build Test - PASS
Overall: PASS All Bun projects successfully installed dependencies and passed tests.
|
Node.js Build Test Results ✅All tests completed successfully!
Overall: PASS ✅ All three Node.js projects built and tested successfully.
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PASS cc:
|
Build Test: Deno ✅
Overall: ✅ PASS All Deno tests completed successfully.
|
.NET Build Test Results
Overall: PASS ✅ All .NET projects restored, built, and ran successfully.
|
Rust Build Test Results
Overall: PASS All Rust projects built successfully and all tests passed.
|
Go Build Test Results ✅All Go projects tested successfully!
Overall: PASS All module downloads succeeded and all tests passed.
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects successfully configured and built.
|
Build Test: Java - Results
Overall: PASS All Java Maven projects compiled and tested successfully through the AWF firewall.
|
b78c2c3
into
claude/fix-github-actions-workflow-again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates Claude-based GitHub Actions workflows to correctly pass ANTHROPIC_API_KEY into the validate_multi_secret.sh step environment, aligning the validation script’s expectations with how secrets are configured in this repo.
Changes:
- Add
ANTHROPIC_API_KEYto the validation stepenv:in the Claude smoke workflow (agent + detection jobs). - Add
ANTHROPIC_API_KEYto the validation stepenv:in the Secret Digger (Claude) workflow (both jobs). - Add
ANTHROPIC_API_KEYto the validation stepenv:in the Security Guard workflow (both jobs).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/smoke-claude.lock.yml | Passes ANTHROPIC_API_KEY into the Claude secret validation step for both agent and detection jobs. |
| .github/workflows/security-guard.lock.yml | Passes ANTHROPIC_API_KEY into the Claude secret validation step for both jobs. |
| .github/workflows/secret-digger-claude.lock.yml | Passes ANTHROPIC_API_KEY into the Claude secret validation step for both jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN ANTHROPIC_API_KEY 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change passes ANTHROPIC_API_KEY into the validation step, but later steps that actually invoke claude in this workflow still only provide CLAUDE_CODE_OAUTH_TOKEN in their env: blocks. If the repo is configured with ANTHROPIC_API_KEY (and not CLAUDE_CODE_OAUTH_TOKEN), the workflow will likely proceed past validation and then fail when claude runs without credentials. Consider also wiring ANTHROPIC_API_KEY into the Execute Claude Code CLI step env (and any other step that needs auth), similar to how the Codex workflows pass both keys after validation.
See below for a potential fix:
- name: Validate CLAUDE_CODE_OAUTH_TOKEN secret
id: validate-secret
run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
with:
| run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN ANTHROPIC_API_KEY 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ANTHROPIC_API_KEY is now passed to the secret-validation step, but the subsequent step(s) that run claude in this workflow still only set CLAUDE_CODE_OAUTH_TOKEN in env:. If CLAUDE_CODE_OAUTH_TOKEN is unset and the repo relies on ANTHROPIC_API_KEY, validation will pass but the workflow can still fail at runtime due to missing auth. Consider passing ANTHROPIC_API_KEY to the Execute Claude Code CLI step env as well (and/or using a fallback expression) to keep validation aligned with runtime configuration.
See below for a potential fix:
- name: Validate CLAUDE_CODE_OAUTH_TOKEN secret
id: validate-secret
run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
| run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN ANTHROPIC_API_KEY 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds ANTHROPIC_API_KEY to the validation step env, but later steps that execute claude in this workflow only export CLAUDE_CODE_OAUTH_TOKEN. If the repository is configured with ANTHROPIC_API_KEY (as implied by the validation arguments), the workflow may still fail when claude runs without that key. Consider also passing ANTHROPIC_API_KEY into the Execute Claude Code CLI step env (both the agent and detection jobs, if applicable).
See below for a potential fix:
- name: Validate CLAUDE_CODE_OAUTH_TOKEN secret
id: validate-secret
run: /opt/gh-aw/actions/validate_multi_secret.sh CLAUDE_CODE_OAUTH_TOKEN 'Claude Code' https://github.github.com/gh-aw/reference/engines/#anthropic-claude-code
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
…ng (#802) * Initial plan * fix(ci): add BASE_URL environment variables for CODEX api-proxy routing CODEX was not being directed to use the api-proxy because the OPENAI_BASE_URL and ANTHROPIC_BASE_URL environment variables were not explicitly set in the smoke-codex workflow. While AWF automatically sets these variables when generating the docker-compose configuration (if API keys are present), explicitly setting them in the workflow env ensures they are available to the CODEX agent for routing API calls through the api-proxy sidecar. This fix adds: - OPENAI_BASE_URL=http://api-proxy:10000 - ANTHROPIC_BASE_URL=http://api-proxy:10001 to the 'Run Codex' step environment variables. Fixes job failure in run 63483600453. * fix(ci): remove API keys from agent env when api-proxy is enabled (#803) * Initial plan * fix(ci): remove API keys from agent env when api-proxy is enabled When api-proxy is enabled (indicated by BASE_URL environment variables), API keys should NOT be exposed to the agent container for security. The api-proxy sidecar holds the credentials and injects auth headers. Previously, the workflow was passing both: - CODEX_API_KEY and OPENAI_API_KEY (should NOT be in agent env) - OPENAI_BASE_URL and ANTHROPIC_BASE_URL (should be in agent env) This defeated the security isolation provided by api-proxy. Changes: - Removed CODEX_API_KEY and OPENAI_API_KEY from agent environment block - Kept OPENAI_BASE_URL and ANTHROPIC_BASE_URL for routing to api-proxy - The awf CLI still receives keys via `sudo -E` and `--env-all` - awf passes keys only to api-proxy container, not agent container Security model: - awf reads keys from host environment (process.env) - awf passes keys only to api-proxy sidecar (src/docker-manager.ts:908-909) - Agent only receives BASE_URL variables (src/docker-manager.ts:948-955) - api-proxy injects auth headers and routes through Squid 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]> Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix(firewall): add api-proxy to allowed domains when enabled (#804) * Initial plan * fix(firewall): add api-proxy to allowed domains when enabled Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix(squid): handle bare hostnames without leading dot for api-proxy (#805) * Initial plan * fix(squid): handle bare hostnames without leading dot for api-proxy Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix(agent): enable direct api-proxy access and remove api key from env (#807) * Initial plan * fix(agent): enable direct api-proxy access and remove api key from env - Add iptables bypass for api-proxy in setup-iptables.sh - Pass AWF_ENABLE_API_PROXY env var from docker-manager.ts - Remove ANTHROPIC_API_KEY from agent env in workflows - Update postprocess script to strip API key from compiled workflows Fixes agent->api-proxy connectivity and security vulnerability where API key was exposed to agent container instead of isolated to api-proxy. --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> * fix: pass ANTHROPIC_API_KEY to validation in all Claude workflows (#808) * Initial plan * fix: pass ANTHROPIC_API_KEY to validation step in smoke-claude workflow Co-authored-by: lpcox <[email protected]> * fix: pass ANTHROPIC_API_KEY to validation in all Claude workflows Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix: only enable api-proxy when API keys are provided (#810) * Initial plan * fix: only enable api-proxy when API keys are provided Co-authored-by: lpcox <[email protected]> * feat(workflow): enable api-proxy for smoke-claude workflow - Add --enable-api-proxy flag to awf command - Add --anthropic-api-key flag to pass API key to api-proxy sidecar - Add ANTHROPIC_API_KEY to env block for agent step - API key is shared with api-proxy, kept out of agent container - Agent uses ANTHROPIC_BASE_URL to direct requests to api-proxy Co-authored-by: lpcox <[email protected]> * refactor(workflow): remove redundant --enable-api-proxy flag The --enable-api-proxy flag defaults to true (src/cli.ts:724), so it doesn't need to be explicitly specified. The api-proxy sidecar will automatically deploy when API keys are present. See docs/api-proxy-sidecar.md:51 which states "The API proxy is enabled by default and automatically deploys when API keys are present" Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix: remove unknown --anthropic-api-key flag from smoke-claude workflow (#811) * Initial plan * fix: remove unknown --anthropic-api-key flag from smoke-claude workflow Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix: use api-proxy IP address instead of hostname for BASE_URL (#813) * Initial plan * fix: use api-proxy IP address instead of hostname for BASE_URL Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix: use api-proxy IP address instead of hostname for BASE_URL (#813) (#815) * Initial plan * fix: use api-proxy IP address instead of hostname for BASE_URL (#813) Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix(api-proxy): use IP address for API base URLs to avoid DNS issues In chroot mode, Docker container hostname resolution can fail because the DNS resolver may not properly reach Docker's embedded DNS. Use the api-proxy IP address directly (e.g., http://172.30.0.30:10001) instead of the hostname (http://api-proxy:10001) to eliminate DNS resolution as a failure point. Also add test coverage for the host-iptables api-proxy ACCEPT rule. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * fix: exclude API keys from agent when api-proxy is enabled (#814) * Initial plan * fix: exclude API keys from agent when api-proxy is enabled --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> * fix(agent): use AWF_API_PROXY_IP env var for api-proxy iptables rules (#817) * Initial plan * fix(agent): use AWF_API_PROXY_IP env var for api-proxy iptables Move api-proxy iptables rules to use pre-set AWF_API_PROXY_IP environment variable instead of dynamic hostname resolution, and place FILTER rules in the correct position (after NAT setup, before final DROP rule). Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * Add debug logging for BASE_URL environment variables in agent container (#816) * Initial plan * feat: add debug logging for BASE_URL environment variables Add logging to display ANTHROPIC_BASE_URL and OPENAI_BASE_URL values that are set for the agent container. This helps debug configuration issues when running Claude Code CLI in the workflow. The logging is added after the Docker Compose config is generated, showing whether BASE_URL variables are set or using defaults. Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * fix: simplify api-proxy iptables bypass condition (#819) * Initial plan * fix: simplify api-proxy iptables bypass condition The NAT bypass for api-proxy traffic was checking both AWF_ENABLE_API_PROXY and AWF_API_PROXY_IP, but this was too strict. When the HTTP_PROXY environment variable is set, HTTP clients will send requests through the proxy unless NO_PROXY is configured or iptables rules prevent it. The issue was that the NAT bypass required both flags, causing traffic to 172.30.0.30 (api-proxy) to be sent through Squid when it should go directly. Squid then blocked these requests because the IP address wasn't in the domain whitelist. The fix simplifies the condition to only check AWF_API_PROXY_IP, matching the pattern used for the OUTPUT FILTER ACCEPT rules (lines 285-289). This ensures that when AWF_API_PROXY_IP is set, traffic to that IP bypasses Squid at the NAT level, preventing HTTP clients from routing through the proxy regardless of HTTP_PROXY settings. Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> * Initial plan (#818) Co-authored-by: anthropic-code-agent[bot] <[email protected]> * fix: add api-proxy IP to squid allowlist (#820) * Initial plan * fix: add api-proxy IP to squid allowlist Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> --------- Co-authored-by: anthropic-code-agent[bot] <[email protected]> Co-authored-by: lpcox <[email protected]> Co-authored-by: Landon Cox <[email protected]> Co-authored-by: Jiaxiao (mossaka) Zhou <[email protected]> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
The Claude smoke test and other Claude-based workflows were failing at the secret validation step because
ANTHROPIC_API_KEYwas not passed to the validation script's environment.Root Cause
The
validate_multi_secret.shscript checks for eitherCLAUDE_CODE_OAUTH_TOKENorANTHROPIC_API_KEY, but onlyCLAUDE_CODE_OAUTH_TOKENwas in the step'senv:section. Since the repository usesANTHROPIC_API_KEY, validation failed.Changes
ANTHROPIC_API_KEYto validation step env in agent and detection jobsANTHROPIC_API_KEYto validation step env in both jobsANTHROPIC_API_KEYto validation step env in both jobs