feat: add fail-closed sbx bounded-query backend - #6764
Conversation
Add the independent broker-owned sbx runner boundary, executable capability proof, config/schema surface, focused tests, and documentation. Keep support blocked until sbx can enforce every mandatory network and resource bound; never fall back to Docker or gVisor. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1fb32473-f407-49e7-9d57-6331d80a8df6
There was a problem hiding this comment.
Pull request overview
Adds a fail-closed preview of an independent sbx backend for bounded-query execution.
Changes:
- Extends configuration, validation, schemas, and documentation with
runtime: "sbx". - Adds capability probing and broker-owned sbx runner infrastructure.
- Blocks sbx assembly until mandatory isolation guarantees are available.
Show a summary per file
| File | Description |
|---|---|
src/types/bounded-query-options.ts |
Adds the sbx runtime type. |
src/services/bounded-query-service.ts |
Prevents unsupported sbx broker wiring. |
src/services/bounded-query-service.test.ts |
Tests assembly rejection. |
src/parsers/bounded-query-parser.test.ts |
Tests sbx normalization. |
src/config-file.ts |
Exposes sbx configuration. |
src/config-file-bounded-queries-validation.test.ts |
Tests configuration acceptance. |
src/bounded-query/query-runner.test.ts |
Tests runner, probe, and cleanup contracts. |
src/bounded-query/preflight.ts |
Adds host capability checks. |
src/bounded-query/preflight.test.ts |
Tests fail-closed preflight behavior. |
src/awf-config-schema.json |
Updates the runtime schema. |
docs/sbx-integration.md |
Documents runtime independence. |
docs/bounded-queries.md |
Documents preview limitations. |
docs/awf-config.schema.json |
Updates the published schema. |
docs/awf-config-spec.md |
Specifies sbx preflight requirements. |
containers/bounded-query/Dockerfile |
Validates new broker modules. |
containers/bounded-query/broker/sbx-query-runner.js |
Implements sbx lifecycle management. |
containers/bounded-query/broker/sbx-query-runner-spec.js |
Defines trusted launch arguments. |
containers/bounded-query/broker/sbx-client.js |
Adds bounded sbx CLI execution. |
containers/bounded-query/broker/sbx-capability-probe.js |
Implements broker capability probing. |
containers/bounded-query/broker/query-runner.js |
Selects the sbx runner. |
containers/bounded-query/broker/config.js |
Accepts the sbx backend. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Suppressed comments (1)
containers/bounded-query/broker/sbx-query-runner-spec.js:37
hostWorkDiris specifically the Docker-daemon-visible path (config.js:122-124) and is translated withdockerHostPathPrefixduring Compose assembly. Reusing it for sbx mounts couples the supposedly independent backend to Docker's filesystem namespace; in DinD/ARC setups it can point at a path such as/host/...that the sbx daemon cannot see, so every mount fails. Introduce an sbx-daemon-visible work path rather than deriving this launch vector from the Docker path.
const hostInvocationDir = `${config.hostWorkDir}/${invocationId}`;
- Files reviewed: 21/21 changed files
- Comments generated: 3
- Review effort level: Balanced
…to lpcox-add-sbx-query-runner
Require authenticated daemon reachability, retain complete run identity during scoped reconciliation, and separate sbx daemon mount paths from Docker daemon paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1fb32473-f407-49e7-9d57-6331d80a8df6
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident... |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
❌ Contribution Check failed. Please review the logs for details. |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✅ Security Guard completed successfully! Security review of PR #6764 complete. No security weakening detected. Changes add sbx bounded-query backend with proper capability probing, version auditing, input validation, and fail-closed isolation controls. All hard-isolation flags (--network=none, --pids-limit, --disk-limit, --ulimit-fsize, --mount-target) are enforced before execution. Environment sanitization prevents credential leakage. Backend validation is strict and explicit. No firewall rules, capabilities, or egress expansions affected. Approved to proceed. |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
✅ Build Test Suite completed successfully! |
|
🔌 Smoke Services — All services reachable! ✅ |
Smoke Test: Claude Engine Validation
Overall result: PASS ✅
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS — Network isolation egress enforcement working as expected. 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 — Running in direct BYOK mode via
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version differs between host and chroot environment.
|
Smoke Test Results
Overall Status: FAIL
|
📡 Smoke Test: API Proxy OTel Tracing
Overall: 4/5 pass, 1 expected-pending. No unexpected regressions in OTEL tracing for the api-proxy sidecar.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
|
@lpcox
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java tests required
|
Summary
Adds PR layer 4 of the bounded-query multi-sandbox plan, stacked on #6763.
boundedQueries.runtimewith an independentsbxquery backendSbxQueryRunner, immutable trusted launch spec, scoped VM reconciliation, and deterministic stop/deleteCurrent support status
This is intentionally fail-closed preview support. sbx v0.37.1 provides
sbx create --name --cpus --memory --template, read-only same-path mounts,sbx exec --user --workdir,sbx ls --json,sbx stop, andsbx rm --force, but does not provide enforceable per-VM network-none, PID, disk, per-file size, or explicit guest mount-target controls. Local/kit network rules are insufficient because organization governance can replace them.The probe therefore exits non-zero,
runtime: "sbx"aborts before staging/Compose assembly, no Docker socket or sbx daemon credential reaches the broker, and there is no fallback to Docker/gVisor. The dormant launch vector is contract-locked to every probed hard-isolation flag so future enablement cannot drift from the proof.Validation
/var/tmpvs/private/var/tmpassertion failure insrc/bounded-query/mount-policy.test.ts; the remaining 4,894 tests passnode --checkLayer 5 requirements
Layer 5 must keep sbx query rollout blocked until a supported sbx release exposes all probed controls, AWF publishes a digest-pinned Python-standard-library-only query template/bootstrap, broker-only daemon transport/auth is defined and packaged without image-layer credentials, and the real matrix proves no network/lateral access plus timeout/OOM/PID/disk/file-size and interrupted-cleanup behavior.