The problem
AI agents are increasingly allowed to initiate commerce actions, but a confident sentence is not payment evidence. If an agent says “payment completed” and an automated merchant workflow immediately ships goods, provisions access, or triggers downstream work, a false-success story can become a real business loss.
Commerce Flight Recorder asks one question: what actually happened after the agent said the money moved?
How it works
- Preserve the agent claim. CFR keeps the agent’s message as evidence, never as authority.
- Read PayPal independently. CFR retrieves the PayPal Sandbox order and independently looks up the capture rather than trusting the agent’s narrative or a success screen.
- Correlate signed asynchronous evidence. CFR verifies PayPal webhook signatures, stores receipts once, integrity-checks them, and attaches them only to the matching order/capture.
- Reconcile deterministically. The product checks order ID, capture ID, amount, currency, provider state, evidence freshness/trust, duplicate/replay conditions, and adverse evidence. It fails closed on malformed, stale, conflicting, duplicate, or untrusted evidence.
- Make the merchant consequence explicit. Unsupported payment claims become a fulfillment hold. Matching completed evidence becomes a narrow payment confirmation while still warning that refunds, disputes, reversals, and non-payment fulfillment checks remain outside the claim.
- Seal the flight record. Each verification becomes a SHA-256 sealed evidence record with chain-integrity checks.
- Let AI navigate evidence, not author truth. A local Ollama model routes the operator’s plain-language question to an evidence focus. The factual answer is assembled deterministically from the sealed record, and AI cannot override the verdict or call PayPal.
The memorable demo
The demo shows the same confident agent statement against two different PayPal realities.
Before capture: the agent says the payment completed, but PayPal reports PAYER_ACTION_REQUIRED and there is no capture. CFR returns DIVERGENCE and recommends holding fulfillment.
After capture: a separate certified sandbox record shows the PayPal order COMPLETED, an independently retrieved capture COMPLETED, and one verified PayPal-signed PAYMENT.CAPTURE.COMPLETED webhook receipt correlated to the payment. CFR returns CONFIRMED.
The point is not that an AI agent needs another pre-payment permission layer. The point is that after an agent acts, a merchant still needs independent runtime truth before treating the agent’s story as operational fact.
Why it is different
Many agent-payment safety systems focus on what happens before money moves: spending limits, approvals, allowlists, policy engines, or payment firewalls.
Commerce Flight Recorder focuses on post-action runtime truth.
Pre-payment controls ask whether an agent is allowed to pay. Commerce Flight Recorder asks what actually happened after the agent says it paid — and whether PayPal evidence supports acting on that claim.
CFR combines agent-claim preservation, independent PayPal order/capture readback, transaction-bound signed-webhook evidence, deterministic reconciliation, sealed evidence records, and bounded AI evidence navigation in one merchant-facing workflow.
PayPal implementation
The prototype is hard-locked to the PayPal free Sandbox environment. Production PayPal endpoints are not configurable.
PayPal capabilities used:
- Orders v2 — create/read sandbox orders and authoritative order state
- Payments v2 — independent capture lookup and capture state
- PayPal-Request-Id — stable bounded request IDs for create/capture idempotency
- Webhooks — signature verification, transaction correlation, deduplication, replay-conflict detection, and persisted-receipt integrity checks
No real funds are used.
AI implementation
The in-product evidence analyst runs locally through Ollama using llama3.2:3b by default.
The model receives only the operator’s bounded question and classifies which evidence the operator is asking about. It has no PayPal credentials, no payment tools, and no authority to change the deterministic verdict. If the model is unavailable or returns malformed routing output, CFR falls back to a deterministic evidence explanation.
OpenAI ChatGPT was used as a development assistant during the hackathon for architecture review, code/test iteration, release QA, and submission preparation. It is not a runtime payment authority inside CFR.
Reliability and judge access
The release passes 61/61 deterministic tests. Coverage includes completed and non-completed capture states, uncaptured orders, amount/currency/identifier mismatches, duplicate captures, stale or malformed evidence, provider failures, sandbox endpoint isolation, signed-webhook verification, event correlation, duplicate webhook redelivery, replay conflicts, persisted-event tampering, unrelated-event isolation, evidence-chain integrity, bounded AI routing, and rejection of model-authored factual payment answers.
Judges can run a credential-free, read-only replay from the public repository. It contains certified PayPal Sandbox observations for the false-success divergence and the webhook-backed confirmed case. The replay performs no live PayPal call and exposes no payment-write capability.
A separate documented path allows fresh sandbox reproduction using the judge’s own PayPal Sandbox credentials.
Boundaries
- PayPal Sandbox only; no real money
- Local single-user prototype, not a production payment processor or compliance product
- One purchase unit and one full capture in the current demo contract
- Point-in-time payment evidence does not guarantee against future refunds, disputes, reversals, or other fulfillment risks
- Hash chaining is an integrity mechanism, not a blockchain or external notarization service
- AI helps navigate evidence; it never becomes payment authority
Closing idea
Don’t ship on a sentence. Ship on evidence.
Built With
- javascript
- llama-3.2-3b
- node.js
- ollama
- openai-chatgpt
- paypal-orders-v2
- paypal-payments-v2
- paypal-webhooks
- sha-256