Repository navigation
Enable Codex shell tools inside hardened Docker enclaves - #11190
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Critical disclosure paths allow shell workloads to expose private seed data through exported audit transcripts and unrestricted hosted-web proxy requests, bypassing result-validation and disclosure-budget safeguards.
4 open issues
What changed in this PR
This PR addresses #11185 by letting Codex rely on AWF’s outer enclave sandbox instead of starting nested bubblewrap, enabling shell diagnostics without changing container confinement settings.
Changes:
- Selects Codex’s externally sandboxed execution mode.
- Adds pinned-CLI shell integration coverage and checks that empty output remains a failure despite CLI exit zero.
- Documents the outer-sandbox contract and required
/awf/outresult channel.
| File | Description |
|---|---|
tests/integration/enclave-codex-shell.test.ts |
Adds real Codex shell tests with synthetic inference, confinement checks, and failure scenarios. |
src/enclave/agent-entrypoint-diagnostics.test.ts |
Checks sandbox flags and rejects shell-launch failures despite CLI exit zero. |
docs/enclaves-architecture.md |
Explains external sandboxing and the required result file. |
containers/enclave/agent-entrypoint.py |
Enables Codex’s approval and nested-sandbox bypass flag. |
Review effort: Max (auto)
| # AWF supplies the outer sandbox; nested bubblewrap cannot run with zero capabilities. | ||
| return [ | ||
| CODEX_BIN, "exec", "--skip-git-repo-check", | ||
| "--dangerously-bypass-approvals-and-sandbox", |
| # AWF supplies the outer sandbox; nested bubblewrap cannot run with zero capabilities. | ||
| return [ | ||
| CODEX_BIN, "exec", "--skip-git-repo-check", | ||
| "--dangerously-bypass-approvals-and-sandbox", |
| args[args.indexOf('--entrypoint') + 1] = '/usr/bin/python3'; | ||
| args.push('/usr/local/bin/run-enclave-agent'); | ||
| args.splice(1, 0, '-d', | ||
| '-v', `${path.join(root, 'containers/enclave/agent-entrypoint.py')}:/usr/local/bin/run-enclave-agent:ro`, | ||
| '-v', `${path.join(root, 'containers/enclave/public_debug_capture.py')}:/usr/local/bin/public_debug_capture.py:ro`); | ||
| docker(args); | ||
| containers.push(containerName); | ||
| const members = Object.values(JSON.parse(docker(['network', 'inspect', network]))[0].Containers) | ||
| .map((member: unknown) => (member as { Name: string }).Name).sort(); | ||
| expect(members).toEqual([proxyName, containerName].sort()); |
|
@copilot merge main, resolve conflicts, and address all review feedback |
Merged main without conflicts in db3263f and addressed all four findings in 6228b13: workload-written transcripts remain private, dedicated hosted-web tools are disabled independently of primary policy, topology inspection uses a readiness/release handshake, and transcript assertions check escaped commands plus the proof marker. All 373 targeted tests passed, including real Codex 0.159.3 Docker scenarios; build/type-check, lint and secret scanning passed. CodeQL analysis was skipped because its database exceeded the size limit. |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 34a0287 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Smoke CodexOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Build Test Suite completed successfully!
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🔌 Smoke Services is testing service connectivity for this pull request... |
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
Security Guard: one item for reviewer attention
This is a deliberate trade-off, since the added comment says nested bubblewrap cannot run with zero capabilities. It is only safe if the enclave keeps all of the following:
Suggested action: confirm that
No firewall, Squid, iptables, capability, or seccomp weakening was found.
|
✅ Smoke Test: Copilot BYOK (Direct) ModeTest Results:
Status: PASS — Direct BYOK mode (COPILOT_PROVIDER_API_KEY) operational
|
|
chore: refresh canonical model sources
|
🏗️ Build Test Suite Results
Overall: 7/8 ecosystems passed — FAIL Java failure details: Note: .NET initially crashed on a missing
|
Chroot Version Comparison
Result: Not all tests passed (Node.js mismatch), so the
|
|
@copilot merge main and resolve the conflicts |
Co-authored-by: lpcox <[email protected]>
Head branch was pushed to by a user without write access
Merged main and resolved all three conflicts in 803b6ef, preserving the review safeguards and main’s closed-metadata audit projection. Build, type-check, lint, secret scanning, and 713 targeted tests passed. Six environment-gated tests were skipped, including the four Docker Codex scenarios. CodeQL found no Python alerts; JavaScript analysis exceeded its database size limit. |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot fix this failing ci check. make sure that 'npm test' runs without any failures https://github.com/github/gh-aw-firewall/actions/runs/42279934127/job/128105976734?pr=11190 |
Updated the Codex regression tests to require the bypass flag only with explicit opt-in. The targeted suite passed (102 tests), and full |


Codex 0.159.3’s default nested sandbox fails with
bwrap: Failed to make / slave: Operation not permitted, preventing the diagnostic from running despite CLI exit 0.codex exec --dangerously-bypass-approvals-and-sandbox --ephemeral/awf/outresult channel.