Skip to content

feat: add confidentiality-aware sealed probe budgets - #6728

Merged
lpcox merged 3 commits into
mainfrom
sealed-probe-information-budgets
Jul 29, 2026
Merged

feat: add confidentiality-aware sealed probe budgets#6728
lpcox merged 3 commits into
mainfrom
sealed-probe-information-budgets

Conversation

@lpcox

@lpcox lpcox commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • classify each sealed-probe repository as public, internal, confidential, or sealed
  • enforce trusted per-repository run budgets of unmetered, 64, 8, and 0 bits respectively
  • allow each invocation to submit a different Python script and finite response schema, charging its complete transcript width against the shared run ledger before repository access
  • add protocol v2 finite-schema validation, BigInt cardinality accounting, strict result validation, and broker-side canonical serialization
  • bucket execution, container removal, and workspace cleanup into six charged response-time boundaries
  • retain maxInvocations as an independent operational limit and provide one-release compatibility for legacy repository strings

Validation

  • npm run type-check
  • npm run lint — no errors
  • npm run test:unit -- --runInBand — 275 suites, 4,783 tests

Closes #6725

Add repository sensitivity categories, finite response schemas, and
per-run bit ledgers. Canonically validate results and charge response
timing against each repository's run budget.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ca8d9d74-46ab-48db-b05f-640cbc6d47be
Copilot AI review requested due to automatic review settings July 29, 2026 19:58
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit d3568f6

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 99.13% 98.80% 📉 -0.33%
Statements 99.03% 98.35% 📉 -0.68%
Functions 99.14% 98.97% 📉 -0.17%
Branches 95.69% 94.73% 📉 -0.96%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/sealed-probe/protocol.ts 100.0% → 92.0% (-8.03%) 99.4% → 86.6% (-12.78%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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.

Pull request overview

Adds confidentiality-aware disclosure budgets and protocol v2 to the sealed-probe subsystem.

Changes:

  • Adds repository sensitivity profiles, trusted seed metadata, and per-run ledgers.
  • Introduces finite response schemas, cardinality accounting, and canonical result validation.
  • Adds response-time bucketing with expanded tests and documentation.
Show a summary per file
File Description
src/types/sealed-probe-options.ts Defines sensitivities, budgets, and repository descriptors.
src/types/index.ts Exports new sealed-probe types and constants.
src/services/sealed-probe-service.ts Adapts agent repository environment generation.
src/services/sealed-probe-service.test.ts Updates service tests for descriptors.
src/services/sealed-probe-compose.test.ts Updates Compose fixtures.
src/services/agent-environment/excluded-vars.test.ts Updates credential-isolation fixtures.
src/sealed-probe/wrapper.test.ts Tests protocol-v2 wrapper framing.
src/sealed-probe/workflow-integration.test.ts Updates workflow integration configuration.
src/sealed-probe/types.ts Adds sensitivity to seed-map v2.
src/sealed-probe/staging.ts Carries sensitivity through staging.
src/sealed-probe/staging.test.ts Tests sensitivity preservation.
src/sealed-probe/skill.ts Documents schemas, budgets, and timing.
src/sealed-probe/skill.test.ts Tests generated skill guidance.
src/sealed-probe/scheduler.test.ts Tests timing-bucket scheduling.
src/sealed-probe/protocol-parity.test.ts Expands protocol implementation parity tests.
src/sealed-probe/preflight.ts Adds timing-related timeout validation.
src/sealed-probe/preflight.test.ts Tests repository and timeout preflight.
src/sealed-probe/manager.ts Writes sensitivity into seed maps.
src/sealed-probe/manager.test.ts Tests seed-map v2 generation.
src/sealed-probe/ledger.test.ts Tests per-repository budget accounting.
src/sealed-probe/end-to-end.test.ts Exercises protocol v2 end to end.
src/sealed-probe/broker.test.ts Expands broker security and timing tests.
src/parsers/sealed-probe-parser.ts Normalizes descriptor and legacy configurations.
src/parsers/sealed-probe-parser.test.ts Tests normalization and warnings.
src/config-file.ts Updates raw configuration types.
src/config-file-sealed-probes-validation.test.ts Tests descriptor schema validation.
src/commands/build-config.test.ts Updates normalized configuration expectations.
src/awf-config-schema.json Adds sensitivity descriptors and timeout bounds.
docs/awf-config.schema.json Updates published configuration schema.
docs/awf-config-spec.md Documents protocol v2 and budgets.
containers/sealed-probe/broker/server.js Integrates canonical protocol-v2 responses.
containers/sealed-probe/broker/sensitivity.js Defines broker-side sensitivity budgets.
containers/sealed-probe/broker/scheduler.js Implements response-time bucketing.
containers/sealed-probe/broker/protocol.js Implements finite schemas and validation.
containers/sealed-probe/broker/ledger.js Implements run-budget accounting.
containers/sealed-probe/broker/framing.js Implements protocol-v2 request framing.
containers/sealed-probe/broker/config.js Loads seed-map v2 and timeout constraints.
containers/sealed-probe/broker/broker.js Orchestrates validation, charging, and scheduling.
containers/agent/sealed-probe-wrapper.sh Updates the agent CLI to protocol v2.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (5)

containers/sealed-probe/broker/broker.js:239

  • Queue time is outside the timing bucket because startMs is recorded only when execute begins after tail. With concurrent calls, the second caller observes the first probe's secret-dependent execution and cleanup duration before its own bucket starts (and can hit the wrapper's 660-second timeout while queued), creating more than the six charged timing outcomes. Concurrent requests must be rejected without later execution or their entire client-visible queue time must be included in a bounded, charged schedule.
      const queued = tail.then(() => execute(request, safeRespond)).catch((error) => {
        audit.failure('queue', 'unexpected-error', error && error.message);
        safeRespond(CANONICAL_ERROR_JSON);
      });
      tail = queued.then(
        () => undefined,
        () => undefined,
      );

containers/sealed-probe/broker/protocol.js:287

  • An accepted depth-6 schema can make this exponentiation materialize an enormous BigInt before any budget comparison. For example, six nested length-64 arrays over boolean have cardinality 2^(64^6), requiring roughly 16 GiB just for the integer; an untrusted agent can therefore block or OOM the broker with a tiny schema. Compute the bit width symbolically (and cap as soon as it exceeds every finite ledger) rather than materializing full cardinalities.
    case 'array':
      return schemaCardinality(schema.items) ** BigInt(schema.length);

containers/sealed-probe/broker/protocol.js:493

  • Using a normal object makes __proto__ bypass both duplicate detection and extra-key validation: assigning that key changes the object's prototype without creating an own property. For example, repeated __proto__ keys are accepted, and a result can carry a hidden __proto__ object while Object.keys still matches the schema. Build parsed objects with a null prototype (in both protocol mirrors) so every JSON key is represented and checked.
function parseJsonObject(text, index, depth) {
  let i = skipJsonWhitespace(text, index + 1);
  const obj = {};
  if (text[i] === '}') return { value: obj, endIndex: i + 1 };

  for (;;) {
    i = skipJsonWhitespace(text, i);
    const key = parseJsonStringLiteral(text, i);
    if (!key) return undefined;
    i = skipJsonWhitespace(text, key.endIndex);
    if (text[i] !== ':') return undefined;
    i = skipJsonWhitespace(text, i + 1);
    const value = parseJsonValue(text, i, depth + 1);
    if (!value) return undefined;
    if (Object.prototype.hasOwnProperty.call(obj, key.value)) return undefined;
    obj[key.value] = value.value;

containers/sealed-probe/broker/protocol.js:458

  • Converting the numeric lexeme to Number loses whether it was actually an integer before schema validation. Inputs such as 1.0000000000000001 round to 1, so Number.isInteger later accepts a floating result (and the same parser can normalize floating schema bounds into integers), contrary to the finite integer contract. Preserve/validate the exact numeric lexeme before rounding in both protocol implementations.
  const raw = text.slice(start, i);
  const value = Number(raw);
  if (!Number.isFinite(value)) return undefined;
  return { value, endIndex: i };

containers/sealed-probe/broker/broker.js:186

  • The bucket wait completes before the protected audit record is written, so the response is sent after additional synchronous, outcome-dependent filesystem work. Audit serialization/write latency (including different success/failure records and filesystem stalls) therefore shifts the observable response off its charged boundary. Complete all audit work before selecting/waiting for the final boundary, or perform another bounded scheduling step afterward.
    if (overflowed) {
      // Fail closed: processing (not the script itself, which is bounded by
      // `sealedProbes.timeout <= largest bucket`) overran every configured
      // bucket — pathological infrastructure latency. Never emit a
      // successful result at unbucketed timing.
      audit.failure(invocationId, 'timing-bucket-overflow', failureReason ? failureReason.join(':') : undefined);
      safeRespond(CANONICAL_ERROR_JSON);
    } else if (canonicalResult !== undefined) {
      audit.invocation({
        invocationId,
        repo: privateRepo,
        sensitivity: seed.sensitivity,
        bits: charge,
        bucketMs,
      });
      safeRespond(canonicalOkJson(canonicalResult));
    } else {
      audit.failure(invocationId, failureReason ? failureReason[0] : 'unknown', failureReason ? failureReason[1] : undefined);
      safeRespond(CANONICAL_ERROR_JSON);
  • Files reviewed: 41/41 changed files
  • Comments generated: 6
  • Review effort level: Medium

Comment thread src/sealed-probe/preflight.ts Outdated
Comment thread containers/sealed-probe/broker/scheduler.js Outdated
Comment thread containers/sealed-probe/broker/broker.js Outdated
Comment thread containers/sealed-probe/broker/server.js Outdated
Comment thread containers/sealed-probe/broker/sensitivity.js
Comment thread containers/sealed-probe/broker/protocol.js
@lpcox lpcox changed the title Add confidentiality-aware information budgets to sealed probes feat: add confidentiality-aware sealed probe budgets Jul 29, 2026
Reserve final-bucket cleanup time and rebucket late responses.

Count malformed requests and clean partial workspaces.

Align broker policy mirrors and restore coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ca8d9d74-46ab-48db-b05f-640cbc6d47be
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 99.13% 99.18% 📈 +0.05%
Statements 99.03% 99.09% 📈 +0.06%
Functions 99.14% 99.28% 📈 +0.14%
Branches 95.69% 95.91% 📈 +0.22%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/sealed-probe/protocol.ts 100.0% → 100.0% (+0.00%) 99.4% → 99.8% (+0.38%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Security Guard failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Security Guard failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox Network isolation egress smoke test results:

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable — allowed=200
✅ Non-allowed domain (example.com) blocked — CONNECT tunnel failed (403)

Overall status: PASS

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

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • ✅ MCP: github-list_pull_requests succeeded
  • ✅ GitHub.com connectivity: HTTP 200
  • ✅ File write/read: verified

Recent merged PRs:

Overall: PASS

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API Status ✅ PASS
GH Check ✅ PASS
File Status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #6728 · haiku45 · 55.1 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

  • Redis PING: ❌ (Temporary failure in name resolution)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal did not resolve in the AWF sandbox.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

Overall: PASS

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing — all scenarios passed ✅

  • Scenario 1 (Module Loading): otel.js loads successfully, isEnabled() returns true. Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus internal exporter/serialization helpers.
  • Scenario 2 (Test Suite): otel.test.js + otel-fanout.test.js59/59 tests passed (span creation, gen_ai token attributes, budget attributes, parent-context propagation, OTLP/JSON serialization, ProxyAwareOtlpExporter, FileSpanExporter fallback, fan-out exporter logic).
  • Scenario 3 (Env Var Forwarding): src/services/api-proxy-env-config.ts::buildOtelEnv() forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, and sets OTEL_SERVICE_NAME into the api-proxy container env.
  • Scenario 4 (Token Tracker Integration): onUsage and onSpanEnd callbacks confirmed present in token-tracker-http.js (lines 348, 360, 395, 407, 432, 495) as the OTEL hook points for usage normalization and span completion.
  • Scenario 5 (OTEL Diagnostics): Graceful degradation confirmed — FileSpanExporter fallback writes JSONL spans locally when no OTLP endpoint is configured; no errors on module init without OTEL env vars.

Summary: 5/5 scenarios pass. No issues found.

📡 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 3.12.13 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environments. smoke-chroot label not applied since not all tests passed.

Tested by Smoke Chroot
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 ok ✅ PASS
Go env ok ✅ PASS
Go uuid ok ✅ 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

Note: Java tests required overriding Maven local repo path (-Dmaven.repo.local) since ~/.m2/repository was not writable in this sandbox; not an AWF network issue.

Generated by Build Test Suite for #6728 · sonnet50 · 42.4 AIC · ⊞ 11K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Docker Sbx Validation

Overall: PASS

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test:

  • docs: add sealed probes guide: ✅
  • chore: upgrade gh-aw to v0.83.5 pre-release and recompile workflows: ✅
  • Browser title: ✅
  • File write/read: ✅
  • Build: ❌
    Overall: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  1. GitHub MCP: ❌
  2. Connectivity: ❌
  3. File Writing: ✅
  4. Bash Tool: ✅

Overall Status: FAIL

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 6975624 into main Jul 29, 2026
137 of 141 checks passed
@lpcox
lpcox deleted the sealed-probe-information-budgets branch July 29, 2026 23:04
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.

Add confidentiality-aware information budgets to sealed probes

2 participants