Skip to content

fix: allow --env proxy overrides + move net isolation check into AWF container#6267

Merged
lpcox merged 4 commits into
mainfrom
fix/additionalenv-proxy-override
Jul 15, 2026
Merged

fix: allow --env proxy overrides + move net isolation check into AWF container#6267
lpcox merged 4 commits into
mainfrom
fix/additionalenv-proxy-override

Conversation

@lpcox

@lpcox lpcox commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Problem 1: Proxy env var overrides blocked by credential exclusion

The recent credential isolation fix (5eeaf42) added exclusion filtering to additionalEnv (--env CLI 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, 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. Added unit tests confirming GITHUB_TOKEN and GH_TOKEN are still blocked from additionalEnv when enableApiProxy is true.

Problem 2: Network isolation check ran outside the firewall

The net-check step in smoke-gvisor-build-test and smoke-docker-sbx-build-test workflows ran curl https://example.com as a pre-agent step on the bare GitHub Actions runner, which has unrestricted internet access. This meant the test always returned HTTP 200 and reported net_isolation=FAIL — a false negative that made the firewall appear broken.

Fix

Removed the pre-agent net-check step 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.

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
Copilot AI review requested due to automatic review settings July 15, 2026 16:35
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 91b89ee

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.85% 98.95% 📈 +0.10%
Statements 98.80% 98.89% 📈 +0.09%
Functions 99.35% 99.35% ➡️ +0.00%
Branches 95.03% 95.10% 📈 +0.07%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
src/services/agent-environment/github-actions-environment.ts 85.2% → 100.0% (+14.82%) 85.2% → 100.0% (+14.82%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

…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

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

Restores explicit proxy environment overrides while retaining credential isolation.

Changes:

  • Allows --env to 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

Comment on lines +46 to 47
if (!excludedEnvVars.has(key) || proxyVarSet.has(key)) {
environment[key] = value;
Comment thread src/awf-config-schema.json Outdated
"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.",
@lpcox

lpcox commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in a650024.

Copilot finished work on behalf of lpcox July 15, 2026 16:45
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🦎🏗️ Smoke gVisor Build Test completed. gVisor build test passed. ✅

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🦎🟣 Smoke gVisor Claude reports failed. gVisor + Claude compatibility issue detected.

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results

Test Status
MCP Connectivity
GitHub.com HTTP ✅ 200
File Write/Read

Overall: PASS

PR author: @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot BYOK (Direct) — PASS

Test Result
GitHub MCP (list PRs)
GitHub.com connectivity
File write/read
BYOK inference (this response)

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

Overall: PASS@lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔍 API Proxy OTEL Smoke Test Results

Scenario Result Notes
Module Loading ✅ Pass otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + internal helpers
Test Suite ✅ Pass 59 tests passed across otel.test.js + otel-fanout.test.js (0 failures)
Env Var Forwarding ✅ Pass api-proxy-env-config.test.ts confirms OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME are forwarded
Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (4 references) as the OTEL hook point
OTEL Diagnostics ✅ Pass Module initializes cleanly; graceful no-op when OTEL_EXPORTER_OTLP_ENDPOINT not set

Summary: All 5 scenarios pass. OTEL tracing integration is working correctly.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: PAT Auth Validation

Test Status
MCP Connectivity
GitHub.com HTTP ✅ 200
File Write/Read ⚠️ template vars not expanded

Overall: PASS
Auth mode: PAT (COPILOT_GITHUB_TOKEN) | Author: @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 PAT report filed by Smoke Copilot PAT
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API Status ✅ PASS
GH Check ✅ PASS
File Status ✅ PASS

Overall Result: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Smoke Claude for #6267 · 55.3 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🦎 gVisor Smoke Test Results

  • 🦎 gVisor runtime: unconfirmed (runc detected — expected until runtime plumbing is wired)
  • ✅ GitHub MCP: connected
  • ✅ GitHub.com connectivity: reachable
  • ✅ File write/read: OK
  • ✅ Network isolation: example.com blocked

Overall: PASS @lpcox

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • example.com
  • host.docker.internal

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"
    - "host.docker.internal"

See Network Configuration for more information.

🦎 gVisor smoke test by Smoke gVisor
Add label test-gvisor to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: gVisor + Claude

🦎🟣 gVisor + Claude runtime: unconfirmed (kernel reports Linux 4.4.0, no gVisor marker)

  • ❌ gVisor runtime verification (no gVisor string in /proc/version)
  • ❌ GitHub MCP (github-list_pull_requests tool unavailable in this env)
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read (smoke-test-gvisor-claude-29436670419.txt)
  • ✅ Network isolation (example.com blocked, HTTP 000)

Overall status: FAIL (runtime unconfirmed, MCP unavailable)

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • example.com
  • host.docker.internal

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"
    - "host.docker.internal"

See Network Configuration for more information.

🦎🟣 gVisor + Claude smoke test by Smoke gVisor Claude
Add label test-gvisor-claude to run again

@github-actions

Copy link
Copy Markdown
Contributor

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 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Contribution Check for #6267 · 4.14 AIC · ⊞ 19.2K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • GitHub MCP Testing: ❌ (Access Denied/Filtered)
  • GitHub.com Connectivity: ❌ (Status 000)
  • File Writing: ✅
  • Bash Tool Testing: ✅

Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ❌ Network unreachable
  • PostgreSQL pg_isready: ❌ No response
  • PostgreSQL SELECT 1: ❌ Network unreachable

Overall: FAILhost.docker.internal (172.17.0.1) is unreachable. Service containers may not be running or the host bridge is not accessible.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Docker Sbx Validation

Test Result
GitHub MCP Connectivity ✅ PASS
GitHub.com HTTP ⚠️ N/A (template vars unexpanded)
File Write/Read ⚠️ N/A (template vars unexpanded)

⚠️ Pre-computed test data (${{ steps.smoke-data.outputs.* }}) was not substituted — workflow step outputs may not have run or been passed correctly.

Overall: PARTIAL — MCP connectivity confirmed; pre-step data unavailable.

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ NO
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

⚠️ Not all tests passed — Python and Node.js versions differ between host and chroot.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx All passed ✅ PASS
Node.js execa All passed ✅ PASS
Node.js p-limit All passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Note: Java Maven required a writable local repo path (-Dmaven.repo.local) since /home/runner/.m2/ was owned by root.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Build Test Suite for #6267 · 35 AIC · ⊞ 6.9K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🐳🔮 Docker sbx + Codex
MCP: ✅
GitHub.com: ✅
File check: ✅
example.com: ❌ (returned 200, expected block)
Overall: FAIL

🐳🔮 Docker sbx + Codex smoke test by Smoke Docker Sbx Codex
Add label test-docker-sbx-codex to run again

@github-actions

Copy link
Copy Markdown
Contributor

🐳🟣 Docker sbx + Claude

  • ✅ GitHub MCP connectivity (PR list returned; 1 filtered by secrecy policy)
  • ✅ github.com connectivity (HTTP 200)
  • ✅ File write/read (smoke-test-docker-sbx-claude-29436670383.txt)
  • ❌ Network isolation (example.com returned HTTP 200 — not blocked)

Overall: FAIL (network isolation did not block example.com)

🐳🟣 Docker sbx + Claude smoke test by Smoke Docker Sbx Claude
Add label test-docker-sbx-claude to run again

@github-actions

Copy link
Copy Markdown
Contributor

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 domains

The following domains were blocked by the firewall during workflow execution:

  • awmgmcpg
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants