Documentation
Everything to prepare, run, and read a PreFlight check, plus the frozen API and CI integration.
Quickstart
Discovery is free and needs no account. Point it at a public endpoint:
Discovery returns the observed surface and a proposed manifest with per field provenance. Confirm the manifest, then run the paid check from your agent (below). You receive a private report link.
Prerequisites
What you need before running a full, paid check.
- Network and asset
- X Layer (eip155:196), USDT0 at 0x779ded0c9e1022225f8e0630b35a9b54be713736. All amounts are in this asset.
- Wallet funding
- Your agent's wallet needs 0.10 USDT on X Layer to pay the check fee over x402. This fee is separate from any target spend below.
- Client flow
- Run the check from your agent (verify_release API), the CLI, or an MCP-connected agent. Free discovery works from a browser; the paid check requires a wallet, so it does not run from the website.
- Owner attestation
- To have PreFlight act as a real buyer against your target (settlement and delivery proof), set authorize_buyer_proof and owner_attestation to true in the request. Without both, buyer-proof does not run and settlement and delivery are reported UNKNOWN.
- Target spend cap
- When buyer-proof is authorized, PreFlight's own buyer wallet pays your target. Spend is capped at 2 USDT per target and 10 USDT globally per day, isolated from the 0.10 USDT service fee.
- Retry and failure
- A check that never runs is not charged. If settlement does not confirm, retry with the same idempotency key rather than a new request.
Core concepts
- Release manifest
- What you intend to publish: endpoint, interface, payment terms, request and response contracts.
- Observed surface
- What the live service actually exposes right now.
- Criterion
- One comparison of declared against observed, with a state and evidence.
- Buyer proof
- The steps where PreFlight pays and takes delivery as a real customer.
- Decision
- RELEASE, BLOCK, or UNKNOWN, scoped to a single runtime snapshot.
Check criteria
Criteria are grouped: target, interface, payment, contract, and buyer proof. Each carries a stable code (for example PAY-04), a state, the declared and observed values, provenance, the consequence, and the exact fix.
Agent ID import
You can pass an OKX.AI Agent ID or a raw endpoint. When an Agent ID is given, PreFlight resolves the listing to its live endpoint and pre fills the manifest fields it can observe, marking each with its source.
Endpoint checks
PreFlight confirms the declared endpoint resolves over HTTPS, answers the declared method, and follows only the declared redirect policy. A method or redirect mismatch contradicts the release.
x402 and payment
For a paid service, PreFlight reads the HTTP 402 challenge and checks that its mode, network, asset, amount, and payTo match your declaration. It then authorizes a real x402 payment as a buyer.
Settlement verification
After authorizing, PreFlight confirms the payment settles on X Layer, rather than trusting a claim. The BUYER_SETTLEMENT criterion carries the settlement evidence.
Delivery verification
Once paid, PreFlight takes delivery and checks the returned result against your response contract, and confirms a duplicate payment replay is rejected. The BUYER_DELIVERY criterion carries the delivery evidence.
verify_release API
The paid check. Your agent posts the confirmed manifest and completes the x402 challenge.
The response is the report envelope (see Report schema). The private report URL and its access token are returned in report_access.
Machine report and CI
A compact machine report is available for CI. The process exit code carries the decision, so a pipeline can gate a release:
PreFlight Signed Receipt v1
Every completed full verification issues a PreFlight Signed Receipt v1 (Ed25519). Free discovery does not issue a receipt. A receipt carries the decision, the manifest and snapshot hashes it judged, the policy version, and the signing key ID. Anyone can verify that this receipt was issued by PreFlight, has not been altered, and applies to the identified runtime snapshot and policy version, offline of the report.
Verification is four steps, and the report page runs them in your browser:
Public keys are served at /api/v1/pubkeys, and a receipt envelope by ID at /api/v1/receipts/{id}. A RELEASE also issues an embeddable badge; see the CLI to verify from a terminal.
Public receipt verifier
The public verifier lets anyone confirm a receipt without an account or a capability token. Point a browser at /verify, or call the API directly:
The response reports signature validity, whether the payload has been altered, expiration, and the scope: what a receipt proves and, deliberately, what it does not.
MCP server
PreFlight ships an MCP wrapper so an agent can run a release check as a tool. The tool takes an endpoint and returns the decision, the report ID, and the receipt ID.
The same 0.10 USDT x402 payment applies. The agent's wallet pays, and the signed receipt comes back with the result.
Report schema
The report envelope, abbreviated:
Cohort endpoint
Aggregate runtime evidence across every listed OKX.AI ASP, gathered by free discovery. conforming may name each service; contradiction_summary is criterion codes and counts only. A named ASP will never appear in the contradictions section.
Rendered at /cohort.
Per-ASP endpoint
GET /api/v1/asp/{agent_id} returns the runtime evidence state for one listed service. A conforming service exposes its declared/observed detail. A non-conforming service exposes only the criterion codes that surfaced at the last scan and an owner-claim CTA. No names are shamed.
Permalinks live at /asp/{agent_id}.
Passport endpoint
GET /api/v1/passport/{agent_id} returns an owner-authorized, scoped passport when one exists, or an honest empty state. A passport carries the latest receipt, the policy version, and the expiry.
Benchmark endpoint
The adversarial corpus: seeded faults with expected decisions, run against the current policy. Every fixture appears with its expected and actual result. Failing fixtures render as failing. A benchmark that only shows green is not evidence.
Rendered at /benchmark.
Self-check endpoint
The last operator-funded PreFlight self-verification. It is dogfooding evidence, not demand evidence, and the API returns customer_demand:false on purpose.
Public badge embed
GET /api/v1/badge/{agent_id}.svg serves an 88×28 SVG badge for services whose owner has authorized a passport. No capability token is required. A missing passport returns 404; an expired or revoked one returns a STALE badge.
Troubleshooting
- 429 on discovery
- Free discovery is rate limited per IP. Wait and retry, or run the full check from your agent.
- Report link does not open
- Reports expire after 30 days and open only with the full capability link, including the part after the #.
- A decision looks wrong
- Open the evidence under the criterion. If the observed value does not match your understanding of production, send the report ID, never the token.
Security
- Capability tokens
- Sent in the URL fragment, never to a server, log, or analytics.
- Keys
- PreFlight signs its own buyer payments. Your agent signs yours. No key you hold reaches PreFlight.
- Scope
- Public runtime only, over the declared method. No authentication bypass.
See privacy for retention and storage.