Skip to content

feat(isolation): implement the RFC 0012 sandbox architecture - #2942

Open
drew wants to merge 52 commits into
mainfrom
codex/1737-rfc12-supervisor-primitives
Open

feat(isolation): implement the RFC 0012 sandbox architecture#2942
drew wants to merge 52 commits into
mainfrom
codex/1737-rfc12-supervisor-primitives

Conversation

@drew

@drew drew commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implement RFC 0012 as one self-contained core change. This PR defines the isolation interface and adds the OpenShell implementation: the Sandbox Protocol, OpenShellRuntimeBackend, and separate openshell-supervisor and openshell-sandbox binaries.

The compute-driver integrations remain in their own stacked PRs so each runtime can demonstrate the same interface without adding driver-specific behavior to the core implementation.

Related Issue

Part of #1737. Implements the architecture accepted in #2048.

Changes

  • Add the openshell-isolation-interface crate and backend conformance tests.
  • Add the authenticated, transport-neutral OpenShell Sandbox Protocol.
  • Add OpenShellRuntimeBackend, the supervisor-side implementation of the isolation interface.
  • Add the openshell-supervisor policy and access process.
  • Add the openshell-sandbox workload runtime with process ownership, binary identity, TCP and DNS mediation, and fail-closed enforcement.
  • Publish separate glibc supervisor and static musl sandbox images.
  • Add the shared Linux, authentication, and packaging primitives required by the runtimes.

Testing

  • Remote CI is the source of truth for the consolidated branch.
  • Driver-specific E2E coverage remains in the following stacked PRs.

Checklist

  • Follows Conventional Commits
  • Authored commits are signed off (DCO)

Stack

  1. feat(isolation): implement the RFC 0012 sandbox architecture #2942 — RFC 0012 core architecture (this PR)
  2. feat(vm): run the supervisor outside the guest workload #2945 — VM driver
  3. feat(docker): isolate workloads behind a companion supervisor #2965 — Docker driver
  4. feat(kubernetes): isolate workloads behind a dedicated supervisor #3144 — Kubernetes driver
  5. feat(podman): isolate workloads behind a separate supervisor #3230 — Podman driver
  6. perf(isolation): add TCP and DNS benchmark harnesses #3229 — performance harnesses

#2941 is superseded by the canonical RFC merged in #2048. #3151 was folded into this PR.

@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@copy-pr-bot

copy-pr-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@drew
drew force-pushed the codex/1737-rfc12-supervisor-primitives branch 2 times, most recently from fbcc382 to efba1d8 Compare September 1, 2026 08:06
@drew
drew marked this pull request as ready for review September 3, 2026 01:46
@drew
drew requested review from a team, derekwaynecarr, mrunalp and sjenning as code owners September 3, 2026 01:46
@drew
drew force-pushed the codex/1737-rfc12-supervisor-primitives branch from 00b12d3 to b06e0b1 Compare September 3, 2026 14:34
@drew drew added the test:e2e Requires end-to-end coverage label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Label test:e2e applied for b06e0b1. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@drew
drew force-pushed the codex/1737-rfc12-supervisor-primitives branch from b06e0b1 to 8e95cd7 Compare September 5, 2026 16:08
@drew

drew commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test

3 similar comments
@drew

drew commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test

@drew

drew commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test

@drew

drew commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test

@drew
drew force-pushed the codex/1737-rfc12-supervisor-primitives branch from e4cc065 to 62a943a Compare September 8, 2026 22:32
drew added 16 commits September 11, 2026 15:12
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew
drew force-pushed the codex/1737-rfc12-supervisor-primitives branch from 57e7b2d to 9b00cb6 Compare September 11, 2026 22:13
Comment thread .github/workflows/build-sandbox-binaries.yml Fixed
Comment thread .github/workflows/build-sandbox-binaries.yml Fixed
Signed-off-by: Drew Newberry <anewberry@nvidia.com>

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

The RFC 0012 core is project-valid and its stacked interface is coherent across the VM, Docker, Kubernetes, Podman, and performance layers, but four concrete obligations remain in the core patch: authentication continuity across gateway replacement, lifecycle rollback preserving active authentication, PID 1 orphan reaping, and synchronization of the shipped runtime split with repository/operator guidance.

Action required: @drew, please address the four blocking findings and push an updated head for a focused follow-up review.

Blocking findings:

  • GATOR-07441545-01: preserve refreshable launch authentication across a gateway restart or supported replica routing.
  • GATOR-07441545-02: do not revoke an active launch when stop/delete rolls back to Ready.
  • GATOR-07441545-03: restore managed-child-aware orphan reaping when openshell-sandbox is PID 1.
  • GATOR-07441545-04: synchronize the new crates and split runtime artifacts with agent/operator workflows.

Carried findings:

  • None

Non-blocking suggestions:

  • None
Gator metadata
  • Validation: Maintainer-authored implementation of accepted RFC 0012 (#2048) for issue #1737; this review is limited to PR #2942 while checking compatibility with its five downstream stack layers.
  • Docs: Architecture documents are updated; driver-specific Fern UX documentation remains owned by the downstream integration layers, while the core runtime split still needs the workflow/skill synchronization in GATOR-07441545-04.
  • Checks: Current-head Branch Checks and Trivy Changes are failing; Helm Lint and DCO pass. Pipeline handoff is not active while review findings remain.
  • E2E: test:e2e is present and the current-head OpenShell / E2E gate is green; no label, /ok to test, or rerun action is needed this cycle.
  • Head SHA: 07441545bab1241ba359eda5154236fbf775adfb
  • Base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Merge base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Patch ID: 7e44fa1b2153c53661068195adc76311e8448d3c
  • Gator payload: 8
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

Comment thread crates/openshell-server/src/lib.rs
@@ -1374,6 +1400,8 @@ async fn handle_stop_sandbox_inner(
let workspace = super::workspace::resolve_workspace(state.store.as_ref(), &authz.workspace)
.await?
.name;
let current = sandbox_by_name(state, &workspace, &req.name).await?;
state.sandbox_auth_sessions.deactivate(current.object_id());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Warning — GATOR-07441545-02 · Failed lifecycle calls revoke a still-running sandbox

Summary: If an operator stops or deletes a sandbox and the driver returns an ambiguous/transient error, compute recovery can restore the sandbox to Ready. This line has already deactivated its authentication, however, so the surviving supervisor’s next refresh fails; expiry then disconnects and terminates a workload the API says remains ready. Delete has the same ordering defect.

Fix: Couple deactivation to the durable lifecycle outcome. Preserve or restore the exact prior active session when recovery returns to Ready, and revoke it only after stop, deletion, or an unresolved terminal transition is committed. Cover stop and delete rollback paths.

Verify: Make a fake driver fail stop/delete while its later snapshot remains running. After phase recovery returns Ready, refreshing with the current token must still succeed.

Agent context
  • Sibling site: crates/openshell-server/src/grpc/sandbox.rs:1354
  • Location: crates/openshell-server/src/grpc/sandbox.rs:1404

let bytes = std::fs::read(config_path)
.map_err(|error| format!("read boundary config {}: {error}", config_path.display()))?;
let config: BoundaryConfig = serde_json::from_slice(&bytes).map_err(|error| {
format!("decode boundary config {}: {error}", config_path.display())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Warning — GATOR-07441545-03 · The replacement PID 1 runtime does not reap orphans

Summary: Ordinary sandboxed code can double-fork background children. When openshell-sandbox is PID 1, exited descendants are adopted by it, but this replacement startup has no SIGCHLD orphan-reaping loop. Zombies can accumulate to the namespace/cgroup PID limit and prevent later fork or exec operations.

Fix: Move the prior managed-child-aware SIGCHLD reaper into boundary startup. Coordinate it with the existing managed-child registry so it reaps only orphan descendants and cannot steal statuses from explicit process waiters. Add a PID-namespace regression test.

Verify: Run the boundary as PID 1, repeatedly double-fork short-lived children, and confirm no adopted zombies remain; simultaneously retain a managed direct child and confirm its explicit waiter receives the correct status.

Agent context
  • Ownership: This PR removes the prior runtime containing the reaper and adds this replacement boundary startup without moving that responsibility.
  • Location: crates/openshell-sandbox/src/boundary_server.rs:119

# SPDX-License-Identifier: Apache-2.0

[package]
name = "openshell-supervisor"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Warning — GATOR-07441545-04 · Runtime split leaves operational guidance materially stale

Summary: Contributors and operators following repository guidance do not see four new security-sensitive crates, while troubleshooting and release skills still describe the old combined supervisor image—for example, expecting /openshell-sandbox inside it—and omit the separately shipped sandbox artifact. That makes the published operational workflow false for this PR’s topology.

Fix: Add openshell-binary-identity, openshell-isolation-interface, openshell-sandbox-backend, and openshell-supervisor to the architecture inventory. Update debug-openshell-cluster, helm-dev-environment, test-release-canary, and sbom to distinguish and inventory the sandbox and supervisor artifacts, then run the sync-agent-infra checklist.

Verify: Compare crates/* with the architecture table and search the mapped skills for image inventories and /openshell-sandbox; every new crate and separately published image must be represented without the obsolete combined-image diagnostic.

Agent context
  • Location: crates/openshell-supervisor/Cargo.toml:5
  • Sibling sites: skills/debug-openshell-cluster/SKILL.md:216, .agents/skills/helm-dev-environment/SKILL.md:82, .agents/skills/test-release-canary/SKILL.md:95, .agents/skills/sbom/SKILL.md:18

@johntmyers johntmyers added the gator:in-review Gator is reviewing or awaiting PR review feedback label Sep 11, 2026
Signed-off-by: Drew Newberry <anewberry@nvidia.com>

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

Re-check After Author Update

Thanks @drew. I reviewed the terminology and guidance update at d3d92a7c against the four durable obligations and the five downstream RFC 0012 layers. The naming changes remain coherent across the stack, but the three functional findings are untouched and the guidance finding is only partially addressed: the root layer now documents downstream-only sandbox_runtime_image and three-image Helm behavior while its own Helm workflow still has the two-image topology.

Action required: @drew, please address the three functional obligations and make the root-layer operational guidance truthful for behavior present in #2942, then push an updated head for another focused follow-up review.

Blocking findings:

  • No new findings.

Carried findings:

  • GATOR-07441545-01: gateway replacement or replica routing still loses the process-local active authentication session, so a surviving supervisor cannot refresh.
  • GATOR-07441545-02: stop and delete still revoke authentication before the compute result, leaving recovery-to-Ready unable to refresh.
  • GATOR-07441545-03: the replacement PID 1 boundary still lacks managed-child-aware orphan reaping.
  • GATOR-07441545-04: the crate inventory is updated, but root-layer debugging and release guidance now claims driver/Helm behavior supplied only by downstream PRs and retains stale extracted-binary terminology.
Gator metadata
  • Validation: Maintainer-authored implementation of accepted RFC 0012 (#2048) for issue #1737; this review remains limited to PR #2942 while checking compatibility with its five downstream stack layers.
  • Docs: Architecture inventory and terminology improved; operational skill guidance remains inconsistent with the incremental root layer under GATOR-07441545-04.
  • Checks: Current-head Branch Checks and E2E are pending, Trivy Changes is failing, and Helm Lint and DCO pass; pipeline handoff is not active while review findings remain.
  • E2E: test:e2e is present and the current-head E2E workflow is running; no label, /ok to test, or rerun action is needed this cycle.
  • Head SHA: d3d92a7ccc70cebbd7f4e1148fb1cdbd5f7f705a
  • Base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Merge base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Patch ID: 573196b2025255ea2a11b81f7e65556c898b54f3
  • Gator payload: 8
  • Review mode: follow_up
  • Previous reviewed SHA: 07441545bab1241ba359eda5154236fbf775adfb
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

Maintainer Convergence Decision

The third finding-bearing review round is complete at the current head. The new scratch-image and CI-policy commits do not resolve the three functional obligations, and the scratch artifact makes the existing operational-guidance obligation more specific. A maintainer decision is now required before another autonomous Warning-bearing review.

Root-cause findings:

  • GATOR-07441545-01: gateway replacement or supported replica routing still loses the process-local active authentication session needed by a surviving supervisor.
  • GATOR-07441545-02: stop and delete still revoke authentication before the compute outcome, so recovery to Ready cannot preserve refresh.
  • GATOR-07441545-03: the replacement boundary still lacks managed-child-aware orphan reaping when openshell-sandbox is PID 1.
  • GATOR-07441545-04: root-layer operational guidance still describes obsolete or downstream-only artifact behavior; the portable sandbox is now a scratch image containing only /openshell-sandbox, while the current root Helm layer still has a two-image topology.

Scope growth:

  • The latest delta narrows the portable sandbox artifact to a static binary in a scratch image. Driver-owned bootstrap tooling remains appropriately downstream, but root-layer architecture and operational guidance must reflect that boundary.

Reviewer-quality signals:

  • No new finding IDs, waived re-raises, unchanged-code proposals, or evidence downgrades. All four entries are carried obligations first seen at 07441545.

Maintainer action: @NVIDIA/openshell-maintainers, confirm that these four obligations must be completed in #2942 and direct @drew to implement them, or explicitly waive/re-scope the specific finding IDs that should not gate this independently mergeable root layer.

Gator metadata
  • Head SHA: 48f108374cc8d5f67417f0a66598a66a8f74e784
  • Base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Merge base SHA: 5b57f0d1549677c7547862d26ff9491285ea0fbc
  • Patch ID: c60d3ba39c57bcbcb96d1b8f1726f8c205484e81
  • Gator payload: 8
  • Review mode: follow_up
  • Previous reviewed SHA: d3d92a7ccc70cebbd7f4e1148fb1cdbd5f7f705a
  • Review budget exhausted: yes
  • Maintainer decision required: yes — four concrete carried obligations remain unresolved after three finding-bearing rounds.
  • Checks: current-head Branch Checks and E2E are running; Helm Lint and Trivy Changes pass.
  • E2E: test:e2e is present and the current PR-head E2E workflow is active; no label, /ok to test, or rerun action is needed this cycle.
  • Next state: gator:blocked
  • Blocked reason: review_convergence_decision_required

@johntmyers johntmyers added gator:blocked Gator is blocked by process or repository gates and removed gator:in-review Gator is reviewing or awaiting PR review feedback labels Sep 13, 2026
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

Re-check After Maintainer-Author Update

Thanks @drew. I reviewed de2b42c6 and your September 13 reply about making runtime credentials generation-scoped and limiting reconnect recovery to the same supervisor process. The new SupervisorInstanceId binding, protocol tests, RFC text, and all five downstream RFC 0012 layers consistently enforce that contract. Because you are a verified maintainer and explicitly chose the fail-closed replacement boundary, GATOR-07441545-01 is waived/resolved and its Gator thread is now closed.

The focused follow-up found no new blockers. Three durable obligations remain unchanged or became more concrete in this delta.

Action required: @drew or another OpenShell maintainer, please implement GATOR-07441545-02 through -04, or explicitly waive/re-scope the specific IDs that should not gate this independently mergeable root layer.

Blocking findings:

  • No new findings.

Carried findings:

  • GATOR-07441545-02: stop and delete still deactivate authentication before the compute outcome, so a failed lifecycle call that recovers the same running generation to Ready leaves its supervisor unable to refresh.
  • GATOR-07441545-03: openshell-sandbox still becomes PID 1 without the prior managed-child-aware orphan reaper, allowing ordinary double-forked descendants to accumulate as zombies.
  • GATOR-07441545-04: the new scratch-only sandbox artifact makes root-layer build and operational guidance materially inconsistent; architecture/build.md still describes an Alpine helper runtime, and mapped Helm, canary, SBOM, and debugging guidance remains out of sync with this layer.
Gator metadata

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

Labels

gator:blocked Gator is blocked by process or repository gates test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants