Inspiration
AI agents are starting to spend real money, but nobody checks what they're about to buy. Sellers can stuff carts with upsells, and hidden instructions on a product page can steer an agent away from its owner's intent. Fraud tools ask "bot or human?" but not "is this agent still acting for its owner, or has it been manipulated?" IntentGuard is a checkpoint between an agent's decision and the moment money moves.
What it does
IntentGuard verifies autonomous purchases before they become real PayPal orders.
- The user writes a plain-language mandate: a goal, a budget, and constraints.
- An Actor agent researches products, either in our demo stores or in live product data from Channel3, and proposes an order with evidence for each item.
- An independent Supervisor agent checks each item against the mandate, requires necessity to be backed by independent sources rather than seller claims, and quarantines evidence containing prompt injections.
- Every item gets ALLOW, BLOCK, or REVIEW. Only allowed items reach a deterministic Payment Executor, which creates a PayPal Sandbox order and never captures payment.
When the verdict is BLOCK or REVIEW, no PayPal API call is ever made. An evidence timeline in the UI makes every decision explainable.
How we built it
- App: Next.js, React, and Tailwind, with no chat interface
- Agents: OpenAI Agents SDK (TypeScript) running Qwen models: Qwen3.8-27B as the Actor (read-only catalog access, no payment access) and qwen3.8-flash-next as the Supervisor (no network or payment tools). Both return Zod-validated structured output.
- Product data: Channel3 Search and Product Detail APIs for real products. Channel3 is treated as an untrusted aggregator, never as independent proof of necessity.
- Policy engine: deterministic checks (budget, allowlists, hashes, publisher-independence graph) plus an LLM semantic layer that can never override critical findings
- Payments: a pure-TypeScript Approval Builder and Executor. The Executor is the only component holding PayPal credentials and calls PayPal OAuth 2.0 and Orders v2 with
PayPal-Request-Ididempotency keys. - Data and tests: Prisma + SQLite, Vitest, Playwright
- Demo: four local stores (one with a hidden prompt injection), plus a replay mode that runs fully offline
Challenges we ran into
- Judgment without hardcoding: the Supervisor derives necessity from the mandate and evidence, not keyword rules. Renaming the upsell or switching product domains doesn't change the verdict.
- Trust boundaries: Actor output is untrusted but feeds a payment path. We used strict schemas, a trusted evidence layer, and an approval hash the Executor re-verifies.
- Exactly-once payments: DB constraints, in-flight leases, and PayPal idempotency keys, stress-tested with parallel retries.
- Real-world data: live Channel3 prices and availability can change mid-run, so selected offers are revalidated before the verdict. If anything fails, the run stops with a readable error instead of silently falling back.
- Safe manipulation demos: controlled local stores instead of attacking the live web.
Accomplishments that we're proud of
- Zero PayPal calls on BLOCK/REVIEW, proven by security tests
- Ten concurrent execute calls produce exactly one PayPal order
- Renamed upsells and products from other domains are still blocked in our tests
- Every blocked item traces back to specific evidence
- A working end-to-end flow from mandate to live Sandbox order, on demo stores and real Channel3 products
What we learned
The hard part of agentic payments is deciding whether to pay, not calling the API. LLMs are great at semantic judgment but poor trust boundaries, so we use LLMs for judgment and deterministic code for authority. Source independence is a graph problem: two URLs from one publisher count as one source, and an aggregator is not an independent source at all.
What's next for IntentGuard
- Capture, refunds, and disputes via PayPal webhooks
- Human-in-the-loop resolution for REVIEW verdicts
- AP2 mandates and multi-currency support
- A publisher reputation graph across runs
- A standard pre-transaction checkpoint for agents spending on PayPal rails
