fix: allow --enable-host-access with --network-isolation (topology mode) - #6657
Conversation
In network-isolation mode the agent runs on an internal Docker network with no direct host route, so host-level iptables are never configured. The --enable-host-access flag in that mode drives Squid port ACLs and the host.docker.internal hosts-file entry for topology peers (--topology-attach) rather than iptables rules, making the combination safe and valid. Before this change: - strict mode: silently disabled enableHostAccess with a misleading "pass --legacy-security" warning even though legacy-security + enableHostAccess + networkIsolation would hard-error in the validator - legacy mode: hard error "not supported with --enable-host-access" After this change: - enableHostAccess is preserved when networkIsolation=true (strict mode always forces networkIsolation=true, so the suppression block is only reached when networkIsolation=false, which never happens in strict mode) - The hard error in validateFeatureFlagCompatibility is removed; a comment explains why the combination is intentionally allowed - allowHostServicePorts (iptables-based GitHub Actions services) is still suppressed in strict mode regardless of topology mode Closes #6651
There was a problem hiding this comment.
Pull request overview
Allows host-access options to coexist with topology-based network isolation.
Changes:
- Removes the incompatible-option rejection.
- Preserves host-access settings in strict topology mode.
- Updates tests and network-isolation documentation.
Show a summary per file
| File | Description |
|---|---|
src/commands/validators/security-mode.ts |
Preserves topology-compatible host access. |
src/commands/validators/security-mode.test.ts |
Updates strict-mode expectations. |
src/commands/validators/infrastructure-validator.ts |
Removes mutual-exclusion validation. |
src/commands/validators/config-assembly-flags.test.ts |
Verifies the combination is accepted. |
docs/network-isolation-design.md |
Documents the new compatibility. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Medium
| // NOTE: at this point in the pipeline, networkIsolation has already been | ||
| // forced to true above (for non-microVM runtimes), so | ||
| // !config.networkIsolation is false for standard Docker-compose runs. | ||
| if (config.enableHostAccess && !config.networkIsolation) { |
| // NOTE: at this point in the pipeline, networkIsolation has already been | ||
| // forced to true above (for non-microVM runtimes), so | ||
| // !config.networkIsolation is false for standard Docker-compose runs. | ||
| if (config.enableHostAccess && !config.networkIsolation) { |
|
@copilot address review feedback |
Addressed in 193466e. I updated strict-mode handling so microVM runtimes still suppress |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Contribution Check completed successfully! Contribution check complete: PR #6657 follows the applicable CONTRIBUTING.md guidelines. It includes tests for the new behavior, updates documentation, has a clear description with a related issue reference, and keeps files in the expected src/ and docs/ locations. |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Claude passed |
Smoke Test: Claude Engine Validation
Overall result: PASS ✅
|
Smoke Test: Copilot BYOK (Direct) ✅Test Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy sidecar) Status: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain ( Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test Results — Services Connectivity
Overall: FAIL —
|
📡 OTel Tracing Smoke Test Results
Overall: ✅ All implemented scenarios pass. S3 env-var forwarding is a known pending item (development phase).
|
Smoke Test: Gemini Engine Validation
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.
|
Chroot Version Comparison Results
Overall: ❌ FAILED — Node.js version mismatch (host: v24.18.0, chroot: v22.23.1).
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
🧪 Smoke Test: Docker Sbx — PASS
Overall: PASS
|
|
✅ Playwright GitHub title check
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Overall PASS
|
|
GitHub MCP connectivity: ["fix: allow --enable-host-access with --network-isolation (topology mode)", "docs: Runner Doctor 2026-07-27 scan — B13 update + B15/B16 new failure modes"] ✅
|
The gh-aw compiler emits
network.isolation: true+topologyAttachalongsidesecurity.enableHostAccess: true(auto-triggered whenlocalhostis in the domain allowlist). AWF was rejecting this combination — either a hard error in legacy mode or a silent suppression with a misleading "pass--legacy-security" warning in strict mode.The mutual exclusion was wrong: in topology mode the agent runs on an
internalDocker network with no host route, so no iptables-based host access is ever configured.--enable-host-accessin that mode drives Squid port ACLs and thehost.docker.internalhosts-file entry for topology peers — neither of which requires host-level iptables.Changes
infrastructure-validator.ts— removes the hard error fornetworkIsolation + enableHostAccess; replaces it with a comment explaining the combination is intentionally valid.security-mode.ts— adds&& !config.networkIsolationto the strict-mode suppression block forenableHostAccess/allowHostPorts. Since strict mode forcesnetworkIsolation = truebefore this check runs, host-access options are now preserved in all standard Docker-compose runs.allowHostServicePorts(iptables-based GitHub Actions services) is still suppressed unconditionally.Tests —
config-assembly-flags.test.tsrepurposed from "should exit" to "should accept" for the combination;security-mode.test.tsupdated to assertenableHostAccessis preserved in topology mode andallowHostServicePortsis still cleared.docs/network-isolation-design.md— updated §8.1 to reflect that--enable-host-accessis no longer rejected alongside--network-isolation.