Repository navigation
Migrate Docker enclaves to the shared host-owned execution lifecycle - #10353
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive lifecycle changes retain unresolved correctness issues and incomplete live acceptance gates.
7 open issues
Coordinate status polling with short Docker deadlines · New Run delegation revocation sweep after Docker drain failure · New Round CPU limits before comparing with Docker values · New Preserve recovery state after delegation timeout · New Restore owner-write permissions on disposable script copies · New Validate Docker host prerequisites before seed staging · New Track staging provenance to clean never-started runs · New
What changed in this PR
Migrates Docker enclaves to AWF’s shared host-owned execution lifecycle while retaining Compose for the primary agent and sidecars.
Changes:
- Adds host-owned Docker launch, bounded storage, and verified recovery.
- Routes broker execution and dynamic delegation through authenticated host transport.
- Integrates readiness and shutdown ordering, with regression tests and compatibility documentation.
| File | Description |
|---|---|
| src/services/enclave-mcp-service.ts | Separates host launch settings from broker authority. |
| src/services/enclave-mcp-service.test.ts | Tests broker isolation and Docker configuration. |
| src/services/enclave-dynamic-service.test.ts | Tests dynamic host-channel topology. |
| src/services/enclave-agent-service.test.ts | Checks removal of broker identity mounts. |
| src/enclave/tool-call-budget.test.ts | Characterizes persistence failure behavior. |
| src/enclave/startup-diagnostics.test.ts | Tests runtime-specific diagnostic probes. |
| src/enclave/runtime-preflight.ts | Requires Docker lifecycle readiness. |
| src/enclave/runtime-preflight.test.ts | Tests trusted readiness enforcement. |
| src/enclave/manager.ts | Starts and stops Docker host execution. |
| src/enclave/manager.test.ts | Tests staging and lifecycle integration. |
| src/enclave/information-budget.test.ts | Characterizes ledger restart gaps. |
| src/enclave/host-executor-server.ts | Distinguishes recoverable workload failures. |
| src/enclave/host-executor-run-state.ts | Derives trusted dynamic admission authority. |
| src/enclave/host-executor-run-state.test.ts | Tests static and dynamic authority separation. |
| src/enclave/host-executor-routing.test.ts | Tests Docker transport and accounting. |
| src/enclave/host-executor-protocol.test.ts | Tests recoverable failure settlement. |
| src/enclave/dynamic-executor.test.ts | Preserves legacy gVisor coverage. |
| src/enclave/dynamic-delegation.ts | Keeps Docker delegation host-owned. |
| src/enclave/dynamic-delegation.test.ts | Tests custody and shutdown failures. |
| src/enclave/dynamic-delegation-service.ts | Blocks admission after controller failures. |
| src/enclave/dynamic-delegation-service.test.ts | Tests denial and infrastructure-failure distinctions. |
| src/enclave/dynamic-delegation-protocol.ts | Clarifies legacy transport documentation. |
| src/enclave/dynamic-delegation-channel.ts | Identifies the legacy gVisor channel. |
| src/enclave/docker-lifecycle.ts | Orchestrates Docker host execution and settlement. |
| src/enclave/docker-lifecycle.test.ts | Tests readiness, custody, and recovery behavior. |
| src/enclave/docker-host-storage.ts | Implements bounded host tmpfs storage. |
| src/enclave/docker-host-storage.test.ts | Tests capacity and mount verification. |
| src/enclave/docker-host-recovery.ts | Journals and verifies Docker resource identities. |
| src/enclave/docker-host-executor.ts | Launches, confines, and reaps Docker workloads. |
| src/enclave/docker-host-executor.test.ts | Tests execution, cancellation, and recovery. |
| src/enclave/cloud-hypervisor-lifecycle.ts | Limits teardown to selected VM runs. |
| src/commands/main-action.ts | Orders draining before infrastructure teardown. |
| src/commands/main-action.test.ts | Tests shutdown ordering and failure preservation. |
| scripts/ci/filesystem-sharing-contract.ts | Records the reduced broker mount surface. |
| scripts/ci/filesystem-sharing-contract.test.ts | Tests broker transport and metadata mounts. |
| docs/filesystem-sharing-contract.md | Documents runtime identities and mounts. |
| docs/enclaves-architecture.md | Describes migration, restrictions, and acceptance gaps. |
| docs/awf-config-spec.md | Clarifies delegation and accounting guarantees. |
| containers/enclave/script-executor/executor-handler.js | Reserves disclosure before host admission. |
| containers/enclave/mcp-server/server.js | Removes broker-owned Docker delegation. |
| containers/enclave/mcp-server/host-executor-runner.js | Routes Docker through host execution. |
| containers/enclave/mcp-server/environment-probes.js | Selects probes for host-owned execution. |
| containers/enclave/mcp-server/config.js | Loads Docker host-transport configuration. |
Review effort: Max
| return config.executorTransport === 'host' | ||
| || config.executorBackend === 'docker' || config.executorBackend === 'cloud-hypervisor'; |
| if (containersStarted) { | ||
| // Keep delegated identities and sidecars alive through host cancellation. | ||
| // Failure retains networks, seeds and recovery state, but still saves audit. | ||
| await stopDockerEnclaveLifecycle(config); |
| if (entry.executorKind === 'script') { | ||
| const source = `${plan.invocationHostDir}/repo:/awf/seed:ro`; | ||
| args[args.indexOf(source)] = `${plan.seedHostPath}:/awf/seed:ro`; |
| if (config.dockerHostPathPrefix && config.dockerHostPathPrefix !== '/') { | ||
| throw new Error('Docker host enclaves do not support dockerHostPathPrefix or split-filesystem daemons; mount policy is never bypassed'); | ||
| } |
| // No in-memory ownership means neither labels nor the absence of a journal | ||
| // proves that a legacy or interrupted invocation has released its mounts. | ||
| if (runId) { | ||
| throw new Error('Docker enclave recovery requires trusted reconciliation before cleanup'); |
|
@copilot address review feedback |
|
@copilot merge main and resolve conflicts |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓
|
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
Smoke Copilot: ✅ GitHub MCP (latest PR: "feat(router): add opt-in OpenTelemetry traces and metrics") · ✅ github.com 200 · ✅ File write/read
|
Smoke Test: Copilot BYOK (Direct) Mode ✅Test Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar Overall Status: PASS
|
|
Smoke services: ✅ Redis PONG, ✅ pg_isready, ✅ SELECT 1 — PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com → 200) Overall: PASS
|
|
|
|
Cloud Hypervisor + Copilot smoke test
|
|
Smoke test:
|
|
OTEL smoke test
|
Chroot Version Comparison
Not all tests passed: the Node.js version differs between host and chroot, so the
|
🏗️ Build Test Suite Results
Overall: 5/8 ecosystems passed — FAIL Failure details
The
|
|
ci: replace retired gpt-5.4-mini with gpt-5.6-luna in test-model-routing - ✅
|


Summary
Move Docker enclaves onto the shared host-owned execution lifecycle while preserving their isolation and bounded-disclosure guarantees.
Validation
Remaining acceptance and hand-off
Fixes #10340