Protect ANTHROPIC_AUTH_TOKEN in AWF credential isolation paths#6410
Conversation
ANTHROPIC_AUTH_TOKEN in AWF credential isolation paths
There was a problem hiding this comment.
Pull request overview
Protects ANTHROPIC_AUTH_TOKEN across AWF credential isolation, runtime cleanup, and Claude workflows.
Changes:
- Adds token exclusion, one-shot protection, and entrypoint cleanup.
- Updates Claude workflow exclusion and redaction.
- Adds regression tests and documentation.
Show a summary per file
| File | Description |
|---|---|
src/services/api-proxy-service-key-isolation.test.ts |
Tests host-token isolation. |
src/services/agent-environment/excluded-vars.ts |
Excludes the token from agent forwarding. |
src/services/agent-environment/excluded-vars.test.ts |
Tests exclusion behavior. |
src/services/agent-environment/core-environment.ts |
Adds one-shot protection. |
src/services/agent-environment-credentials.test.ts |
Tests the one-shot list. |
scripts/ci/anthropic-auth-token-workflow-protection.test.ts |
Checks workflow protection. |
docs/awf-config-spec.md |
Updates protected-token specification. |
docs/authentication-architecture.md |
Documents protection and cleanup. |
containers/agent/one-shot-token/src/lib.rs |
Updates Rust defaults. |
containers/agent/one-shot-token/README.md |
Documents the new default. |
containers/agent/one-shot-token/one-shot-token.c |
Updates obfuscated C defaults. |
containers/agent/one-shot-token/encode-tokens.sh |
Updates token generation input. |
containers/agent/one-shot-token/build.sh |
Extends cleartext hardening checks. |
containers/agent/entrypoint.sh |
Clears the token from PID 1. |
.github/workflows/smoke-gvisor-claude.lock.yml |
Adds exclusion and redaction. |
.github/workflows/smoke-docker-sbx-claude.lock.yml |
Adds exclusion and redaction. |
.github/workflows/smoke-claude.lock.yml |
Adds exclusion and redaction. |
.github/workflows/secret-digger-claude.lock.yml |
Protects both Claude execution paths. |
.github/workflows/red-team-benchmark.lock.yml |
Adds exclusion and redaction. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
scripts/ci/anthropic-auth-token-workflow-protection.test.ts:19
- These assertions only freeze hand-edited generated artifacts. Each changed lock says
DO NOT EDIT, while the documented regeneration path isgh aw compilefollowed bypostprocess-smoke-workflows.ts(.github/skills/pr-finisher/SKILL.md:107-114), and neither the source.mdfiles nor that postprocessor recreates these additions. The next normal recompile will remove the protection and leave the suite failing until all five locks are manually patched again. Encode the change in workflow source or in the postprocessor (with a transformation test), then regenerate the locks.
it.each(workflowLocks)('%s excludes and redacts ANTHROPIC_AUTH_TOKEN', (workflowLock) => {
const lock = fs.readFileSync(path.join(workflowsDir, workflowLock), 'utf-8');
expect(lock).toContain('--exclude-env ANTHROPIC_AUTH_TOKEN');
expect(lock).toContain('GH_AW_SECRET_NAMES: \'ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN');
expect(lock).toContain('SECRET_ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}');
- Files reviewed: 19/19 changed files
- Comments generated: 3
- Review effort level: Medium
| const workflowLocks = [ | ||
| 'red-team-benchmark.lock.yml', | ||
| 'secret-digger-claude.lock.yml', | ||
| 'smoke-claude.lock.yml', | ||
| 'smoke-docker-sbx-claude.lock.yml', | ||
| 'smoke-gvisor-claude.lock.yml', | ||
| ]; |
| "GITHUB_PERSONAL_ACCESS_TOKEN" | ||
| "OPENAI_API_KEY" "OPENAI_KEY" | ||
| "ANTHROPIC_API_KEY" "CLAUDE_API_KEY" "CLAUDE_CODE_OAUTH_TOKEN" | ||
| "ANTHROPIC_API_KEY" "ANTHROPIC_AUTH_TOKEN" "CLAUDE_API_KEY" "CLAUDE_CODE_OAUTH_TOKEN" |
| static const unsigned char OBF_9[] = { 0x19, 0x16, 0x1b, 0x0f, 0x1e, 0x1f, 0x05, 0x1b, 0x0a, 0x13, 0x05, 0x11, 0x1f, 0x03 }; /* length=14 */ | ||
| static const unsigned char OBF_10[] = { 0x19, 0x15, 0x1e, 0x1f, 0x02, 0x05, 0x1b, 0x0a, 0x13, 0x05, 0x11, 0x1f, 0x03 }; /* length=13 */ | ||
| static const unsigned char OBF_11[] = { 0x19, 0x15, 0x0a, 0x13, 0x16, 0x15, 0x0e, 0x05, 0x0a, 0x08, 0x15, 0x0c, 0x13, 0x1e, 0x1f, 0x08, 0x05, 0x1b, 0x0a, 0x13, 0x05, 0x11, 0x1f, 0x03 }; /* length=24 */ | ||
| static const unsigned char OBF_9[] = { 0x1b, 0x14, 0x0e, 0x12, 0x08, 0x15, 0x0a, 0x13, 0x19, 0x05, 0x1b, 0x0f, 0x0e, 0x12, 0x05, 0x0e, 0x15, 0x11, 0x1f, 0x14 }; /* length=20 */ |
|
@copilot address review feedbac |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Contribution Check completed successfully! PR only changes generated workflow lock files; no missing tests/docs/description issues were apparent from the provided context. |
|
✅ Smoke Claude passed |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
Smoke test results (Auth mode: PAT / COPILOT_GITHUB_TOKEN)
Overall: FAIL — workflow ran with unresolved Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🧪 Copilot Smoke Test — PASS
Overall: PASS — Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Direct) Mode ✅ PASSTests:
Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY. All connectivity and credential routing tests passed. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
Smoke test: Copilot network-isolation egress enforcement EGRESS_RESULT allow=pass deny=pass ✅ Test 1 (allowed domain Overall: PASS — Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"
- "example.com"See Network Configuration for more information.
|
Smoke Test
Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"
- "registry.npmjs.org"See Network Configuration for more information.
|
|
Smoke Test Results:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Services Connectivity
Overall: FAIL
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test Results\n\n- GitHub MCP Testing: ❌ (PRs #6409, #6407 filtered by secrecy policy)\n- GitHub.com Connectivity: ❌ (HTTP 000, Exit Code 7)\n- File Writing Testing: ✅\n- Bash Tool Testing: ✅\n\nOverall status: FAILWarning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing
Overall: ✅ All scenarios pass — OTEL integration is fully functional. The 59-test suite covers span creation, token/budget attributes (GenAI semantic conventions), OTLP export via proxy, serialization, and graceful no-op behavior when unconfigured. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Chroot Version Comparison
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
✅ GitHub MCP connectivity (pre-fetched PR data) Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔥 Smoke Test: Docker Sbx — PASS
Overall: PASS —
|
Update authentication-architecture.md to explicitly mention ANTHROPIC_AUTH_TOKEN alongside ANTHROPIC_API_KEY in the security design warning. This reflects the recent changes in PR #6410 that protect ANTHROPIC_AUTH_TOKEN through the same credential isolation mechanism. Related to commit 6d25856 (Protect `ANTHROPIC_AUTH_TOKEN` in AWF credential isolation paths). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
#6414) * docs: Document ANTHROPIC_AUTH_TOKEN protection in API proxy isolation Update authentication-architecture.md to explicitly mention ANTHROPIC_AUTH_TOKEN alongside ANTHROPIC_API_KEY in the security design warning. This reflects the recent changes in PR #6410 that protect ANTHROPIC_AUTH_TOKEN through the same credential isolation mechanism. Related to commit 6d25856 (Protect `ANTHROPIC_AUTH_TOKEN` in AWF credential isolation paths). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Landon Cox <landon.cox@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ANTHROPIC_AUTH_TOKENcould reach the agent container without the protections already applied to sibling Anthropic credentials. That left a gap in AWF’s credential isolation model: the token was neither scrubbed by one-shot token handling nor consistently excluded/redacted in Claude workflow paths.Runtime token protection
ANTHROPIC_AUTH_TOKENtoAWF_ONE_SHOT_TOKENSso unexpected real values are cleared on first access.one-shot-token.cand Rustsrc/lib.rs) to keep fallback behavior aligned.ANTHROPIC_AUTH_TOKEN.ANTHROPIC_AUTH_TOKENfails the one-shot library build.Agent environment isolation
ANTHROPIC_AUTH_TOKENto the API-proxy exclusion set so host-provided values do not pass through under--env-allor env-file forwarding.Workflow secret handling
--exclude-env ANTHROPIC_AUTH_TOKENANTHROPIC_AUTH_TOKENinGH_AW_SECRET_NAMESSECRET_ANTHROPIC_AUTH_TOKENinto log redactionDocs and regression coverage
ANTHROPIC_AUTH_TOKEN.AWF_ONE_SHOT_TOKENScontents--env-allisolation when a hostANTHROPIC_AUTH_TOKENis presentExample of the effective change:
awf ... \ --env-all \ --exclude-env ANTHROPIC_API_KEY \ --exclude-env ANTHROPIC_AUTH_TOKEN \ -- ... GH_AW_SECRET_NAMES='ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN,...'