Add sbx ingress for bounded-query broker - #6763
Conversation
Introduce trusted Docker and gVisor QueryRunner backends with centralized launch derivation and label-scoped lifecycle reconciliation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7cf71cc5-3209-47c7-8743-f903cbe4eff1
Add runtime-neutral broker ingress with executable sbx Unix socket probing and a capability-authenticated, internal-network HTTP fallback. Preserve Docker and gVisor query-runner authority and keep broker-private state isolated from primary agents. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
There was a problem hiding this comment.
Pull request overview
Adds trusted bounded-query ingress for sbx agents while retaining Docker/gVisor query execution.
Changes:
- Adds Unix-socket probing with authenticated HTTP fallback.
- Adds capability handling, generated wrapper artifacts, and broker hardening.
- Expands tests and documentation for sbx ingress.
Show a summary per file
| File | Description |
|---|---|
src/types/bounded-query-options.ts |
Defines trusted ingress transport state. |
src/services/optional-services.ts |
Starts the broker for sbx agents. |
src/services/bounded-query-service.ts |
Configures Unix or HTTP broker ingress. |
src/services/bounded-query-compose.test.ts |
Tests sbx broker composition. |
src/sbx-manager.ts |
Adds ingress probes and wrapper PATH support. |
src/sbx-manager.test.ts |
Tests socket probing and PATH changes. |
src/compose-generator.ts |
Adds the internal ingress network. |
src/commands/main-action.ts |
Integrates ingress into sbx startup. |
src/commands/main-action.test.ts |
Tests sbx capability and mount isolation. |
src/bounded-query/wrapper.test.ts |
Tests authenticated HTTP transport. |
src/bounded-query/wrapper-artifact.ts |
Materializes the agent wrapper. |
src/bounded-query/preflight.ts |
Allows sbx primary agents. |
src/bounded-query/preflight.test.ts |
Tests sbx preflight acceptance. |
src/bounded-query/paths.ts |
Adds wrapper and capability paths. |
src/bounded-query/paths.test.ts |
Tests the new paths. |
src/bounded-query/manager.ts |
Selects ingress and generates capabilities. |
src/bounded-query/manager.test.ts |
Tests ingress selection and artifacts. |
src/bounded-query/ingress.ts |
Resolves HTTP endpoints and capabilities. |
src/bounded-query/ingress.test.ts |
Tests secure ingress resolution. |
src/bounded-query/ingress-conformance.test.ts |
Verifies transport protocol parity. |
src/bounded-query/framing-deadline.test.ts |
Tests request-body deadlines. |
scripts/build-bundle.mjs |
Embeds the wrapper in standalone bundles. |
docs/sbx-integration.md |
Documents sbx ingress behavior. |
docs/bounded-queries.md |
Documents agent transport interfaces. |
docs/awf-config-spec.md |
Updates the bounded-query security contract. |
containers/bounded-query/broker/server.js |
Adds authenticated TCP ingress and limits. |
containers/bounded-query/broker/framing.js |
Adds body-read deadlines. |
containers/bounded-query/broker/config.js |
Loads TCP and capability configuration. |
containers/agent/bounded-query-wrapper.sh |
Supports Unix and authenticated HTTP requests. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 29/29 changed files
- Comments generated: 5
- Review effort level: Balanced
|
@copilot address review feedback |
Reconcile bounded-query shutdown admission handling across Unix and sbx HTTP listeners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
Preserve the concurrent sbx ingress fixes while retaining shutdown admission draining across both broker listeners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
…d-sbx-broker-ingress
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7cf71cc5-3209-47c7-8743-f903cbe4eff1
Bring in the GitHub CLI 2.97.0 pin, grouped package removal, and narrowed Grype ignores from the stacked base. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
Resolve the squashed bounded-query runner base against the Unix and sbx HTTP broker listeners while preserving shared shutdown admission draining. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 99.14% | 98.96% | 📉 -0.18% |
| Statements | 99.05% | 98.87% | 📉 -0.18% |
| Functions | 99.29% | 99.20% | 📉 -0.09% |
| Branches | 95.87% | 95.24% | 📉 -0.63% |
📁 Per-file Coverage Changes (5 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/sbx-manager.ts |
96.6% → 93.3% (-3.29%) | 96.1% → 92.8% (-3.34%) |
src/services/bounded-query-service.ts |
100.0% → 98.0% (-2.00%) | 100.0% → 98.0% (-1.97%) |
src/commands/main-action.ts |
99.3% → 98.2% (-1.12%) | 98.7% → 97.7% (-1.04%) |
src/services/optional-services.ts |
100.0% → 100.0% (+0.00%) | 99.1% → 99.1% (+0.01%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/bounded-query/ingress.ts: 91.1% linessrc/bounded-query/wrapper-artifact.ts: 86.7% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
Explicitly chmod the disposable Unix-socket probe directory so restrictive umasks cannot remove its execute bit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c5d350f-25d9-4048-af90-419c1a387f5f
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 99.14% | 98.96% | 📉 -0.18% |
| Statements | 99.05% | 98.87% | 📉 -0.18% |
| Functions | 99.29% | 99.20% | 📉 -0.09% |
| Branches | 95.87% | 95.24% | 📉 -0.63% |
📁 Per-file Coverage Changes (5 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/sbx-manager.ts |
96.6% → 93.4% (-3.26%) | 96.1% → 92.8% (-3.30%) |
src/services/bounded-query-service.ts |
100.0% → 98.0% (-2.00%) | 100.0% → 98.0% (-1.97%) |
src/commands/main-action.ts |
99.3% → 98.2% (-1.12%) | 98.7% → 97.7% (-1.04%) |
src/services/optional-services.ts |
100.0% → 100.0% (+0.00%) | 99.1% → 99.1% (+0.01%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/bounded-query/ingress.ts: 91.1% linessrc/bounded-query/wrapper-artifact.ts: 86.7% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
🔌 Smoke Services — All services reachable! ✅ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
❌ Security Guard failed. Please review the logs for details. |
|
🔌 Smoke Services — All services reachable! ✅ |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 99.14% | 98.92% | 📉 -0.22% |
| Statements | 99.05% | 98.83% | 📉 -0.22% |
| Functions | 99.29% | 99.20% | 📉 -0.09% |
| Branches | 95.87% | 95.27% | 📉 -0.60% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/bounded-query/preflight.ts |
100.0% → 96.5% (-3.48%) | 100.0% → 96.6% (-3.42%) |
src/sbx-manager.ts |
96.6% → 93.4% (-3.26%) | 96.1% → 92.8% (-3.30%) |
src/services/bounded-query-service.ts |
100.0% → 98.1% (-1.89%) | 100.0% → 98.1% (-1.86%) |
src/commands/main-action.ts |
99.3% → 98.2% (-1.12%) | 98.7% → 97.7% (-1.04%) |
src/services/optional-services.ts |
100.0% → 100.0% (+0.00%) | 99.1% → 99.1% (+0.01%) |
src/artifact-preservation.ts |
96.2% → 96.3% (+0.07%) | 96.2% → 96.3% (+0.07%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (3 files)
src/bounded-query/ingress.ts: 91.1% linessrc/bounded-query/runtime-matrix.ts: 100.0% linessrc/bounded-query/wrapper-artifact.ts: 86.7% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test: Claude Engine Validation
Overall result: PASS ✅
|
|
Smoke Test Results:
Overall: FAIL —
|
Smoke Test Results
Overall status: FAIL
|
|
Smoke Test: Copilot Engine Validation
Overall: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (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 Results: Copilot BYOK ✅
Status: PASS — Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY)
|
|
Smoke test results:
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.
|
🔥 Smoke Test: API Proxy OpenTelemetry Tracing
All scenarios passed. No unexpected failures.
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment. The
|
|
✅ GitHub MCP connectivity (pre-fetched PR data validated) Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: PASS
|
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 Overall: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java Maven builds initially failed with
|
|
Smoke Test: Docker Sbx — @lpcox
Overall: PASS
|
Summary
Threat model
The HTTP fallback keeps launch configuration entirely broker-owned. The agent supplies no runtime, image, command, mount, path, limit, or credential. The broker is not attached to
awf-net,awf-ext, or an external route; only its fixed ingress port is published to host loopback. Separate 256-bit query/probe capabilities are generated under broker-private control state, never written to skill text or audit artifacts, and the on-disk capability file is removed after readiness. Unauthenticated requests return canonical bytes without consuming query budget.Validation
/var/tmpvs/private/var/tmpalias assertion fails inbounded-query/mount-policy.test.tsStack
Targets
lpcox-refactor-query-runners(PR #6762). Layer 4 may add an sbx query runner behind the existing trustedQueryRunnerselection boundary; it must not reuse primary-agent ingress capabilities or allow agent-controlled launch parameters.