Skip to content

fix: wire trusted Codex sandbox policy into enclave launches - #11224

Merged
lpcox merged 3 commits into
mainfrom
copilot/wire-codex-sandbox-integration
Nov 7, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/wire-codex-sandbox-integration

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Production enclave launches omitted Codex’s external-sandbox opt-in, so shell execution failed in nested bubblewrap despite successful inference and CLI exit 0.

  • Trusted policy: Set AWF_ENCLAVE_AGENT_CODEX_BYPASS_APPROVALS=true in the shared provider environment for Docker, gVisor, and Cloud Hypervisor. Task text, request fields, and ambient environment cannot override it.
  • Launch-path coverage: Verify final environment and native argv together. Exercise pinned Codex 0.159.3 shell execution through the production Docker specification, including schema-valid /awf/out and canonical result-empty failures.
  • Isolation: Preserve non-root identity, zero capabilities, no-new-privileges, read-only root/seed, bounded storage, and proxy-only networking. Document the shared trusted handoff.

Copilot AI changed the title [WIP] Wire Codex externally sandboxed execution mode into enclave path fix: wire trusted Codex sandbox policy into enclave launches Nov 6, 2026
Copilot AI requested a review from lpcox November 6, 2026 23:09
@lpcox
lpcox marked this pull request as ready for review November 6, 2026 23:24
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 23:24

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.

🟡 Changes recommended

Codex shell execution permits overwriting session logs with guest-controlled metrics that are exported unchanged, allowing private seed data to bypass result-schema and disclosure-budget controls.

1 open issue
What changed in this PR

Wires Codex’s external-sandbox opt-in into AWF’s shared enclave launch environment, addressing the production policy handoff gap in #11219 without changing the outer isolation controls.

Changes:

  • Enables the AWF-owned Codex policy across Docker, gVisor, and Cloud Hypervisor.
  • Extends coverage for final environment and native arguments, including pinned Codex shell execution through the production Docker specification.
  • Documents the trusted policy handoff and preserved isolation guarantees.
File Description
tests/​integration/​enclave-codex-shell.test.ts Checks the running Codex process’s policy environment and sandbox arguments.
src/​enclave/​agent-provider-environment.test.ts Verifies cross-backend policy propagation and resistance to ambient or request overrides.
docs/​enclaves-architecture.md Documents policy ownership across supported backends.
containers/​enclave/​agent-executor/​agent-provider-environment.js Adds the trusted Codex external-sandbox opt-in.

Review effort: Max (auto)

case 'codex':
return {
// AWF owns the outer sandbox; never derive native execution policy from a task.
AWF_ENCLAVE_AGENT_CODEX_BYPASS_APPROVALS: 'true',
@lpcox

lpcox commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback and make sure that 'npm test' runs without any failures

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11224 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 431e3a5

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback and make sure that 'npm test' runs without any failures

Removed guest-controlled attempt and runtimeMs from both enclave session projections and added regression tests at the retained-session and export boundaries. Full npm test passes (12,290 passed, 73 skipped). Commit: 8ebf2e8.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.74% 93.75% 📈 +0.01%
Statements 92.27% 92.29% 📈 +0.02%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.55% 86.55% ➡️ +0.00%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/resolved-config-artifact.ts 52.7% → 51.6% (-1.04%) 48.5% → 47.5% (-1.02%)
src/cloud-hypervisor/manager.ts 89.8% → 89.6% (-0.18%) 88.6% → 88.3% (-0.25%)
src/cloud-hypervisor/artifact-trust.ts 100.0% → 100.0% (+0.00%) 98.9% → 98.9% (-0.01%)
src/commands/main-action.ts 91.7% → 92.0% (+0.25%) 91.4% → 91.7% (+0.24%)
src/nvx/one-shot-process.ts 81.5% → 84.0% (+2.47%) 74.7% → 76.8% (+2.11%)
✨ New Files (1 files)
  • src/sudo-identity.ts: 100.0% lines

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

@lpcox
lpcox enabled auto-merge (squash) November 7, 2026 00:25
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #11224

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Security Guard completed successfully!

Security Guard

Outcome: reported_no_action

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.

Generated from Security Guard · sonnet55 · ~12 AIC · ⊞ 8.2K · ◷

Generated by Security Guard for #11224

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #11224

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

💎 Smoke Gemini is crystallizing results on this pull request...

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot BYOK AOAI (api-key) is testing Azure OpenAI BYOK (api-key) mode on this pull request...

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services is testing service connectivity for this pull request...

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PR "feat: add daily regression failure triage workflow"

  • GitHub MCP ✅
  • GitHub.com connectivity ✅
  • File write/read ✅

Overall: PASS — @Copilot @lpcox

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

@github-actions

github-actions Bot commented Nov 7, 2026

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 ✅ all passed ✅ PASS
Go env ✅ all passed ✅ PASS
Go uuid ✅ all passed ✅ PASS
Java gson ❌ 0/0 ❌ FAIL
Java caffeine ❌ 0/0 ❌ FAIL
Node.js clsx ✅ passed ✅ PASS
Node.js execa ✅ passed ✅ PASS
Node.js p-limit ✅ passed ✅ PASS
Rust fd ✅ 0/0 (no tests defined) ✅ PASS
Rust zoxide ✅ 0/0 (no tests defined) ✅ PASS

Overall: 7/8 ecosystems passed — FAIL

Java failure details: with the required ~/.m2/settings.xml (proxy squid-proxy:3128), Maven failed to create the default local repo (/home/runner/.m2/repository, LocalRepositoryNotAccessibleException). The retry with -Dmaven.repo.local=/tmp/m2 then failed with PluginResolutionException. Plugin resolution through the configured proxy did not work in this environment.

.NET note: the first run failed with a NuGet-Migrations error (/run/user/1001 missing). It passed after setting XDG_RUNTIME_DIR and DOTNET_CLI_HOME.

The build-test label was not added because of the Java failures.

Generated by Build Test Suite for #11224 · copilot · auto · ~23 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): 200
  • ✅ Blocked domain (example.com): blocked

Overall: PASS (PR author: @lpcox)

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

11216: fix: handle Copilot zero-batch tariffs without masking model policy
11214: Centralize sudo operator identity parsing
GitHub MCP: ✅
PR details: ✅
Playwright title: ❌
File write/read: ✅
Discussion lookup/comment: ❌
Build: ✅
Overall: FAIL

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@Copilot @lpcox
fix: handle Copilot zero-batch tariffs without masking model policy: ✅
Centralize sudo operator identity parsing: ✅
GitHub MCP connectivity: ✅
GitHub.com connectivity: ✅
File write/read test: ✅
BYOK inference path: ✅
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 status: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

  • ✅ MCP connectivity verified (2 recent merged PRs fetched)
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test passed
  • ✅ Direct BYOK inference working (agent → api-proxy → api.githubcopilot.com)

Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY with api-proxy sidecar.

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1 Module loading: otel.js loads and exports its functions
  • ✅ S2 Tests: 75 passed, 0 failed (3 suites)
  • ✅ S3 Env forwarding: trace context in env-passthrough.ts, OTEL vars in api-proxy-env-config.ts
  • ✅ S4 Token tracker: onUsage hook present in token-tracker-http.js
  • ⚪ S5 Diagnostics: no post-step diagnostics collected here; not checked (no export verified)

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.16 Python 3.12.16 ✅ YES
Node.js v24.22.2 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: Not all tests passed (Node.js version mismatch), so the smoke-chroot label was not added.

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #11224 · claude · haiku45 · ~35 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@lpcox
lpcox merged commit e593eb2 into main Nov 7, 2026
157 of 163 checks passed
@lpcox
lpcox deleted the copilot/wire-codex-sandbox-integration branch November 7, 2026 01:00

This branch was previously deployed

1 inactive deployment
aoai-model — 8ebf2e89 Deployed Nov 7, 2026 by lpcox via conclusion #2280
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.

Wire Codex externally sandboxed execution mode into the real enclave launch path

3 participants