Inspiration

We are a team driven by curiosity, innovation, and the ambition to represent Algeria on a global stage. Inspired by the growing intersection of Artificial Intelligence and digital payments, we joined the PayPal AI Hackathon to explore how intelligent technology can reshape the future of financial experiences.

What it does

HASFАF aims to develop an innovative solution that combines Artificial Intelligence with PayPal's payment ecosystem to make digital financial experiences smarter, simpler, and more accessible.

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for ح.ص.ف.ف

Warden is a firewall between an AI shopping agent and a PayPal wallet. Prompt injections and price swaps are blocked in code, and every decision is written to a tamper-evident ledger.

Inspiration

AI shopping agents read untrusted web pages. One hidden instruction in a product description, or one price that changes between the quote and checkout, could drain a wallet. That risk is the main reason businesses won’t give agents a payment method. We wanted to show that an agent can be useful without ever being trusted with money.

What it does

Warden puts a deterministic policy gate between an AI’s proposal and a PayPal Sandbox order.

The Shopper agent has no payment tool. It can only propose a purchase. A Quarantine step extracts just the product name, price and merchant from untrusted product text, so hidden instructions never reach the decision. A Policy Engine (plain code, no LLM) checks the budget cap, merchant allowlist, price drift between quote and live checkout, intent alignment and purchase velocity. It returns one of three outcomes: ALLOW (up to $50), ASK_HUMAN ($50 to $150) or DENY. Only an approved request reaches PayPal. On ALLOW or ASK_HUMAN, the server creates a PayPal Orders v2 order for the live checkout price, never the quoted one. The buyer still gives consent in PayPal’s popup, so Warden’s ALLOW means “permitted”, not “consent skipped”. Every decision, including denials, is appended to a SHA-256 hash-chained ledger. A “Tamper Check” lets a judge change one old row by $1 and watch the chain break at the exact block.

The built-in Attack Lab runs two live attacks: a prompt injection that tries to buy a $499 gift card from an unlisted merchant, and a price drift where a $45 quote becomes $450 at checkout. Both are blocked, and PayPal is never called for them. The PayPal Sandbox Event Logs confirm that.

How we built it Backend: Node.js, Express, and Node’s built-in node:sqlite. PayPal executor: the only module that talks to PayPal. It uses the Orders v2 REST API in the sandbox, with a hostname guard that refuses non-sandbox URLs, a hard amount cap, timeouts, and idempotency keys. [Generated and reviewed with the APIMatic Context Plugin for PayPal.] Payment safety: every payment is stored server-side as an “intent”. The capture route accepts only an intent ID, never a raw order ID from the client. It locks the intent atomically, then re-checks the status and amount with PayPal before capturing. Ledger: append-only, with each entry hashed together with the previous hash. Frontend: React, Vite and AG Grid, with a live ledger, decision badges, and a split-screen Attack Lab.

Challenges we ran into Keeping the LLM out of the money path while still making the agent useful. The answer was to give the agent no payment tool and to size every order from a server-side price check, never from model output. Buyer consent. PayPal needs the buyer to approve before capture, so even auto-approved purchases cannot be fully click-free. We kept the flow honest rather than hiding that step. A sandbox compliance error on capture. Our sandbox accounts hit a PayPal COMPLIANCE_VIOLATION on capture, so the demo shows orders created and buyer-approved. An append-only ledger. Updating a past row breaks the chain by design, so capture outcomes are new entries, not edits.

What’s next Real LLM-based quarantine and intent alignment tuned on a broader attack set. A webhook listener for PAYMENT.CAPTURE.COMPLETED and CHECKOUT.ORDER.APPROVED. Per-user budgets and spend policies. A dispute evidence packet, bundling the prompt, the policy decision, the hash proof and the order ID for PayPal’s dispute process. Live product discovery through a product-search API, with the same untrusted-input handling. Built with

Node.js, Express, node:sqlite, PayPal Orders v2 API (Sandbox), React, Vite, AG Grid, SHA-256, Dual-LLM architecture

Built With

Share this project:

Updates

Submission history