Repository navigation
feat(compliance): hosted grading of governance-aware sellers - #7808
Conversation
…he public governance agent Storyboards that declare `requires: [multi_agent]` send their plan-setup and intent-check steps (`agent: governance`) to a governance agent. Hosted grading ran them single-URL, so a governance-aware seller could never complete them (#7758). Add hostedMultiAgentRoutingForStoryboard(): the storyboard's default_agent routes to the agent under test with the owner's credentials, `governance` routes to the public test agent's /governance/mcp tenant with the public test-agent credential from server config, and any other agent key makes the storyboard unroutable rather than sending it to the seller. Every routed entry carries explicit auth so the SDK's run-level auth fallback cannot hand the owner credential to the governance agent. The governance endpoint comes only from server config; the authored governance_agent_url must share its origin and is pinned over caller context. Governance steps that pull test-kit credentials and runs with shared headers are refused. Wire it into Addie's run_storyboard. The heartbeat's comply() cannot take per-storyboard routing on @adcp/sdk rc.51 (runStoryboard rejects `agents` with the positional URL comply() passes), so heartbeat wiring needs an SDK hook. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Run a routed multi_agent storyboard through the real @adcp/sdk runner against two loopback MCP agents, with the owner credential at run level and in the test kit as hosted runs set it. The governance agent sees only the governance credential and receives sync_plans; the seller sees only its own credential and never receives sync_plans. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Suffix governance plan ids with a per-run nonce so concurrent runs, or anyone holding the public token, can't overwrite the plan a run grades against on the shared governance tenant. - Refuse step-level credentials on every step not pinned to the agent under test (unpinned steps can route to governance by protocol), and `$test_kit.auth` references in storyboard context. - Return the governance-served step ids; run_storyboard skips them for OAuth detection, labels them in output, and notes the shared sandbox state they write. - Rename HostedAgentUnderTest.transport to protocol. - Wire test returns schema-valid responses and asserts both routed steps executed and passed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ticator The cross-check fed our own bare-hex key_id to the training agent's registry, so it couldn't catch a key_id format change. Derive the credential through @adcp/sdk verifyApiKey, which the training agent uses, so a prefix or length change breaks the test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Serve the hosted-grader buyer brand, authenticate hosted grading to the sandbox governance agent as one fixed buyer agent, and route the multi-agent governance storyboards through comply()'s routeStoryboard hook. - hosted-grader.adcontextprotocol.org serves only its brand.json (listing the sandbox governance agent under the token iss, and the grader buyer agent) and a governance-only JWKS, mounted before every app-wide route so no request-signing keys share that origin. - New hosted-grader credential role: own tag, HKDF info, and audience; authenticates only on the governance tenant as https://hosted-grader.adcontextprotocol.org/buyer; 30-minute TTL; limited to sync_plans, intent checks, audit reads, and outcome reports on plans carrying the run nonce. - Hosted routing mints a per-run grader credential and a per-run seller credential bound to the graded agent URL, substitutes the latter into sync_governance, binds caller to the grader, and only routes storyboards whose buyer is the hosted-grader brand. Minted credentials are scrubbed from comply() and run_storyboard results. - The same hook runs live-mode test-kit storyboards (comply_controller_mode_gate) with the declared kit's key instead of the owner's grading credential. - Docs: what governance-aware-seller grading needs from a seller. Fixes #7772 Refs #7758 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nance grading - Issue the seller credential only for the hosted governance agent and always pin governance_agent_url; other registration targets are unroutable. - Route the hosted-grader host on the raw Host header as well as req.hostname, so X-Forwarded-Host cannot get app-wide routes served there. - Check the grader credential's scope in check_governance from the request alone, before any cross-session lookup; allow adjusted intent re-checks. - Run nonces are UUIDs, so the plan-id suffix check is exact. - Scrub minted credentials by tag too, covering truncated echoes. - Multi-agent storyboards never take the live-mode kit route. - Docs: canonical URL and aud, operator pre-provisioning, revocation signing, sandbox origin separation, badge consequence; the troubleshooting guide notes the live-mode kit exception. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
cce7448 to
f878880
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — hosted multi-agent routing for grading governance-aware sellers (#7758/#7772).
No blocking findings. The reviewer found no Critical/High/Medium concerns: credential minting, routing/auth isolation, plan-scope enforcement, and tenant separation are carefully designed and heavily tested (wire-level isolation proofs, E2E all-PASS with negative controls, tamper/expiry/cross-run scope checks).
Checked against decision table:
- No critical/high findings (row 1 n/a).
- gated_paths: false (row 2 n/a).
- high_risk: true, but both matched files (
server/src/addie/mcp/member-tools.ts,server/src/addie/services/compliance-testing.ts) are(modified)with no medium-or-higher findings, so rows 3/5 do not fire. - No medium data-loss/schema/infra findings (row 4 n/a).
- No prior decision (row 6 n/a).
- No no-auto-approve team match (row 7 n/a).
- Zero medium findings (row 8 n/a).
No protocol-schema change under static/schemas/source/**, so schema↔docs coherence and the absent changeset are both correct (server/app + docs only). Falls through to row 9 — approve.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — no blocking or medium findings.
The reviewer examined the largest and most sensitive changes in PR #7808 (hosted grading of governance-aware sellers): credential isolation, fail-closed routing, run-nonce plan scoping, host-router origin separation, and secret redaction across hosted-multi-agent-routing.ts (+467) plus the credential/handler/http changes. All trust boundaries hold. No changeset is required since the diff is server-side plus docs/building only (not the published protocol surface under static/schemas/source/, docs/reference/, or dist/**).
Decision-table walk:
- Rows 1–4: no critical/high/medium findings; gated_paths is false; no schema/infra/data-loss category concerns.
- Row 3: high_risk is true, but the two matching files (member-tools.ts, compliance-testing.ts) are (modified), not (deleted).
- Row 5: high_risk (modified) is true, but there are zero medium findings, so this does not fire.
- Rows 6–8: no prior decision, no no-auto-approve team match, fewer than three medium findings.
- Falls through to row 9: approve.
Note: review_decision is REVIEW_REQUIRED, but gated_paths is false, so the row-2 hard gate does not apply. No breaking-class protocol change is present (no schema surface touched), so the breaking-change escalation gate is not triggered.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Resolved the code-quality finding (unused |
Schema Link Check ResultsCommit: ❌ Errors (schema not found)These schemas do not exist and the links will be broken:
|
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean pass, no blocking or medium findings.
Checked:
- Credential isolation on the hosted multi-agent governance routing (#7758) and live-mode test-kit route (#7772) is load-bearing and verified on the wire and over HTTP: governance endpoint is config-only/non-overridable, run-level owner auth is stripped from routed options, test-kit credential forwarding to non-seller steps is refused, minted secrets are redacted after the run, grader credentials are UUID-nonce-scoped fail-closed, and the hosted-grader host enforces origin separation.
- No protocol surface touched: no
static/schemas/source/**, nodocs/reference/**normative changes, nodist/**released artifacts, no changeset-scoped surface — so schema↔docs coherence, changeset, oneOf-discriminator, and artifact-immutability gates do not apply. high_risk: trueis driven by two (modified)server/src/addie/**files, but the reviewer found no medium-or-higher concerns on them, so the modification is presumed safe (no row-5 trigger).gated_paths: false;review_decision: APPROVED. No no-auto-approve team match. Prior decision wasapprovewith no findings — consistent net state.
Decision table: rows 1–8 do not fire (no critical/high/medium findings, no gated-path gap, no deletion, no sensitive-category medium, no team gate, fewer than three mediums). Falls through to row 9 → approve.
Blocking findings: none.
Medium findings: none.
|
Merging under the maintainer's authorization. The maintainer completed the DNS, Fly certificate and |
… comparand fixes to 3.2.x (#8327, #8334) (#8411) * test(compliance): fail the build when a storyboard leaves a $context token unresolved (#8327) The storyboard runner substitutes `$context.<key>` only when the key is in the run context. When it isn't, the step comes back skipped with `prerequisite_failed` and a failed `unresolved_substitution` validation — the storyboard can never pass, but it reports as a skip, which is also what legitimate capability gating produces. That is how #7797 shipped: the 3.0.x governance scenarios registered the governance agent with `url: "$context.governance_agent_url"` and never declared the key, so `sync_governance` could only ever skip. On the 3.0-compat tenants that step already skips on `missing_tool`, hiding the difference entirely, and the defect rode every released 3.0 bundle up to 3.0.26 until #7801 added the default. Adds `scripts/lint-storyboard-context-resolution.cjs`, which replays the real `injectContext()` in step order over every `sample_request` and reports any token with no writer. It runs as a hard gate in `npm run build:compliance` — `dist/**` is immutable, so the build is the last place a bad bundle can be stopped — and `npm run test:storyboard-context-resolution` re-checks the source tree plus every bundled release against a frozen table of the defects already frozen into released artifacts. The lint also rejects a `context_outputs` capture of `governance_agent_url` or the `*_agent_url` keys hosted grading seeds from server config: the seed is not a per-step guard, so a capture would let the agent under test redirect the governance agent it is told to trust. Fixes one live instance it found: `buyer_monitoring` polls delivery for a buy no step creates, so `$context.media_buy_id` had no writer. It now seeds the id from `fixtures.fixture_publisher.active_buy`. Closes #8317 Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 8c262e3) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(compliance): resolve $context comparands in storyboard assertions (#8334) The storyboard runner substitutes `validations[].value` and `validations[].allowed_values[]` and resolves `validations[].context_key` against the context as it stood *before* the step, and substitutes a webhook step's `filter` the same way. A step's own `context_outputs` land after its validations run, so a step cannot assert against a key it captures itself — and unlike `sample_request`, nothing guards this surface. An unresolved `value` silently becomes the comparand, an absent `context_key` makes the check *pass* with a `context_key_absent` observation, and a token left in a `filter` yields a selector no delivery can match. Two storyboards read a key their own step captures, so the assertion graded something other than what it claimed: - `geo_place_targeting` asserted "current_version is included in supported_versions" against `$context.place_system_version`, captured by the same `get_adcp_capabilities` step. The check compared the seller's `supported_versions` against the literal token, so the capability step could not pass for any seller and the scenario could never go green. It now captures `supported_versions` too and settles the `geo-place-catalog-capability.json` `x-adcp-validation.member_of` invariant on a second, stateless capabilities read — directly, at capability scope, before any product or buy state exists to make it conditional. - `vendor_metric_accountability` asserted the day-1 `committed_at` equals `confirmed_at` against `$context.confirmed_at`, captured by the same `create_media_buy` step, so no seller could satisfy it. Every day-1 `committed_at` on both packages is now captured on create and settled on a `get_media_buys` read-back that pins the buy under test — "each such entry's `committed_at` MUST equal `confirmed_at`", not just the first entry. Both scenarios are capability-gated out of the training-agent matrix (it declares neither `media_buy.features.committed_metrics_supported` nor GeoNames NL), so no floor moves; the grading impact lands on third-party sellers graded against a 3.2 bundle, all 14 of which are registered in static/compliance/published-versions.json. `scripts/lint-storyboard-context-resolution.cjs` gains a `context_assertion_unresolved` rule over all four comparand surfaces, using the before-own-capture ordering the request rule already uses, so `npm run build:compliance` rejects the class. Released bundles are immutable, so 3.2.0-beta.6 through 3.2.5 keep both defects under the frozen table in tests/lint-storyboard-context-resolution.test.cjs. Closes #8328 Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 4fe0876) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * test(compliance): adapt the context-resolution lint backport to 3.2.x The #8327 test reads server/src/compliance/hosted-multi-agent-routing.ts and the 3.0.27/3.0.28 bundles, none of which exist on 3.2.x: hosted grading of governance-aware sellers (#7808) is 3.3-only, and the fixed 3.0 bundles are registered on main. - Pin RUNNER_PINNED_CONTEXT_KEYS against GOVERNED_AGENT_CONTEXT_KEYS in server/src/compliance/storyboard-runner-options.ts (plus governance_agent_url, which main's hosted grader pins for every 3.2 bundle). - Drop the "published 3.0 bundles from 3.0.27 on are clean" test and the 3.0.27 side of the #7797 bracket; 3.0.26 still reproduces the defect. - Reword the #8327 changeset's pinned-key sentence for this line. The lint script itself is byte-identical to main. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Part of #7758. Fixes #7772. Supersedes #7779: its four commits are rebased here, unchanged apart from review fixes.
Builds on the compliance fixtures merged in #7803 (the hosted-grader buyer brand, caller, and test kit). No changeset: this PR touches server code and docs only, not the protocol release surface.
Summary
Hosted grading can now run the
governance-aware-sellermulti-agent storyboards against a third-party seller. It uses the two approaches the maintainer approved.D. A real buyer
brand.json.hosted-grader.adcontextprotocol.orgserves only two things:/.well-known/brand.json. This is a Brand Canonical Document with two entries:governanceagent whoseurlishttps://test-agent.adcontextprotocol.org, which is the tokenissand the URLsync_governanceregisters;buyingagent for the grader./.well-known/jwks.json, which holds the governance-signing key and nothing else.Every other path returns 404. The router is mounted first in
setupMiddlewareand matches both the rawHostheader andreq.hostname, so no app-wide route (in particular Addie's request-signing JWKS) is ever served on that origin. security.mdx requires governance keys to sit on a different origin from request-signing keys, and this dedicated host is how that holds.B4. One fixed grader buyer agent,
https://hosted-grader.adcontextprotocol.org/buyer.governance-agent-credentials.ts, reusing fix(training-agent): let third-party sellers use the public governance agent (#7758) #7786's design:adcp-sandbox-gov-grader.v1.), its own HKDF info, and its own audience, all derived fromTRAINING_GOVERNANCE_CREDENTIAL_SECRET. With the secret unset, the feature is off;timingSafeEqualon the MAC;agent_urlfixed to the grader URL and checked exactly;/governanceonly.extra. The buyer-agent registry maps it to the grader URL, and that URL becomes the intentcaller.sync_plans, intentcheck_governance(including the adjusted re-check),get_plan_audit_logs(explicit plan ids only) andreport_plan_outcome, and only on plans carrying the run nonce. The scope is checked from the request, before any cross-session lookup.report_plan_adjustmentare denied.Routing (#7779 finished).
hostedGovernanceAgentForRun()mints two credentials per run: a grader credential for the governance route, and a seller credential bound to the exact graded agent URL.sync_governance, but only for the hosted governance agent. Any other registration target makes the storyboard unroutable.governance_agent_urlis always pinned, andcalleris bound to the grader.acmeoutdoor.example, are skipped as not runnable, never graded as failures.Heartbeat and registry refresh.
compliance-testing.ts#complypassesrouteStoryboard(createHostedRouteStoryboard), which returnsundefined,{ skip }, or{ agents, default_agent, context, storyboard }. That covers the heartbeat,evaluate_agent_quality, and both registrycomply()routes. The SDK enforces per-agent auth isolation and refuses run-level headers. Addie'srun_storyboarduses the same routing.Keeping credentials out of output. Minted credentials are scrubbed from
comply()andrun_storyboardresults before anything is stored, rendered, or logged. The scrub matches the exact strings and also the credential tag, so truncated echoes are caught.#7772. Storyboards whose declared test kit is a live-mode principal (
sandbox: false, i.e.comply_controller_mode_gate), and where every step readsfrom_test_kit, are routed to the agent under test only. The replacement storyboard sets each step'sauthto the declared kit's key. The owner's grading credential still authenticates discovery, and the public live key carries only the gate probe.authnot being part of the SDK's grading-shape check. Acomply()-level test fails CI if an SDK release starts refusing it.sandbox: falsekit win over the run-level kit inresolveDeclaredTestKit(adcp-client#2817).Docs.
aao-verified.mdxgets a new section, "Grading governance-aware sellers":authorized_operatorscheck;callerto send, and the canonical-URL requirement foraud;brand.json,jwks_uri, and revocation URLs;storyboard-troubleshooting.mdxnotes the live-mode kit exception.Maintainer actions
adcontextprotocol.org, set to DNS only (not proxied), the same astest-agent:requirement_unmet).Verification
End-to-end (
.context/3.2-final/gov7758-e2e-final.ts). It runs the SDK'scomply()with this PR'srouteStoryboardhook against a loopback third-party seller that does real SDK verification. None of the ASSUME_D/ASSUME_B4 shortcuts are used. The seller:brand.json, finds the governance entry (step 13), and loads keys from itsjwks_uri;verifyGovernanceAuthorizationwithauthenticatedCallerset to the grader;Results:
governance_approvedgovernance_conditionsgovernance_deniedgovernance_denied_recoveryZero failed steps. None of the 8 minted credentials appear in the result.
Negative controls: when the seller maps its credential to another buyer, verification fails with
governance_token_not_applicable(caller mismatch). Whenbrand.jsonomits the governance entry, it fails withgovernance_issuer_not_authorized.What the e2e simulated:
hosted-grader.adcontextprotocol.org: a loopback host running the productionbrand.json/JWKS builders;governance_agent_urlrewritten to it;Unit tests:
training-agent-hosted-grader-credential.test.ts: caller binding over HTTP, scope, cross-run isolation, tool limits, tenant limits, role separation, tamper and expiry;brand.jsonvalidates against the schema; the host serves only its two documents.hosted-multi-agent-routing{,-wire}.test.ts: routing, credential substitution and isolation on the wire, the brand gate, pinning, redaction.hosted-route-storyboard.test.ts: Hosted suite runs send comply_controller_mode_gate/deny_live_caller as the run's sandbox principal: withHostedComplianceRunOptions pre-fills test_kit, so the declared sandbox:false kit is never loaded (#6735 left this path out) #7772 through the real SDKcomply()against a gated seller. It reproduces the bug without the hook and passes with it.compliance-testing-route-storyboard.test.ts: the wrapper passes the hook and redacts its output.npm run typecheckpasses. A security review and a protocol review ran on this PR. Every must-fix and should-fix item is addressed, along with four of the five security nits. The one not taken is a separate off switch per credential role.🤖 Generated with Claude Code