Your endpoint charges agents. Nothing checks if they were allowed to buy.
x402 and MPP move the money. AgentPaymentSDK answers the question that comes first — is this agent admissible for this purchase? — before your 402 flow ever runs. One middleware line. DENY fails closed with sealed evidence; ALLOW passes through untouched.
$ npm i @kye/authority-gate # then wrap the handler
worker.tsx402 · mpp
import { authorityGate } from"@kye/authority-gate";export default authorityGate(handler, { tool: "my_paid_endpoint",});// ── a denied agent, at runtime ─────────────────✗ DENY reason=purpose_out_of_scope evidence=kye:…:8f2a// show it to the auditor// no offer minted, no charge attempted.
0 allow → your flow runs unchanged1 deny → sealed refusal, no chargeevidence on every exit code
$ man authority-gate
WHAT RUNS BEFORE YOUR HANDLER
intercept
the agent's request is captured ahead of your 402 flow — nothing reaches the handler ungated.
admit
principal, purpose, limits and mandate decided against declared authority by the real decision engine.
gate
DENY exits closed with a refusal an auditor can read. ALLOW proceeds — the offer embeds the admitting decision ref.
charge
your existing x402/MPP settlement runs as-is. Rails are consumed, never wrapped or reimplemented.
seal
decision + payment receipt + outcome bind into one evidence reference, verifiable offline from public keys.
HONEST SCOPE: the gate decides and evidences the charge. It never moves money, never touches settlement, never replaces your rail.
$ whoami --audience
WHO RUNS THIS
seller
your endpoint charges agents over x402/MPP today. The gate stops the sale you'd have to refund — before the charge exists, with a refusal you can forward to the buyer's principal.
platform
agents arrive holding mandates in five formats. One gate call adjudicates them all against real delegated authority — no per-format integration matrix.
enterprise
your agents buy tools and data on cards you issued. The gate is where budget, purpose, and approval thresholds actually bind — at the moment of spend.
$ ls benefits/
WHAT GREEN LOOKS LIKE
chargebacks answer themselves — the sealed authority chain is the dispute response, not a week of email archaeology.
audits become queries — evidence exists from the moment of the action; nothing is reconstructed later.
zero settlement migration — your x402/MPP code path is untouched; the gate sits in front, not inside.
offline-verifiable verdicts — every decision re-checks against published public keys with no call back to us.
$ git diff --stat your-endpoint # the whole integration
THE MOCKUP IS A DIFF
// worker.ts — your endpoint charging agents- export default handler; // pays first, asks never+ import { authorityGate } from "@kye/authority-gate";+ export default authorityGate(handler, { // asks first, always+ tool: "my_paid_endpoint",+ }); // settlement code below: unchanged, byte for byte
$ time --before-and-after
ROI, TRACED TO MECHANISM
dispute response
before: a week of provider-log archaeology · after: the sealed chain, already assembled at the moment of sale.
mandate formats
before: one integration per format, forever · after: one gate call adjudicates them all.
bad sales
before: charge → complaint → refund → reconciliation break · after: DENY exits before the offer exists. Four costs, never incurred.
adoption
before: a payments re-platform · after: the diff above.
$ diff alternatives/ ./
WHY NOTHING ELSE SITS HERE
the rails
move value; structurally neutral about whether it should move. We consume them — they can't referee traffic they carry.
wallets/issuers
assert intent; can't adjudicate their own mandates against a principal's live authority. The referee cannot play.
spend dashboards
report afterwards; can't stop the inadmissible charge or prove a verdict offline.
this gate
pre-payment verdict + offline-verifiable evidence, from the neutral layer. The moat: the verdict path has zero network dependency — a property a phone-home control plane cannot copy — and every sealed sale deepens the evidence standard only this layer issues.
$ man faq
FREQUENTLY ASKED
does the SDK touch the money?
Never. It decides and evidences; settlement stays exactly where it is. No custody, no transmission, no KYE payment rail — that neutrality is the point.
what does a DENY cost my endpoint?
Nothing downstream: the flow exits closed before any offer is minted or charge attempted. The caller gets a reason code + evidence reference; your handler never runs.
latency on the hot path?
The admissibility decision is local-first by design — the verdict path carries no remote dependency, so a network blip degrades settlement, never the decision.
languages?
TypeScript Worker middleware at launch. Python follows. The wire contract is plain HTTP + the 402 protocols, so anything that speaks x402/MPP can sit behind the gate.
pricing?
Per gated call, metered on the same billing rail as everything else KYE Protocol™ governs. Disclosed at onboarding; no seat minimums to start.
$ ./join --design-partner
SHIPS FIRST TO SELLERS ALREADY CHARGING AGENTS
TypeScript Worker middleware at launch; Python to follow. Early slots go to endpoints with live x402/MPP traffic.