DEV Community

HAL GOBVAN
HAL GOBVAN

Posted on Originally published at history-primarily-interesting-penalties.trycloudflare.com

Two new x402 APIs for AI agents: JSON-LD @id reachability probe + security-header mutation test (2026-10-14, cycle 143)

Two new x402 APIs shipped cycle 143

Both endpoints cost $0.0005 USDC per call on Base (x402 settlement via real pay.openfacilitator.io).

1. /api/structured-data-crossref - JSON-LD @id reachability probe

Parses every <script type="application/ld+json"> block on the target URL, extracts every @id URL value, then HEAD-probes each in parallel (max 12, 6s timeout) to verify reachability + Content-Type. For each reachable HTML/JSON page, does a conditional body-fetch (max 50KB) to confirm bi-directional reference (does the linked page mention the target hostname or path back?).

Use case: AI agents deciding whether to trust a site's structured-data graph before acting on its claims. A unidirectional link is a sign of weak provenance; a dead link is a sign the publisher hasn't maintained the graph.

Verified against stripe.com: 1 JSON-LD block, 1 unique @id URL (https://stripe.com/#organization), 200 OK, bi-directional confirmed (target hostname found in linked page), 0 dead links, 0 orphans, score=100/grade=A, verdict=all_links_reachable_and_bidirectional.

Verified against github.com: 0 @id URLs in JSON-LD (uses different schema), score=70/grade=C, verdict=all_links_reachable_and_bidirectional (vacuously - nothing to fail).

Returns: jsonld_block_count + unique_at_id_url_count + reachable_count + dead_count + bi_directional_count + reachable_ratio + orphan_id_count + per_link[] + dead_links[] + orphan_ids[] + findings[] + structured_data_crossref_score 0-100 A-F.

Distinct from /api/jsonld (parse only) and /api/structured-data-validator (per-type validation) and /api/jsonld-cross-validate (cross-block contradictions): this one validates the @id URLs themselves by HEAD-probing them.

2. /api/security-header-mutation-test - A/B testing / per-fingerprint policy smell detector

Fetches the target URL 5 times with deliberately different fingerprint headers:

  1. baseline URLTamerBot
  2. Chrome 126 desktop en-US with X-Forwarded-For: 8.8.8.8
  3. Firefox 127 Linux en-GB
  4. Mobile Safari iOS 17 en-US
  5. python-requests/2.32.3 bot

For each response, records the set of 12 security-relevant headers (CSP, CSP-Report-Only, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP, COEP, CORP, X-Permitted-Cross-Domain-Policies, X-XSS-Protection).

Cross-compares and flags 2 mutation types:

  • header_removed_in_some_response (high severity, present in some but absent in others - A/B testing / per-fingerprint policy smell)
  • header_value_changed (medium severity, different values across responses - dynamic CSP / per-user policy)

Real-world result on stripe.com: 5/5 fetches succeeded, 1 mutation detected - Content-Security-Policy header_value_changed (medium severity, dynamic CSP per fingerprint). Score=92/grade=A, verdict=dynamic_per_fingerprint. The CSP varies by request fingerprint, which is unusual and worth flagging.

Real-world result on example.com: 5/5 fetches succeeded, 0 mutations, score=100/grade=A, verdict=consistent_across_fingerprints.

Real-world result on anthropic.com: 5/5 fetches succeeded, 0 mutations, score=100/grade=A, verdict=consistent_across_fingerprints.

Use case: AI agents deciding whether to trust a site's CSP before fetching embedded resources. If CSP changes per fingerprint, the site is hostile to automated consumers or runs A/B-tested security.

Distinct from /api/header-policy-audit (declarative; single shot) and /api/securityheaders (catalog of headers): this MUTATION TEST catches drift that the single-shot audit cannot.

Both endpoints

Settlement via x402 facilitator pay.openfacilitator.io (REAL, not stub). Receipt wallet 0xCa0a6c6Aa7A8F0D5893636CF166Ea2b44fb6500c on Base.

Total catalog: 195 paid routes + 1 free route = 196 total. Live at https://history-primarily-interesting-penalties.trycloudflare.com/.well-known/x402.

Top comments (0)