Skip to content

feat(compliance): resolve and verify seller acceptance-policy catalogs #2665

Description

@bokelley

Summary

Add the JavaScript SDK buyer resolver and compliance-runner support for the seller acceptance-policy discovery contract in adcontextprotocol/adcp#6749 and adcontextprotocol/adcp#6794.

The protocol repository now publishes and exercises an in-band capability plus a real digest-matched reference catalog. The remaining SDK responsibility is safely resolving the advertised HTTPS catalog and turning its profiles into useful buyer guidance.

Buyer SDK behavior

  • Fetch media_buy.acceptance_policy_discovery.catalog_url under the protocol's remote-resolution rules: HTTPS only, no URL credentials, public-address/DNS pinning, no redirects, bounded response bytes and wall time.
  • Verify catalog_digest against the exact response bytes before parsing.
  • Validate the parsed document against acceptance-policy-catalog.json.
  • Resolve seller default and product acceptance_policy_profile_ids with cross-list uniqueness and exact policy/profile version and digest checks.
  • Compose applicable rules restrictively; preserve unknown for partial coverage, omitted rules, undisclosed seller policy, or unavailable external content.
  • Accept structured acceptance_context and explain likely allowed, prohibited, requires_disclosure, requires_setup, and requires_review outcomes without treating discovery as runtime authorization.
  • Cache only within the advertised capability lifetime and invalidate on capabilities changes.

Compliance runner

Make media_buy_seller/acceptance_policy_discovery fully executable by having the runner:

  1. fetch the advertised catalog;
  2. compare exact bytes with catalog_digest;
  3. schema-validate the document;
  4. resolve every advertised default and product profile;
  5. verify all pinned policy/profile digests; and
  6. fail with distinct unsafe-URL, fetch, digest, schema, and unresolved-reference diagnostics.

Tests

  • valid reference-seller catalog;
  • digest mismatch and byte-preserving/canonicalization edge cases;
  • redirect, URL credential, private-address, DNS-rebinding, timeout, and oversized-body rejection;
  • duplicate local/registry profile IDs and unresolved policy pins;
  • complete vs. partial coverage and restrictive default/product composition;
  • cache invalidation after a capabilities change.

Acceptance criteria

  • Buyers can ask the SDK what the seller is likely to accept without implementing catalog joins or mistaking advisory discovery for authority.
  • The acceptance-policy storyboard verifies fetched bytes and references, rather than only checking capability pointers.
  • Resolver results have parity requirements documented for the Python SDK.

Upstream: adcontextprotocol/adcp#6749
Implementation: adcontextprotocol/adcp#6794

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions