AGENT BUILDER HUB

Start self-serve, then carry one evidence shape across supported outcomes.

Connect the non-executable analysis tools first. Production keeps provider credentials with one exclusive execution service, reserves exact authority, grants one fresh permit claim and returns a common signed receipt schema for configured Stripe and supported x402 outcomes.

START IN 60 SECONDS

Connect the public MCP server before reading the protocol.

Codex, ChatGPT desktop, Claude, Cursor and compatible MCP clients can use the analysis and protocol-projection tools without an account. The live connection check proves the endpoint, tool discovery and a fail-closed sample before you configure production.

Connect your AI and run the live check →

NO PACKAGE REQUIRED

Use one hosted Streamable HTTP URL.

https://mandateshield.com/api/mcp

Free results are deliberately non-executable. Production adds account-pinned authority, durable reservations and the provider execution lifecycle below.

Run the complete test lifecycle →

PRODUCTION CONTROL PLANE

Register policy and issuer trust once.

The dashboard manages live API keys, immutable mandate versions and public verification-key pins. A pin binds the key thumbprint to its exact issuer, relying-party audience and protocol. These account-controlled records—not agent input—establish production authority. A pin may use ANY; each challenge still names one exact AP2, TAP, UCP, X402, ACP or CUSTOM protocol and the selected pin's thumbprint. Optional lifetime, UTC-day and UTC-month limits reserve cumulative headroom across concurrent attempts. Create a separate PROCESSOR key for each exact payment-gateway audience; VERIFY keys cannot transition reservations and PROCESSOR keys cannot create them.

Open the control plane →

DURABLE GATE STATE

Use the first-party PostgreSQL journal.

The official DurableGatewayJournal module supplies atomic begin, primary read and compare-and-set operations over an explicit versioned PostgreSQL migration. It runs inside the customer's Gate: database credentials and journal rows are not sent to MandateShield.

Deploy the PostgreSQL journal →

TOPOLOGY RESPONSIBILITY

One writable primary for every Gate worker.

All processes and regions must share one actually linearizable PostgreSQL primary. The startup readiness check rejects recovery, read-only and unsafe durability settings, but does not attest routing, replication or failover. Split-brain writers remain unsafe. The module is also separate from the x402 adapter's encrypted signed-payload artifact journal.

Read the durable journal contract →

STEP 1 · CHALLENGE

Bind signing to this attempt

const challenge = await client.createChallenge({
  mandate_id: purchase.mandate_id,
  protocol: purchase.protocol,
  key_thumbprint: process.env.MANDATESHIELD_KEY_THUMBPRINT
})

// The pinned authority issuer signs:
// challenge.issuer + challenge.audience + challenge.nonce + iat + exp
// + the SHA-256 digest of the exact final envelope.
const evidence = await authorityIssuer.sign(purchase, challenge)

STEP 2 · VERIFY + RESERVE

Require the full invariant; do not submit

const reservation = requireAllowed(await verifier.verifyAuthority({
  envelope: purchase,
  evidence
}))

// RESERVED authority is not provider-submission authority.
const base = {
  receipt_id: reservation.signed_receipt.receipt_id,
  compact: reservation.signed_receipt.compact,
  expected_envelope: purchase,
  expected_audience: challenge.audience
}

STEP 3 · CONSUME + ISSUE

Bind one exact provider request

Every account created at or after 2026-07-26T12:01:24.000Z must include an exact provider_binding on CONSUME. Only older accounts retain legacy unbound compatibility; new integrations must never depend on it. Provider-bound CONSUME moves the reservation to CONSUMED and creates a prepared durable submission plus an ES256 permit valid for at most 60 seconds. It deliberately returns provider submission permission false; the customer, agent and merchant cannot use this response to call the provider.

const consumed = await post(
  "/api/v2/execution-authorizations",
  process.env.MANDATESHIELD_PROCESSOR_KEY,
  {
  ...base,
  action: "CONSUME",
  idempotency_key: `${purchase.idempotency_key}:consume`,
  provider_binding: {
    profile: "STRIPE_PAYMENT_INTENTS_V1",
    environment: "live",
    account: purchase.payee_identity.binding.merchant_account_id,
    request_id: providerRequestId,
    payee_destination:
      purchase.payee_identity.binding.connected_account_id,
    method: "POST",
    resource: "https://api.stripe.com/v1/payment_intents",
    body_digest: providerBodyDigest
  }
})

if (
  consumed.provider_submission_permitted !== false ||
  consumed.provider_redemption_required !== true ||
  !consumed.execution_permit?.compact
) {
  throw new Error("Provider-bound permit was not issued")
}

STEP 4 · REDEEM + SUBMIT

Grant one fresh MandateShield claim at the execution edge

Atomic online redemption claims the prepared submission and grants one fresh permission in MandateShield's own state. The customer-deployed exclusive executor proceeds only when that single-winner claim returns true and must attempt the exact provider operation idempotently using the key carried in the signed permit and returned by redemption. MandateShield does not guarantee exactly-once provider delivery. Signature-only verification reports online state unknown and never grants submission.

// Run only in a customer-deployed exclusive executor.
const inspected = await postPublic(
  "/api/v2/execution-permits/verify",
  {
    compact: consumed.execution_permit.compact,
    expected_audience: challenge.audience
  }
)
if (inspected.provider_submission_permitted !== false) {
  throw new Error("Offline/signature verification must never grant")
}

const redeemed = await post(
  "/api/v2/execution-permits/redeem",
  process.env.MANDATESHIELD_PROVIDER_PROCESSOR_KEY,
  {
    compact: consumed.execution_permit.compact,
    idempotency_key: `${purchase.idempotency_key}:redeem`,
    expected_request: {
      provider: inspected.claims.provider,
      payee: inspected.claims.payee,
      amount: inspected.claims.amount,
      resource: inspected.claims.resource
    }
  }
)
if (
  redeemed.provider_submission_permitted !== true ||
  redeemed.status !== "CLAIMED" ||
  redeemed.idempotent_replay !== false
) throw new Error("No fresh redemption")

// The MandateShield claim is single-winner; provider delivery is not exactly-once.
const outcome = await submitIdempotentlyToProvider(purchase, {
  idempotencyKey: redeemed.provider_idempotency_key
})

STEP 5 · TERMINAL RECEIPT

Report a hint; let MandateShield check the native evidence

Report the exact submission, permit, claim, provider reference and bounded caller outcome to the hosted reconciliation endpoint. That report is stored as CALLER_ASSERTED evidence and does not finalize the authorization by itself. MandateShield then checks the configured Stripe API or x402 chain without trusting that caller report. Exact, non-conflicting PROVIDER_API_VERIFIED or CHAIN_FINALIZED evidence can autonomously COMMIT or RELEASE and return a signed terminal execution receipt with independent_verification=true. Pending, unknown or conflicting outcomes remain fail-closed for reconciliation.

Direct manual COMMIT or RELEASE remains supported. Its processor_result is authenticated by the PROCESSOR key and exact audience binding, but the receipt remains CALLER_ASSERTED with independent_verification=false. Always inspect the evidence class and independent-verification flag after verifying the ES256 signature.

const report = await post(
  "/api/v2/provider-submissions",
  process.env.MANDATESHIELD_PROVIDER_PROCESSOR_KEY,
  {
    provider_submission_id: redeemed.provider_submission_id,
    permit_id: redeemed.permit_id,
    claim_id: redeemed.claim_id,
    payment_reference: outcome.reference,
    outcome: outcome.status,
    occurred_at: outcome.occurredAt,
    provider_observation: outcome.boundedObservation
  }
)

if (
  report.terminal_transition_permitted !== true ||
  report.independent_verification !== true ||
  !["PROVIDER_API_VERIFIED", "CHAIN_FINALIZED"].includes(
    report.evidence_class
  ) ||
  report.authorization_finalized !== true ||
  !report.execution_receipt?.compact
) {
  await queueProviderReconciliation(redeemed.provider_submission_id)
  throw new Error("Provider outcome remains fail-closed")
}
Public receipt JWKS →

REMOTE MCP

Expose analysis and strict verification to agents.

Connect https://mandateshield.com/api/mcp. The check_ai_payment_authority tool is analysis-only and never authorizes execution. The verify_cryptographic_payment_authority tool uses the same strict v2 boundary; pass a live VERIFY-scoped bearer credential as a server-side authorization header.

The endpoint supports the stateless MCP 2026-07-28 server/discover flow and retains initialize-based compatibility for 2025-11-25, 2025-06-18 and 2025-03-26. Modern calls carry protocol, method and named-resource headers plus client-capability metadata; legacy clients keep their established handshake. Neither path creates an MCP session or exposes payment execution.

{
  "mcpServers": {
    "mandateshield": {
      "url": "https://mandateshield.com/api/mcp",
      "headers": {
        "authorization": "Bearer ${MANDATESHIELD_VERIFY_KEY}"
      }
    }
  }
}

A2A DISCOVERY

Delegate without weakening the gate.

A2A-compatible agents discover the public card and can submit normalized analysis or strict envelope-plus-evidence payloads. Calling through A2A never changes the execution invariant. Agent transports can create a reservation, but the PROCESSOR key and provider call must remain outside the agent. The provider-bound permit may be redeemed only by a customer-deployed exclusive executor before its idempotent provider operation. MandateShield claims no provider or facilitator adoption.

/.well-known/agent-card.json →

STRICT V2 BATCH

Verify 1–25 independent purchases.

POST /api/v2/batch preserves each item's own cryptographic result, one-time challenge, replay tombstone, receipt and atomic cumulative-budget reservation. Use the per-item execution fields; the outer HTTP success is not authorization. Every intended item still requires its own provider-bound CONSUME, fresh online redemption and terminal execution receipt.

ANALYSIS PROFILE

Keep v1 out of the payment switch.

v1 is retained for validators, policy diagnostics and migration. It always returns enforcement_authorized=false, even when its policy result is ALLOW and persisted.

MACHINE-READABLE

One contract for tools, crawlers and verification code.

These resources publish the strict endpoints, evidence shape, signed-receipt envelope, reason codes and agent discovery metadata.

FULL INTEGRATION GUIDE

Copy the SDK, CLI, MCP, A2A and framework examples.

View integrations →