AffixIO SDK · Agents · Payments

Agentic Payment Verification

Zero-PII cryptographic proof for autonomous payment agents. Prove intent and completion on your host, attach a replay-safe signature, and let the recipient verify, without moving personal data off your stack.

Section 01

Why agentic payment verification

Autonomous payment agents introduce a hard problem: an agent spends money without a human in the loop to eyeball each transaction. Whoever receives the funds needs proof that the payment was intended, well-formed, and actually completed, without asking you to copy personal data onto someone else's stack.

AffixIO solves this with cryptographic proofs that are zero-PII, replay-safe, and machine-verifiable. The agent's host holds the record, runs the proof locally, and signs the outcome with ML-DSA-65 (FIPS 204). The recipient can verify the verdict, or attach it to a payment intent that the provider can audit: no PAN, name, address, or DOB ever crosses the wire.

  • Zero-PII: only hashes and binary verdicts travel; the underlying record stays on your host.
  • Replay-safe: spend journal, Merkle leaf, and intent binding make a proof impossible to reuse on another transaction.
  • Machine-verifiable: a yes / no with signed evidence that another agent or platform can check autonomously.
  • Post-quantum: ML-DSA-65 (FIPS 204) signatures, so the proof survives a future quantum attacker.
Agentic payment verification flow An autonomous agent creates a payment intent proof, sends the signed proof to a payment provider, Affix verification checks the replay-safe verdict, then the merchant recipients verify the proof. Agent reads host record, signs intent Hover: agent proves intent with zero PII. Payment Provider receives signed proof, rails move funds Affix Verification checks replay-safety, signs verdict Merchant / Platform verifies proof, settles, keeps audit Hover: recipient calls verifyLocal () or the HTTP API. Merchant side replays, Merkle leaf, spend journal
Figure 01: the agentic payment verification flow. Tap or hover the nodes for machine-readable annotations.
Zero-PII · hashes only Replay-safe · spend journal Machine-verifiable · yes/no verdict ML-DSA-65 · FIPS 204

Section 02

Where to wire AffixIO in

There are three natural integration points in an agentic payment flow. Each yields a different data footprint and calls a different AffixIO method:

AffixIO integration points for agentic payment verification
Stage Data in Data out AffixIO method Example use case
Pre-payment intent id, amount, payee, circuit fields signed payment-intent proof sdk.prove() + enrol() Agent declares intent refunda a supplier before rails move funds.
Post-payment transaction ref, provider status, decision signed completion proof, verified sdk.prove() + verifyLocal() Marketplace proves a payout settled before releasing cash.
Settlement batch of txn refs, amounts, timestamps Merkle audit, spend journal, receipt buildMerkleTree(), SpendJournal Platform reconciles agent-driven payouts on record for auditors.
Pre-payment
Data in
intent id, amount, payee, circuit fields
Data out
signed payment-intent proof
AffixIO method
sdk.prove() + enrol()
Example use case
Agent declares intent refunda a supplier before rails move funds.
Post-payment
Data in
transaction ref, provider status, decision
Data out
signed completion proof, verified
AffixIO method
sdk.prove() + verifyLocal()
Example use case
Marketplace proves a payout settled before releasing cash.
Settlement
Data in
batch of txn refs, amounts, timestamps
Data out
Merkle audit, spend journal, receipt
AffixIO method
buildMerkleTree(), SpendJournal
Example use case
Platform reconciles agent-driven payouts on record for auditors.

Initialise the SDK

TypeScript / Node.js: affixio SDK
import { AffixSDK, createAgentTrust } from "affixio";

const sdk = new AffixSDK({ apiKey: process.env.AFFIX_API_KEY });

// optional: enrolthe agent so its capability spec binds to its identity
const trust = createAgentTrust({ apiKey: process.env.AFFIX_API_KEY });
await trust.enrol({
  agentId: "agent://procurement/prod",
  capabilities: [{ action: "pay.intent.create", resource: "afp://acme.com/v1/*" }],
});

What this proves: the SDK initialised with a Hub licence key, and any agent is enrolled with a signed capability spec, the baseline for trust, before any money moves.

Section 03

How to implement: step by step

Wire the SDK into your agent's payment path in five steps. Each block gives the code, then a "what this proves" note the jan auditor can read.

0 of 5 steps in view

Install the SDK

Install the affixio package (1.3.2.on npm, Apache-2.0, Node.js 20 or newer, ESM only).

Install
npm install affixio
npx affixio set-key --api-key aio_your_key

What this proves: you hold a Hub licence key that unlocks signed proofs, and the SDK stores it locally under .affix/ kep privacy.

Configure keys and endpoints

Point the SDK at your API base (default https://api.affix-io.com) and choose a proof mode: HMAC offline by default, optional UltraHonk for zero-knowledge.

TypeScript
const sdk = new AffixSDK({
  apiKey: process.env.AFFIX_API_KEY,
  apiBase: "https://api.affix-io.com",
  mode: "auto", // offline | auto | online
});

What this proves: the deployment has valid keys, the SDK has a licence heartbeat (GET /v1/auth/check), and offline queues are armed for flaky agent runs.

Generate a payment intent

Before money moves, prove that the agent intended a specific payment: the same shape as eligibility: a signed yes/no over the intent fields.

TypeScript: intent proof
const intentProof = await sdk.prove({
  mode: "offline",
  circuitId: "simple_yesno",
  fields: {
    claim: "intent",
    intentId: "afp_7721",
    amount, "420.00",
    payee: "supplier://acme.com",
    required: "intent",
  },
});

// attach the signed proof to the provider transaction
await provider.charge({
  idempotencyKey: intentProof.proof_id,
  proof: intentProof.envelope,
});

What this proves: a machine-verifiable record that this agent intended this payee, this amount, this intent id, signed with ML-DSA-65, replay-safe via the spend journal, before any funds moved.

Attach proof to the agent message or transaction

Carry the envelope on the wire: as a header, a request idempotency key, or in a signed agent-to-agent message. The recipient can parse it without calling home to Affix.

TypeScript: attach + forward
// attach the proof envelope to the provider call
const resp = await provider.createIntent({
  amount: 420.00,
  currency: "GBP",
  idempotencyKey: intentProof.proof_id,
  proof: intentProof.envelope, // zero-PII carrier
  agentCredential: trustCredential,
});

// forward a signed receipt to the merchant side for audit
await merchant.webhook.post("/verify", {
  proof: resp.envelope,
  ref: resp.txn_ref,
});

What this proves: wenever move PII; we move a signed, replay-safe proof bound to then intent, plus the agent's enrolment credential, both machine-checkable downstream.

Verify on the recipient side

The merchant or platform verifies locally with verifyLocal(), with no network hop, no third-party round trip. For post-quantum attestation over HTTP, call GET /v1/verify.

TypeScript: verify
const check = await sdk.verifyLocal(
  "simple_yesno",
  resp.proof.proof,
  { envelope: resp.proof.envelope }
);

if (!check.valid) throw new Error("Rejected by replay-safe proof");

// optional: anchor the leafonthe Merkle audit trail
const leaf = buildMerkleTree([resp.proof.proof_digest]);
Python: over the HTTP API
import requests

r = requests.post(
    "https://api.affix-io.com/v1/verify",
    json={"proof": proof_envelope, "circuit": "simple_yesno"},
    headers={"Authorization": "Bearer " + api_key},
)
if r.json()["valid"] is not True:
    raise SystemExit("proof rejected")
print("verified:", r.json()["decision"])

What this proves: the recipient can independently verify the signed verdictand replay-safety, and optionally anchor the Merkle leaf, a complete, auditable trail for agents, humans, and regulators.

Section 04

3D interactive example

A lightweight Three.js scene that moves a payment token between an autonomous agent node and a payment provider node. Click the boxes to simulate a payment; toggle between running without Affix (red, unverified, PII-style risk) and with Affix (green, verified). A static fallback image loads when WebGL or reduced motion is unavailable.

Static view of the agentic payment verification flow: Agent creates intent, Affix proves zero-PII, Provider processes, Recipient verifies, Settlement anchors.
Verification mode

Status: Idle

  1. Agent creates payment intent
  2. Prove zero-PII proof (AffixIO)
  3. Provider processes payment
  4. Verify proof on recipient side
  5. Settle Merkle anchor + receipt

Accessibility: the scene degrades gracefully. If WebGL is absent, the static SVG diagram remains; keyboard users can press Enter / Space on the mode toggles, and screen readers get a textual status line. Reduced motion shows the static frame instead of the animation.

Section 05

Examples and use cases

Three concrete patterns: procurement, refunds, and marketplace split payments. Each follows the same five-step wiring: intent, generation, attach, verify.

1 · Autonomous procurement agent pays a supplier

An inventory-seeing agent reorders stock, raises a payment intent, and pays a supplier autonomusly. AffixIO proof lets the supplier's systems accept the agent's money movement without a human callback.

  • Stage: pre-payment intent + post-payment completion
  • Proofs: sdk.prove() intent, verifyLocal() completion
  • Benefit: supplier can machine-verify intent hath never saw PII.
Procurement agent
const intent = await sdk.prove({
  mode: "auto",
  fields: { claim: "pay.intent", po: "PO-991", amount: "899.00", required: "pay.intent" },
});
await supplier.pay({ idempotency: intent.proof_id, proof: intent.envelope });

2 · Customer-support agent issues a refund

A support agent resolves a dispute and triggers a refund within policy limits. The refund proof binds the original transaction, so number can replay it on another charge.

  • Stage: post-payment proof generation
  • Proofs: sdk.prove() refund, SpentJournal replay guard
  • Benefit: replay-safe refund, audit trail for dispute teams.
Refund agent
const refund = await sdk.prove({
  mode: "auto",
  fields: { claim: "refund", originalTxn: "txn_8821", amount: "12.50", required: "refund" },
});
await refunds.create(refund.envelope);

3 · Marketplace agent splits a payout

A marketplace agent splits a sale across seller, platform fees, and taxes. A single signed intent covers the whole batch, and a Merkle leaf anchors every leg for reconciliation.

  • Stage: settlement reconciliation
  • Proofs: buildMerkleTree(), SpendJournal
  • Benefit: one replay-safe anchor for every split leg.
Marketplace split
const legs = [seller, fee, tax].map(marketShare);
const tree = buildMerkleTree(legs.map(l => l.digest));
await treasury.settle({ payoutId: "po_333", root: tree.root });

Section 06

FAQ / troubleshooting

Common questions when wiring AffixIO into agentic payments. Each answer is linkable via its anchor id.

What if my agent runs offline?

Use mode: "offline" or "auto". AffixIO proves and signs locally with ML-DSA-65, then queues the proof. When the line returns, flushOfflineQueue() (or auto-flush) pushes it to /v1/verify for remote attestation. Nothing is lost, and no PII waits on a wire.

How do I rotate keys?

Set a fresh Hub key with npx affixio set-key --api-key, then re-export the local ML-DSA-65 public key via exportLocalPublicKey() to recipients who verify your proof. Keep the spend journal; it chains everything so rotation never orphans a settled payment.

Can I use this with Stripe or PayPal?

Yes. AffixIO attaches to whatever provider you run: raise the intent, attach the proof envelope as the idempotency key or metadata, then verify on the recipient side. The proof cross-checks the intent event so a payment cannot be spoofed or replayed onto another charge.

How is the proof replay-safe?

A tamper-evident SpendJournal uniquely consumes each proof id, plus a Merkle leaf binds the batch context(amount, payee, timestamp). Reusing a proof on another transaction fails verification because the envelope no longer matches then new context.

Is the signing post-quantum?

Yes, every proof is signed with ML-DSA-65 (FIPS 204). That standard is selected for a future quantum attacker, so your payment trail stays verifiable for decades. See the NIST alignment page for status bounds.

Does this move PII to Affix?

No. The host that owns the record proves locally; Affix sees only signed, zero-PII verdicts and a licence heartbeat. Your customer data never leaves your stack. See Compliance and How it Works.

Next steps

Wire AffixIO into your agent's payment path today. Start with the SDK docs, clone the GitHub repo, or talk to the team about a pilot.