feat: add enclave MCP script executor - #6988
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the second unified-enclave migration layer: an authenticated, offline MCP script executor with hardened sandboxing and lifecycle integration.
Changes:
- Adds enclave staging, Compose services, cleanup, and audit preservation.
- Implements the MCP protocol, shared ledger, timing controls, and script runner.
- Adds image/release wiring, documentation, and focused tests.
Show a summary per file
| File | Description |
|---|---|
src/services/optional-services.ts |
Assembles enclave services. |
src/services/enclave-mcp-service.ts |
Defines enclave Compose services. |
src/services/enclave-mcp-service.test.ts |
Tests service isolation and configuration. |
src/image-tag.ts |
Registers enclave image digests. |
src/image-tag.test.ts |
Tests new digest keys. |
src/enclave/workflow-integration.test.ts |
Tests staging order. |
src/enclave/script-runner-spec.test.ts |
Tests sandbox controls. |
src/enclave/preflight.ts |
Validates disclosure limits. |
src/enclave/preflight.test.ts |
Tests limit validation. |
src/enclave/paths.ts |
Defines private enclave paths. |
src/enclave/paths.test.ts |
Tests path separation. |
src/enclave/mcp-server.test.ts |
Tests protocol, authentication, ledger, and timing. |
src/enclave/manager.ts |
Implements staging and teardown. |
src/enclave/manager.test.ts |
Tests lifecycle behavior. |
src/constants.ts |
Adds the server container name. |
src/commands/main-action.ts |
Integrates lifecycle operations. |
src/cli-workflow.ts |
Runs enclave staging before startup. |
src/artifact-preservation.ts |
Preserves enclave audit artifacts. |
docs/enclaves-architecture.md |
Documents migration layer 2. |
docs/awf-config-spec.md |
Documents the script executor contract. |
containers/bounded-query/enclave-mcp/server.js |
Implements authenticated HTTP transport. |
containers/bounded-query/enclave-mcp/mcp-protocol.js |
Implements MCP JSON-RPC methods. |
containers/bounded-query/enclave-mcp/healthcheck.js |
Checks server readiness. |
containers/bounded-query/enclave-mcp/config.js |
Loads trusted runtime configuration. |
containers/bounded-query/Dockerfile |
Builds the MCP server image. |
containers/bounded-query/broker/workspace.js |
Enforces configured output bounds. |
containers/bounded-query/broker/query-runner-spec.js |
Adds enclave labels and resource controls. |
containers/bounded-query/broker/broker.js |
Adds shared-ledger and uniform-timing behavior. |
containers/bounded-query/bounded-execution/sensitivity-policy.js |
Exposes unified enclave policy. |
containers/bounded-query/bounded-execution/sensitivity-ledger.js |
Adds shared executor accounting. |
action.yml |
Discovers enclave image digests. |
.github/workflows/release.yml |
Builds, signs, and publishes enclave images. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 32/32 changed files
- Comments generated: 3
- Review effort level: Balanced
2c57b3f to
0d7f247
Compare
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
0d7f247 to
4c98ad9
Compare
|
@copilot resolve merge conflicts and fix failing ci checks |
Resolved merge conflicts in |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 98.92% | 98.58% | 📉 -0.34% |
| Statements | 98.78% | 98.45% | 📉 -0.33% |
| Functions | 98.67% | 98.52% | 📉 -0.15% |
| Branches | 95.04% | 94.52% | 📉 -0.52% |
📁 Per-file Coverage Changes (4 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/artifact-preservation.ts |
93.2% → 87.6% (-5.60%) | 93.2% → 87.7% (-5.56%) |
src/services/optional-services.ts |
100.0% → 100.0% (+0.00%) | 98.4% → 98.5% (+0.10%) |
src/commands/main-action.ts |
97.4% → 97.4% (+0.02%) | 97.0% → 97.0% (+0.03%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (3 files)
src/enclave/manager.ts: 82.4% linessrc/enclave/paths.ts: 100.0% linessrc/services/enclave-mcp-service.ts: 85.3% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
@copilot address review feedback |
Addressed all review findings in |
Implement stack layer 2 with an AWF-owned authenticated MCP server, unified script ledger, hardened enclave runner, lifecycle wiring, release images, and tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1ce585d to
2aa7982
Compare
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 98.92% | 98.66% | 📉 -0.26% |
| Statements | 98.78% | 98.52% | 📉 -0.26% |
| Functions | 98.67% | 98.52% | 📉 -0.15% |
| Branches | 95.04% | 94.54% | 📉 -0.50% |
📁 Per-file Coverage Changes (4 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/artifact-preservation.ts |
93.2% → 92.4% (-0.77%) | 93.2% → 92.5% (-0.77%) |
src/services/optional-services.ts |
100.0% → 100.0% (+0.00%) | 98.4% → 98.5% (+0.10%) |
src/commands/main-action.ts |
97.4% → 97.4% (+0.02%) | 97.0% → 97.0% (+0.03%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (3 files)
src/enclave/manager.ts: 82.4% linessrc/enclave/paths.ts: 100.0% linessrc/services/enclave-mcp-service.ts: 85.3% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
🛡️ Smoke Copilot Network Isolation reports failed to deliver outputs while checking network isolation. Investigate the egress model. |
|
❌ Security Guard failed. Please review the logs for details. |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
Build Test Failed Build Test Suite - See logs for details |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed to deliver outputs. AOAI BYOK (Entra) mode investigation needed... |
|
❌ Contribution Check failed. Please review the logs for details. |
|
Smoke Test: Copilot Engine — PASS ✅
Overall: PASS cc @lpcox
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com): reachable, HTTP 200 Overall: PASS cc @lpcox Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Direct) Mode ✅Test Results:
Status: PASS — Direct BYOK mode operational via
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL All checks failed with
|
Chroot Version Comparison
Overall: FAILED — Node.js version differs between host and chroot environment.
|
Smoke Test Results (Gemini)
PRs Reviewed:
Overall Status: PASS
|
|
Merged PR titles:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra cc @lpcox
|
📡 OTel Tracing Smoke Test Results
All scenarios passed. No regression detected in OTEL tracing integration.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Notes:
|
|
Smoke Test: Docker Sbx Validation
Overall: PASS cc @lpcox
|
Summary
enclave_run_scripttoolThis stacked PR targets
lpcox-enclave-foundationand depends on #6986.MCP contract
enclave_run_scriptaccepts exactly:privateRepo: configured bareowner/reposelectorschema: bounded finite-disclosure schemascript: bounded UTF-8 Python sourceTrusted runtime, image, command, mount, network, credential, and resource controls are never caller-controlled. Executor outcomes use successful JSON-RPC tool responses with canonical structured content
{status:"error"}or{status:"ok",result:<canonical finite value>}and neverisError.Validation
git diff --cached --checkFull Jest and TypeScript type-check could not run because the locked dependency install is blocked by the package feed returning 404 for
typescript-eslint@8.66.0; dependency versions were not changed.