-
-
LIVE sandbox (test money), real local AI — E2: tea bags captured for US$11.50. The manual selector shows an earlier denial cart.
-
LIVE sandbox (test money), real local AI — E2: US$11.50 captured and refunded. Totals show the refund; final rows are offscreen.
-
LIVE sandbox (test money), fixture AI/manual policy — E1: US$7.50 captured and refunded. Totals show the refund; final rows are offscreen.
Inspiration
An AI purchasing assistant needs spending rules an owner can inspect before money moves. SpendingMandates, called mandate ledger in the UI, pairs an owner-reviewed mandate with a transactional budget ledger. The design separates an AI suggestion, permission to spend, and confirmation that a payment actually happened.
What it does
The owner reviews and signs a versioned spending mandate. The server checks categories, merchant, currency, quantities, order limits, expiry and weekly allowance against trusted data before permitting checkout. Reservations share the owner's weekly budget; replacing a mandate does not reset that allowance.
Local qwen3:8b through Ollama, with thinking off, performs only narrow tasks: extracting four monetary limits and allowed/denied categories into an unsigned draft, and choosing a SKU and quantity from five trusted catalogue choices. Other terms start from server defaults. The owner reviews the exact terms before signing; the server checks the signed policy and owner confirmation before creating a new payment.
In this native local mode, untrusted merchant text never reaches the model. That is input exclusion; it does not establish model resistance to prompt injection. A proposal alone creates neither a reservation nor a payment.
How we built it
TypeScript, Node.js/Hono, SQLite, Zod and a React/Vite console support the policy and ledger. PayPal is central to the payment flow: Orders v2 and Payments v2, sandbox only, handle buyer-approved orders, capture and refund. Orders bind to the configured seller. Authenticated read-only GET requests confirm provider state, including settlement and completed refunds. The localhost-only app uses GET reconciliation without inbound PayPal webhooks. All transactions use test money.
The project was started for this hackathon; per the owner, no part of it existed before October 1, 2026. An earlier prototype from this hackathon period contained policy enforcement, reservations, a ledger, console source and simulated integrations. Significant November 9–10 work within the hackathon window added real sandbox transport, merchant-bound checkout, local inference, strict evaluations, browser journeys, refund correlation and durable diagnostics.
The code was written with AI coding assistance from Claude and OpenAI Codex agents under human direction. Assistance covered specification, implementation, regression work and review; an exhaustive model-by-role attribution is not established.
Challenges
Provider success and acceptance-script success can disagree. An earlier standalone script run recorded INCOMPLETE even though later provider reads confirmed capture and refund. Subsequent work diagnosed and fixed refund response-shape and correlation defects; the exact historical exception was not retained. A later standalone run passed. We preserve the earlier verdict rather than retroactively changing it.
Accomplishments
The recorded sandbox results are:
- App with fixture AI/manual policy: US$7.50 captured and refunded. Here, fixture AI means handwritten responses, not live inference.
- App with real local AI: the model proposed one pack of tea bags, US$11.50 including shipping; it was captured and refunded. A US$55 over-limit attempt was denied with no reservation or ledger change.
- Standalone acceptance script: US$1 captured and refunded, PASS, including approval, capture settlement and refund checks. This tests transport separately from the app ledger.
Real local AI also achieved a later strict 270/270 evaluation result with simulated payments. These are recorded results on measured code, not a claim that later documentation or release packaging received another live run.
What we learned
A browser redirect or local ledger label cannot confirm payment. Refunds must match the intended capture, amount and currency. Unknown outcomes need retained identifiers and reconciliation. AI quality, provider state and application acceptance each require their own evidence.
What's next
Next steps are to live-test restart recovery and cancellation, and verify setup on a fresh judge machine. Broader hardware qualification would make the local inference requirements clearer.
Limitations
An earlier AI evaluation scored 269/270 before the later strict 270/270; its timeout remains a failure. Restart mid-flow and the cancel path were not live-tested. The demo video omits the buyer's Safari approval interval and uses one labelled fixture inset for the denial screen; that inset is a different cart, not the live denial display.
The catalogue is synthetic, USD-only and bound to one seller. A signed mandate is local application policy; fresh PayPal checkout still requires buyer approval. Local inference needs about 5.2 GB for the model plus overhead and a capable machine. Testing observed an Apple M-series machine with 32 GB; lower hardware requirements are unverified.
Try it locally
See the README at https://github.com/Jo2234/hackathon-2026-paypal-ai for exact Node/pnpm versions, installation and startup, plus Ollama and qwen3:8b setup. Sandbox testing uses a free PayPal developer sandbox account with the judge's own credentials in a private environment file; regional onboarding remains unverified. Fixture mode runs without credentials and simulates both AI responses and payments. Local AI can also run with fixture payments. Watch the demo: https://youtu.be/r5TOW9XuBjE.