Skip to content

Add NVX Phase 3b lifecycle foundations and KVM evidence workflow - #8840

Merged
lpcox merged 7 commits into
mainfrom
copilot/complete-nvx-phase-3b-integration
Sep 21, 2026
Merged

lpcox merged 7 commits into
mainfrom
copilot/complete-nvx-phase-3b-integration

Conversation

Copilot AI commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

NVX Phase 3b needs host-owned privileged resource lifecycle management, deny-by-default network enforcement, constrained one-shot launch composition, and live KVM evidence before it can become a selectable runtime. This keeps nvx unavailable through the CLI/runtime registry while adding the internal foundations required for review.

  • Runtime lifecycle foundations

    • Added NVX per-run account allocation/verification/deletion with no login shell, no home, and no supplementary groups.
    • Added serialized ACL-only /dev/kvm and /dev/net/tun grants with exact device/inode/uid evidence and exact revocation.
    • Added cgroup v2 setup with CPU, memory, and PID limit read-back verification plus exact membership checks.
  • Launch and network composition

    • Added Phase 3b launch-plan construction that composes the Phase 2 one-shot sandbox run argv through the Phase 3 ip netns exec → Bubblewrap → setpriv confinement chain.
    • Reused AWF microVM deny-by-default nftables policy for NVX network planning: Squid, API proxy ports, and explicit control peers are allowed; DNS/metadata/host/lateral paths remain denied.
const plan = buildNvxPhase3bLaunchPlan({
  runId,
  tools,
  identity,
  filesystem,
  execution,
  network: { infrastructureBridge, enableApiProxy, controlPeers },
});
  • Cleanup and registry safety

    • Extended NVX cleanup records to store exact device ACL identities instead of path-only ACL state.
    • Reserved nvx in runtime lookup so it fails closed instead of passing through as an arbitrary Docker runtime.
  • Evidence and documentation

    • Added an opt-in live KVM evidence workflow for host preflight, account isolation, device ACLs, cgroup limits, namespace-local firewall policy, cleanup residue, and focused NVX coverage.
    • Updated the NVX security design with the implemented Phase 3b boundary and remaining fail-closed promotion requirements.

Copilot AI changed the title [WIP] Complete NVX Phase 3b runtime integration and live KVM validation Add NVX Phase 3b lifecycle foundations and KVM evidence workflow Sep 21, 2026
Copilot AI requested a review from lpcox September 21, 2026 16:38
@lpcox
lpcox marked this pull request as ready for review September 21, 2026 16:38
Copilot AI balanced review requested due to automatic review settings September 21, 2026 16:38

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

Launch-path composition, ACL rollback, lock reclamation, cleanup reporting, and required live KVM validation remain incorrect or incomplete.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 4 High severity · 1 Medium severity

Open (5)
What changed in this PR

Adds internal NVX Phase 3b lifecycle, confinement, network-policy, and validation foundations while keeping NVX unavailable through the CLI.

Changes:

  • Adds account, device ACL, cgroup, network, and launch-plan primitives.
  • Extends cleanup-record identities and reserves the nvx runtime name.
  • Adds tests, documentation, and an opt-in KVM evidence workflow.
File Description
src/​nvx/​runtime-lifecycle.ts Adds Phase 3b lifecycle and launch planning.
src/​nvx/​runtime-lifecycle.test.ts Tests new lifecycle foundations.
src/​nvx/​index.ts Exports lifecycle APIs.
src/​nvx/​cleanup-record.ts Records exact device ACL identities.
src/​nvx/​cleanup-record.test.ts Tests ACL record validation.
src/​container-runtime.ts Reserves the nvx runtime name.
src/​container-runtime.test.ts Tests reserved-runtime rejection.
docs/​nvx-security-design.md Documents Phase 3b status.
.github/​workflows/​nvx-phase-3b-live-kvm.yml Adds opt-in evidence collection.

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

Comment thread src/nvx/runtime-lifecycle.ts Outdated
Comment on lines +249 to +253
await this.dependencies.run(this.tools.setfacl, [
'--modify', `user:${identity.uid}:rw`, devicePath,
]);
const verified = await this.verifyDeviceAcl(deviceIdentity);
this.aclIdentities.set(devicePath, verified);
Comment thread src/nvx/runtime-lifecycle.ts Outdated
Comment on lines +425 to +435
const owner = await this.readLockOwner(lockDirectory);
if (
owner &&
await this.dependencies.processStartTime(owner.pid) === owner.startTime
) return;
if (
!owner &&
(initialStats.mtimeMs === undefined ||
Date.now() - initialStats.mtimeMs < INCOMPLETE_LOCK_STALE_MS)
) return;
await this.dependencies.rm(lockDirectory, { recursive: true, force: true });
Comment on lines +569 to +571
if (path.resolve(options.filesystem.runDirectory) !== layout.runDirectory) {
throw new Error('NVX filesystem bundle must belong to the canonical run directory');
}
Comment thread src/nvx/runtime-lifecycle.ts Outdated
Comment on lines +587 to +591
const outcomePath = path.join(layout.runDirectory, 'outcome.json');
const oneShotArgs = buildNvxOneShotArguments({
...options.execution,
nvxRoot: layout.artifactSnapshotDirectory,
filesystem: options.filesystem,
Comment on lines +78 to +85
sudo ip netns exec "$netns_name" nft delete table inet "$nft_table" >/dev/null 2>&1 || true
sudo ip netns delete "$netns_name" >/dev/null 2>&1 || true
if [ -d "$cgroup_path" ]; then
sudo rmdir "$cgroup_path" >/dev/null 2>&1 || cleanup_errors+=("cgroup")
fi
sudo rmdir /sys/fs/cgroup/awf-nvx-ci-parent >/dev/null 2>&1 || true
for device in /dev/kvm /dev/net/tun; do
sudo setfacl -x "u:$account_name" "$device" >/dev/null 2>&1 || true
@lpcox

lpcox commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed all five review findings in fb1fb06 and 70c5e15:

  • Device ACL grants are recorded as pending before setfacl runs, so any failure in setfacl/getfacl/lstat/validation still revokes; revocation now distinguishes an absent ACL (nothing to remove) from a changed device identity (fail closed).
  • Stale lock reclamation renames the inspected directory to a unique quarantine path and verifies the moved dev/inode and owner (plus owner liveness) before deleting; a raced lock is restored and acquisition fails closed.
  • NvxFilesystemBuilder can stage into the canonical /run/awf-nvx/runs/<runId> layout via useCanonicalRunDirectory, so real bundles can satisfy the launch-plan contract.
  • Every layer, scratch, manifest, and outcome path is translated to the in-jail /run/awf-nvx view before argv construction; the host outcome path is exposed on the plan.
  • The live KVM workflow verifies each privileged resource (nft table, netns, leaf/parent cgroup, both device ACLs, account, group) is actually absent before recording cleanup PASS, and cgroup-limit/network-policy evidence is asserted before being recorded as PASS.

@github-actions

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

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-8840 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit db1e820

@github-actions

github-actions Bot commented Sep 21, 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 21, 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 21, 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

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

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8840

@github-actions

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

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 21, 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 21, 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 #8840

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (api.github.com) reachable
✅ Blocked domain (example.com) denied

Overall: PASS

cc @Copilot

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 github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine

Overall: PASS

@lpcox please review.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Results:

  • 1️⃣ GitHub MCP: ✅ (2 merged PRs fetched)
  • 2️⃣ github.com connectivity: ✅ (HTTP 200)
  • 3️⃣ File write/read: ✅ (smoke test file verified)
  • 4️⃣ BYOK inference: ✅ (running in direct BYOK mode via api-proxy → api.githubcopilot.com)

Overall Status: PASS

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) with sidecar authentication to api.githubcopilot.com.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
GitHub CLI ✅ PASS
File ✅ 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 #8840 · claude · haiku45 · 55.9 AIC · ⊞ 4.7K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

# Scenario Result
1 Module Loading ✅ otel.js loads successfully; isEnabled(): true; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, _parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, _createOtlpWorkloadIdentity + internal classes
2 Test Suite ✅ 3 test suites, 68/68 tests passed (0 failed) covering span creation, token/budget attributes, OTLP export (single + fan-out), file exporter, and parent-context propagation
3 Env Var Forwarding ✅ env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID to agent; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and the trace/span IDs to api-proxy
4 Token Tracker Integration ✅ token-tracker-http.js contains the onUsage callback hook point for OTEL
5 OTEL Diagnostics i️ No otel.jsonl span file produced this run — expected, since no OTLP collector endpoint was configured for this smoke run (graceful degradation confirmed; no errors)

Overall: All scenarios pass or are expected-pending. OTEL tracing integration in the api-proxy sidecar is working correctly, including graceful no-op behavior when OTEL isn't configured.

📡 OTel tracing validated by Smoke OTel Tracing
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 (v24.21.0 vs v2.98.0). The smoke-chroot label was not added since not all tests passed.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ✅ (PONG)
  • PostgreSQL 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

🏗️ 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 ✅ 1/1 passed ✅ PASS
Go env ✅ 1/1 passed ✅ PASS
Go uuid ✅ 1/1 passed ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
Node.js clsx ✅ passed ✅ PASS
Node.js execa ✅ passed ✅ PASS
Node.js p-limit ✅ passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Notes:

  • Java: ~/.m2/repository was not writable for the runner user, so builds used -Dmaven.repo.local=/tmp/gh-aw/agent/m2repo as a local Maven repository override (proxy settings via ~/.m2/settings.xml still applied).
  • All repositories cloned successfully; no CLONE_FAILED cases.

Generated by Build Test Suite for #8840 · copilot · auto · 33.8 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Replace Docker SBX CI smoke tests with Cloud Hypervisor ✅
Fix Cloud Hypervisor trusted artifact EACCES on hosted runners ✅
GitHub PR reads ✅
Playwright title check ✅
File write/read ✅
Latest discussion lookup ✅
Build (npm ci && npm run build) ✅
Overall: PASS

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
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 200cffc into main Sep 21, 2026
176 of 183 checks passed
@lpcox
lpcox deleted the copilot/complete-nvx-phase-3b-integration branch September 21, 2026 22:02

This branch was previously deployed

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

Complete NVX Phase 3b runtime integration and live KVM validation

3 participants