Skip to content

feat: add NVX Phase 3a confinement foundations - #8785

Merged
lpcox merged 4 commits into
mainfrom
nvx-phase-3-opt-in-backend
Sep 20, 2026
Merged

lpcox merged 4 commits into
mainfrom
nvx-phase-3-opt-in-backend

Conversation

@lpcox

@lpcox lpcox commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • define an exact AWF-attested NVX artifact manifest binding the AWF release to pinned NVX/OpenVMM revisions, artifact roles, filenames, architecture, and SHA-256 digests
  • add fail-closed host preflight and private immutable artifact snapshots, verifying the attestation and artifact digests from the snapshot to avoid source-path races
  • add a shell-free network namespace, Bubblewrap filesystem jail, and setpriv launch command plus live OpenVMM process/thread, namespace, capability, seccomp, and cgroup verification
  • add a strict durable cleanup ownership-record schema that binds cleanup stages to process, filesystem, namespace, account, cgroup, and device ACL identities
  • document the Phase 3a boundary and keep NVX absent from the runtime registry and CLI

Scope

This is the bounded Phase 3a foundation only. It does not make nvx selectable. Phase 3b must implement and live-test dedicated account lifecycle, serialized ACL-only device grants, cgroup application, host network policy, cleanup execution/stale recovery, and one-shot adapter integration on a GitHub-hosted x86_64 KVM runner.

Managed/reusable NVX sessions remain explicitly out of scope.

Validation

  • npm run type-check
  • npm run build
  • npm run lint -- --quiet
  • npx markdownlint-cli2 docs/nvx-security-design.md
  • npm test -- --runInBand src/nvx/artifact-manifest.test.ts src/nvx/confinement.test.ts src/nvx/cleanup-record.test.ts src/nvx/preflight.test.ts (27 tests)

The full suite passes 6,029 tests on macOS but has four existing Phase 2 NVX failures because those tests require Linux /proc and descriptor traversal support. CI's Linux environment is the authoritative full-suite validation.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 6b7bb21d-a74b-4061-b1d0-ae2a18df7a8c
Copilot AI balanced review requested due to automatic review settings September 19, 2026 22:00
@github-actions

github-actions Bot commented Sep 19, 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-8785 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit e0d7799

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.74% 93.28% 📉 -0.46%
Statements 92.42% 91.95% 📉 -0.47%
Functions 92.99% 92.15% 📉 -0.84%
Branches 86.21% 85.74% 📉 -0.47%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (4 files)
  • src/nvx/artifact-manifest.ts: 86.0% lines
  • src/nvx/cleanup-record.ts: 81.5% lines
  • src/nvx/confinement.ts: 87.8% lines
  • src/nvx/preflight.ts: 56.2% lines

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

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.

Copilot review overview

🟡 Changes recommended

Snapshot permissions currently prevent launch, while trusted-tool and cleanup path validation leave security boundaries insufficiently enforced.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 High severity · 1 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Adds Phase 3a foundations for an attested and host-confined NVX backend while keeping it unavailable from runtime selection.

Changes:

  • Adds artifact attestation, snapshotting, and preflight validation.
  • Adds constrained launch construction and live confinement verification.
  • Defines durable cleanup records with supporting tests and documentation.
File Description
src/​nvx/​preflight.ts Implements host and artifact preflight.
src/​nvx/​preflight.test.ts Tests preflight failure paths.
src/​nvx/​index.ts Exports Phase 3a APIs.
src/​nvx/​confinement.ts Builds and verifies confinement.
src/​nvx/​confinement.test.ts Tests launch and verification behavior.
src/​nvx/​cleanup-record.ts Defines cleanup ownership records.
src/​nvx/​cleanup-record.test.ts Tests cleanup-record validation.
src/​nvx/​artifact-manifest.ts Defines the attested artifact manifest.
src/​nvx/​artifact-manifest.test.ts Tests manifest validation.
docs/​nvx-security-design.md Documents the Phase 3a boundary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/nvx/cleanup-record.ts Outdated
Comment on lines +169 to +173
...(resources.artifactSnapshot === undefined ? {} : {
artifactSnapshot: fileIdentity(resources.artifactSnapshot, 'artifactSnapshot'),
}),
...(resources.runDirectory === undefined ? {} : {
runDirectory: fileIdentity(resources.runDirectory, 'runDirectory'),
Comment thread src/nvx/confinement.ts Outdated
Comment on lines +109 to +110
assertAbsolutePath(options.nvxRoot, 'NVX trusted artifact root');
assertAbsolutePath(options.runDirectory, 'NVX run directory');
Comment thread src/nvx/preflight.ts Outdated
Comment on lines +249 to +262
await fs.chmod(destination, name === 'launcher' || name === 'openvmm' ? 0o500 : 0o400);
copied[name] = destination;
}
const manifestPath = path.join(directory, 'manifest.json');
const bundlePath = path.join(directory, 'manifest.sigstore.json');
await fs.copyFile(options.manifestPath, manifestPath, constants.COPYFILE_EXCL);
await fs.copyFile(
options.artifactManifestBundlePath,
bundlePath,
constants.COPYFILE_EXCL,
);
await fs.chmod(manifestPath, 0o400);
await fs.chmod(bundlePath, 0o400);
return {
Comment on lines +34 to +37
readonly artifacts: Record<NvxTrustedArtifactName, {
readonly file: string;
readonly sha256: string;
}>;
Comment thread docs/nvx-security-design.md Outdated
Comment on lines +354 to +358
- `src/nvx/preflight.ts` requires Linux x86_64, root, usable KVM and TUN
devices, cgroup v2 CPU/memory/PID controllers, seccomp support, trusted host
tools, a GitHub-verified AWF release attestation, and matching artifact
digests before copying the artifacts into a private per-run immutable
snapshot and re-verifying the copied bytes;
@lpcox

lpcox commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

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

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8785

@github-actions

github-actions Bot commented Sep 20, 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 Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.anthropic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8785

@github-actions

github-actions Bot commented Sep 20, 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 Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 8 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 20, 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 Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

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

@github-actions

github-actions Bot commented Sep 20, 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 Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 20, 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 Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.anthropic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8785

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.75% 93.29% 📉 -0.46%
Statements 92.43% 91.97% 📉 -0.46%
Functions 92.99% 92.16% 📉 -0.83%
Branches 86.23% 85.79% 📉 -0.44%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-adapter.ts 80.4% → 79.8% (-0.58%) 77.8% → 77.3% (-0.54%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (5 files)
  • src/nvx/artifact-manifest.ts: 86.9% lines
  • src/nvx/cleanup-record.ts: 82.9% lines
  • src/nvx/confinement.ts: 87.8% lines
  • src/nvx/paths.ts: 100.0% lines
  • src/nvx/preflight.ts: 61.0% lines

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine — @lpcox

  • MCP connectivity: ✅
  • GitHub.com (HTTP 200): ✅
  • File write/read: ✅

Overall: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.anthropic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8785 · claude · haiku45 · 55.1 AIC · ⊞ 4.5K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ✅ PONG
  • pg_isready: ✅ accepting connections
  • PostgreSQL SELECT 1: ✅ 1

Overall: PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Blocked domain (example.com) denied: CONNECT tunnel failed (403)

Overall: PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

Copilot BYOK Smoke Test ✅

  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read
  • ✅ MCP connectivity
  • ✅ BYOK inference (direct mode via api-proxy)

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

Status: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

📡 Smoke Test: API Proxy OTel Tracing — Results

# Scenario Result
1 Module Loading ✅ otel.js loaded; isEnabled() → true; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + internals
2 Test Suite ✅ 3 suites / 68 tests passed, 0 failed
3 Env Var Forwarding ✅ env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and trace context
4 Token Tracker Integration ✅ onUsage callback present in token-tracker-http.js (OTEL hook point)
5 OTEL Diagnostics ✅ Workflow-level span exported (/tmp/gh-aw/otel.jsonl, 1 record); api-proxy's own otel.jsonl not present under .../logs/api-proxy/ in this run (api-proxy log dir is named api-proxy-logs/ and contained token-usage.jsonl with 8 records, token-tracker-audit.jsonl with 16 — no dedicated per-request OTEL span export observed there), consistent with expected-pending behavior noted in the workflow

Overall: all scenarios pass or are expected-pending during development. No regressions detected.

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

@github-actions

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 (ran successfully) ✅ PASS
.NET json-parse ✅ N/A (ran successfully) ✅ PASS
Go color ✅ ok ✅ PASS
Go env ✅ ok ✅ PASS
Go uuid ✅ ok ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
Node.js clsx ✅ all passed ✅ PASS
Node.js execa ✅ all passed ✅ PASS
Node.js p-limit ✅ all passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Notes:

  • Java: Maven's default local repository (~/.m2/repository) was not writable by the runner user (owned by root); worked around by using -Dmaven.repo.local pointed at a writable temp directory. No source changes required.
  • All other ecosystems (Bun, C++, Deno, .NET, Go, Node.js, Rust) built and tested cleanly through the firewall/proxy with no issues.

Generated by Build Test Suite for #8785 · copilot · auto · 34 AIC · ⊞ 10.1K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Merged PR titles:

  • feat: add NVX phase 2 filesystem and one-shot foundations
  • docs: define NVX one-shot security design
    GitHub PR/discussion reads: ✅
    Playwright title check: ✅
    File write/readback: ✅
    Build (npm ci && npm run build): ✅
    Overall: PASS

Warning

Firewall blocked 7 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environment. smoke-chroot label not added.

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

This branch was previously deployed

1 inactive deployment
aoai-model — d97d8389 Deployed Sep 20, 2026 by lpcox via conclusion #1699
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.

3 participants