Skip to content

feat(codex-runner): gVisor variant of the image (option B of #2921) - #2924

Draft
chronoai-kaihuei wants to merge 1 commit into
devfrom
feat/codex-runner-gvisor-variant
Draft

feat(codex-runner): gVisor variant of the image (option B of #2921)#2924
chronoai-kaihuei wants to merge 1 commit into
devfrom
feat/codex-runner-gvisor-variant

Conversation

@chronoai-kaihuei

Copy link
Copy Markdown
Collaborator

What

Implements #2922 — the containers/codex-runner image + contract for the gVisor model (option B of #2921). Scoped to containers/codex-runner only.

Why draft

Gated on the #2921 A/B decision. Options A (runc + Landlock + Credential Vault) and B (gVisor + direct short-lived token) are mutually exclusive. This PR is the concrete "if B" change, opened as a draft to make the diff reviewable alongside the proposal. Do not merge while option A is the chosen design — the current image is already correct for runc.

Changes

  • Dockerfile — remove bubblewrap (Codex runs no inner sandbox; gVisor is the boundary); remove SSL_CERT_FILE (no Credential-Proxy MITM under gVisor); remove /opt/aevatar-sandbox-probe (Landlock-preflight only).
  • smoke.sh — assert SSL_CERT_FILE unset and bwrap absent; replace the legacy-Landlock write/deny probe with a check that Codex starts with the inner sandbox disabled (danger-full-access) and does not fall back to a runc-only backend.
  • README — swap the runc + Landlock + Credential-Vault runtime contract for the gVisor contract (gvisor RuntimeClass, direct token injection, egress scoped by platform NetworkPolicy).
  • version.envRUNNER_VERSION0.144.5-gvisor.

Demonstrated feasible

Built from this branch and run on a live gVisor node (kernel 4.4.0 Sentry):

  • Codex starts as sandbox: danger-full-accessno LandlockRestrict, no bwrap error (both inner-sandbox backends are unavailable under gVisor, as expected).
  • Reaches the NyxID gateway with the plain system CA bundle (no MITM) — HTTP 401 on a dummy token, i.e. connection + TLS succeed and only a real token is missing.

So codex_exec runs under gVisor with the inner sandbox disabled and a directly-injected token, with no Credential Vault and no egress sidecar.

Out of scope

  • The credential-model change in the Aevatar application + the chrono-sandbox endpoint (separate work; the runner image alone does not complete option B).
  • Operations runtime/tenant wiring.

Related: #2921, #2922.

Implements #2922. If managed codex_exec moves to the gVisor + direct
short-lived token model, the runner image and its contract change:

- Dockerfile: drop bubblewrap (Codex runs no inner sandbox — gVisor is the
  boundary); drop SSL_CERT_FILE (no Credential-Proxy MITM under gVisor, the
  runner reaches the gateway directly with the system CA bundle); drop
  /opt/aevatar-sandbox-probe (only used by the Landlock preflight)
- smoke.sh: assert SSL_CERT_FILE is unset and bwrap absent; replace the
  legacy-Landlock write/deny probe with a check that Codex starts with the
  inner sandbox disabled (danger-full-access) and does not fall back to a
  runc-only backend
- README: replace the runc + Landlock + Credential-Vault runtime contract
  with the gVisor contract (gvisor RuntimeClass, direct token injection,
  egress scoped by platform NetworkPolicy)
- version.env: RUNNER_VERSION -> 0.144.5-gvisor

Under gVisor neither Codex inner-sandbox backend is available (Landlock ->
ENOSYS in the Sentry, Bubblewrap cannot initialize), so Codex relies on the
gVisor boundary. Demonstrated on a live gVisor node: Codex starts as
danger-full-access with no LandlockRestrict/bwrap error and reaches the NyxID
gateway with the system CA bundle.

Gated on the #2921 A/B decision — do not merge while option A (runc + Landlock)
is the chosen design.
eanz17 pushed a commit that referenced this pull request Jul 22, 2026
Record the #2921 option-B decision as ADR-0044 and align the canonical
contract with the cherry-picked gVisor runner image (#2924):

- canon: gVisor tenant, inner Codex sandbox disabled, direct request-local
  NYXID_LLM_TOKEN injection as the decided credential model; sandbox-side
  Credential Vault rejected, not deferred; egress is IP-level NetworkPolicy
  owned by operations
- runbook: gvisor RuntimeClass prerequisite replaces the kernel/Landlock and
  egress-sidecar requirements
- workflow-primitives: drop the Landlock ownership mention
- narrow #2899 to caller-capability and non-forwarding immutability

Verification: bash tools/docs/lint.sh (79 files, 0 errors),
bash tools/ci/architecture_guards.sh (passed), bash -n smoke.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.45%. Comparing base (733a93c) to head (9a3e0ac).
⚠️ Report is 8 commits behind head on dev.

@@           Coverage Diff           @@
##              dev    #2924   +/-   ##
=======================================
  Coverage   83.45%   83.45%           
=======================================
  Files        1376     1376           
  Lines      112732   112732           
  Branches    14366    14366           
=======================================
+ Hits        94083    94084    +1     
  Misses      12096    12096           
+ Partials     6553     6552    -1     
Flag Coverage Δ
ci 83.45% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants