ANIMA: The model can propose. It cannot authorize a payment.
Inspiration
An invoice for 12 EUR contains a hidden instruction asking an AI agent to pay 999 EUR instead.
In a chat, that is a prompt injection. In a payment workflow, it becomes a question of authority. If the model reads something malicious, who can still say no? And how can anyone check what actually happened?
We built ANIMA to answer those questions. The goal is not to promise that a model will never make a mistake. It is to keep a model's recommendation separate from permission to spend.
What it does
ANIMA sits between AI agents and PayPal Sandbox. An agent may recommend a payment. It does not get to authorize one.
Three controls stay outside the model:
- A human-defined mandate specifies approved payees, amounts, currencies, actions, time limits and other constraints.
- The payer approves the authorization in PayPal's own checkout flow when the payment requires payer approval.
- A human releases the capture, unless an existing human-signed, valid and narrowly scoped grant authorizes that particular case.
If the model or the mandate refuses, ANIMA records the refusal before calling PayPal. If a provider never receives a request, or receives one but does not answer, the receipt says so. We do not turn missing evidence into an invented success or refusal.
Every decision leaves evidence. The ledger uses a SHA-256 hash chain, Ed25519 signatures and a separately signed head. In the browser, you can pin the head, change a single cent, truncate the record or swap the signing key. ANIMA shows exactly which verification failed.
How we built it
We use TypeScript and Node.js 24, PayPal Sandbox Orders v2 and Payments v2, PayPal's agent toolkit through MCP, and Claude Haiku for three bounded advisory roles: proposer, challenger and verifier.
Those model calls can make a recommendation stricter. They cannot open a payment gate that the deterministic code has closed.
The PayPal tool firewall separates reads, money-changing actions, outreach, destructive operations and setup tools. Unknown tools fail closed. We also use session limits, idempotent requests and explicit fallback labels. AG Grid helps inspect the receipt ledger; the interface remains usable as a simpler list if AG Grid cannot load. Render hosts the public demonstration.
We found real problems while testing. A missing return URL broke payer approval. A restart caused an invoice ID collision. A provider error arrived inside a response that looked successful. And a malicious invoice exposed an overly broad autonomy rule. We changed the code and added regression tests rather than hiding those failures.
There is a limited earned-autonomy mechanism, but the model cannot award itself authority. Three clean, sealed payments may justify proposing a narrow grant. Only a human-signed grant can activate it. Grants expire, can be revoked and lose their margin after an anomaly.
What we can prove, and what we cannot
On November 6, 2026, the author used a PayPal Sandbox buyer account to approve and capture a 29.00 EUR test payment. The resulting capture was checked against PayPal. This was test money, operated by the author, not a live-money payment or an independent buyer study.
The 1 minute 48 second film shows a real browser recording of a locally simulated ANIMA session. A manipulated invoice is refused before a PayPal call, and a one-cent change breaks the receipt chain. It does not depict another real PayPal transaction. Explanatory diagrams are not presented as provider evidence.
The public jury repository passed 228 Node tests before publication. That is evidence about the tested code, not proof that a separate real customer has completed a payment.
Try it yourself
- Open the demo: https://anima-demo.onrender.com/ . The free host may need a moment to wake.
- Run the poisoned-invoice scene. The expected outcome is a sealed refusal before any PayPal call.
- Open the receipt section called "Don't trust us. Break it". Pin the signed head, change the amount by one cent and check for CHAIN_BROKEN (HASH). Try truncating the ledger or changing the signing key.
- Inspect the PayPal tool controls and chaos lab. If an upstream service is unavailable, a locally simulated response is explicitly labelled, never passed off as a provider result.
- Read the code, setup instructions and evidence: https://github.com/monkidy/anima-pay . License: Apache-2.0.
Watch the 1:48 film: https://youtu.be/oL7rhgv05do
What comes next
We still want an independent buyer test, signed PayPal webhook reconciliation and a signed-head checkpoint stored outside the service. Those are open work, not completed claims.
Credits and disclosures
Created by Hichem Benali with SYSTASYS. Asso helped shape the demonstration and explanation. Claude Code assisted implementation and testing; ChatGPT assisted review and submission preparation. Claude Haiku is used for bounded model advice.
PayPal Sandbox only. No real money. The film identifies local simulation; English narration is synthetic and the music is original. Mentioning PayPal or other technology providers does not imply sponsorship, certification or endorsement.
Built With
- ed25519
- render
- typescript
- webcrypto
