fix: allow --env proxy overrides + move net isolation check into AWF container#6267
Conversation
The recent credential isolation fix (5eeaf42) added exclusion filtering to additionalEnv (--env CLI flags), which correctly prevents API keys from leaking into the agent. However, it also blocked proxy environment variables (NO_PROXY, HTTP_PROXY, etc.) from being set via --env, since PROXY_ENV_VARS are in the exclusion set to prevent host proxy leakage via --env-all. Fix: allow proxy vars through additionalEnv by checking them against the PROXY_ENV_VARS allowlist, while still blocking credentials and other excluded vars. Also regenerates docs/awf-config.schema.json to sync with source schema changes from the same commit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d5581386-83e8-445d-9f96-afdf5cdc915f
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
…abled Adds unit tests confirming that real credentials passed via additionalEnv (--env CLI flags) are still excluded from the agent container when enableApiProxy is true. This ensures the proxy var allowlist in the previous commit doesn't create a credential bypass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d5581386-83e8-445d-9f96-afdf5cdc915f
There was a problem hiding this comment.
Pull request overview
Restores explicit proxy environment overrides while retaining credential isolation.
Changes:
- Allows
--envto override proxy variables. - Updates and synchronizes configuration schemas.
Show a summary per file
| File | Description |
|---|---|
src/services/agent-environment/github-actions-environment.ts |
Permits explicit proxy overrides. |
src/awf-config-schema.json |
Updates runtime schema documentation. |
docs/awf-config.schema.json |
Regenerates the published schema. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Medium
| if (!excludedEnvVars.has(key) || proxyVarSet.has(key)) { | ||
| environment[key] = value; |
| "environment": { | ||
| "type": "object", | ||
| "description": "Environment variable propagation into the agent container. Merge behavior is: AWF-reserved variables are set by AWF and are not overridden by envAll or envFile; if envAll is true, host environment variables are forwarded next; envFile is then applied only for variables not already present, so it does not override envAll; CLI -e/--env has highest precedence and may override any variable, including AWF-reserved ones. When apiProxy.enabled is true, source credentials (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) are excluded from the agent and held in the API proxy sidecar. See docs/awf-config-spec.md §8–9 for credential isolation rules.", | ||
| "description": "Environment variable propagation into the agent container. Merge behavior is: AWF-reserved variables are set by AWF and are not overridden by envAll or envFile; if envAll is true, host environment variables are forwarded next; envFile is then applied only for variables not already present, so it does not override envAll; CLI -e/--env has highest precedence and may override any variable, including AWF-reserved ones. Source credentials (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) are always excluded from the agent and held in the API proxy sidecar. See docs/awf-config-spec.md §8–9 for credential isolation rules.", |
|
@copilot address review feedback |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed... |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Contribution Check completed successfully! |
|
🚀 Security Guard has started processing this pull request |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✨ 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. |
|
🦎🏗️ Smoke gVisor Build Test completed. gVisor build test passed. ✅ |
|
🦎🟣 Smoke gVisor Claude reports failed. gVisor + Claude compatibility issue detected. |
🔥 Smoke Test Results
Overall: PASS PR author: @lpcox 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) — PASS
Running in direct BYOK mode ( Overall: PASS — @lpcox 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.
|
🔍 API Proxy OTEL Smoke Test Results
Summary: All 5 scenarios pass. OTEL tracing integration is working correctly. 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: PAT Auth Validation
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: Claude Engine Validation
Overall Result: 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.
|
🦎 gVisor Smoke Test Results
Overall: PASS @lpcox Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"
- "host.docker.internal"See Network Configuration for more information.
|
Smoke Test: gVisor + Claude🦎🟣 gVisor + Claude runtime: unconfirmed (kernel reports Linux 4.4.0, no gVisor marker)
Overall status: FAIL (runtime unconfirmed, MCP unavailable) Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"
- "host.docker.internal"See Network Configuration for more information.
|
|
Thanks for the clear description and the added regression tests. Per the Pull request requirements in CONTRIBUTING.md, please reference any related issue(s) if this change addresses one, so the PR can be linked to the relevant discussion. 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
Overall status: FAIL Warning 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: 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: Docker Sbx Validation
Overall: PARTIAL — MCP connectivity confirmed; pre-step data unavailable.
|
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.
|
🏗️ 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.
|
|
🐳🔮 Docker sbx + Codex
|
🐳🟣 Docker sbx + Claude
Overall: FAIL (network isolation did not block example.com)
|
|
Merged PRs reviewed: fix: disable Bun JIT in smoke-gvisor-claude to prevent SIGSEGV/SIGABRT; chore: update model-to-API mapping (2026-07-15)\n✅ GitHub merged PR review\n✅ GitHub title check\n✅ File write/read\n✅ Playwright title check\n❌ npm ci && npm run build (stalled >3 min)\nOverall: FAIL 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.
|
Problem 1: Proxy env var overrides blocked by credential exclusion
The recent credential isolation fix (5eeaf42) added exclusion filtering to
additionalEnv(--envCLI flags) to prevent API keys from leaking into the agent container. However, it also inadvertently blocked proxy environment variables (NO_PROXY,HTTP_PROXY, etc.) from being set via--env, sincePROXY_ENV_VARSare in the exclusion set to prevent host proxy leakage via--env-all.Fix
Allow proxy vars through
additionalEnvby checking them against thePROXY_ENV_VARSallowlist, while still blocking credentials. Added unit tests confirmingGITHUB_TOKENandGH_TOKENare still blocked fromadditionalEnvwhenenableApiProxyis true.Problem 2: Network isolation check ran outside the firewall
The
net-checkstep insmoke-gvisor-build-testandsmoke-docker-sbx-build-testworkflows rancurl https://example.comas a pre-agent step on the bare GitHub Actions runner, which has unrestricted internet access. This meant the test always returned HTTP 200 and reportednet_isolation=FAIL— a false negative that made the firewall appear broken.Fix
Removed the pre-agent
net-checkstep and moved the network isolation verification into the agent prompt, so it runs inside the AWF sandbox where the firewall is actually enforcing domain restrictions.Testing
All 3781 tests pass.