Add fail-closed Docker sbx egress verification - #7956
Conversation
Add an opt-in preflight for orchestrators that chain the sbx daemon through AWF Squid. The probe removes proxy variables and aborts when denied destinations remain reachable. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ba940bd-5aa8-4dd2-9c34-fc4c991fe355
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Curl configuration can bypass the direct-egress probe, and case-sensitive allowlist matching can reject valid configurations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/sbx-manager.ts — This manual plain-domain check is case-sensitive even though DNS/Squid matching is case-insensitive… |
|
src/sbx-manager.ts — Unsetting proxy environment variables does not guarantee that this is a direct request: curl still… |
What changed in this PR
Adds opt-in fail-closed Docker sbx egress verification supporting the compiler contract in github/gh-aw#57581.
Changes:
- Adds CLI/config/schema support for egress verification.
- Probes denied domains before agent execution.
- Documents sbx daemon proxy orchestration.
| File | Description |
|---|---|
src/types/network-options.ts |
Defines the network option. |
src/sbx-runtime-backend.ts |
Runs the startup verification. |
src/sbx-runtime-backend.test.ts |
Tests backend integration. |
src/sbx-manager.ts |
Implements egress probes. |
src/sbx-manager.test.ts |
Tests probe outcomes. |
src/config-mapper.ts |
Maps file configuration. |
src/config-file.ts |
Defines file configuration. |
src/config-file-mapping.test.ts |
Tests configuration mapping. |
src/commands/validators/infrastructure-validator.ts |
Restricts the option to sbx. |
src/commands/validators/config-assembly-flags.test.ts |
Tests runtime validation. |
src/commands/build-config.ts |
Builds the runtime option. |
src/cli-options.ts |
Adds the CLI flag. |
src/awf-config-schema.json |
Updates the runtime schema. |
docs/usage.md |
Documents CLI usage. |
docs/sbx-integration.md |
Documents the orchestration contract. |
docs/awf-config.schema.json |
Updates the canonical schema. |
docs/awf-config-spec.md |
Documents config mapping. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| `curl --fail --insecure --silent --show-error --connect-timeout 5 --max-time 10 ` + | ||
| `--output /dev/null "https://${domain}/"; then ` + |
|
@copilot address review feedback |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
Coverage comparison generated by |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
✅ Build Test Suite completed successfully!
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤
|
|
❌ Contribution Check failed. Please review the logs for details.
|
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓
|
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓
|
|
🚀 Security Guard has started processing this pull request |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS — network isolation egress enforcement working as expected. cc @lpcox Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot Engine — @lpcox
Overall: PASS
|
Smoke Test: Copilot BYOK (Direct) ModeStatus: ✅ PASS
All tests passed. Agent using COPILOT_PROVIDER_API_KEY for direct BYOK mode.
|
|
Docker Sbx Smoke Test — @lpcox
Overall: PASS
|
Smoke Test: Services Connectivity
Overall: FAIL —
|
|
Smoke test (BYOK AOAI api-key) results:
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: FAIL
|
|
Fix Playwright smoke tests across sandbox runtimes
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment.
|
|
PR titles: unavailable ( Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Notes:
|
Smoke Test: API Proxy OTEL Tracing — Results
Overall: all 5 scenarios pass. No unexpected failures detected.
|


Summary
--verify-sbx-egressandnetwork.verifySbxEgressDOCKER_SANDBOXES_PROXYMotivation
The Playwright smoke work in #7938 proved that cooperative Chromium traffic can use Squid, but client proxy configuration is not an enforceable Docker sbx boundary. This change gives the
gh-awcompiler a fail-closed AWF contract: after starting the sbx daemon withDOCKER_SANDBOXES_PROXYchained to AWF Squid, it can enable this verification and prevent the agent from starting if direct traffic bypasses that chain.This is the AWF portion of github/gh-aw#57581. The option remains opt-in until the compiler owns the corresponding daemon startup sequence.