Inspiration

It started with a simple frustration: waiting weeks for a price drop on expensive hardware, only to miss the flash sale because it dropped at midnight while I was asleep. The obvious fix was to spin up an autonomous AI shopping agent to watch live product catalogs and hunt web coupons 24/7, buying the item automatically the second the price hit my target limit.

The moment we connected a real PayPal account to an autonomous agent, three critical problems showed up right away: First, unbounded wallet risk. You cannot hand an AI agent full authority over your primary PayPal balance and go to sleep. A single hallucination, bug, or prompt injection on a rogue site can drain your account. Second, storefront and coupon fine-print traps. When an AI hunts for the lowest price, stores can easily trick it. A 70 USD promo code looks like a great deal until the checkout fine print quietly flips the return policy from 30-day free returns to a 0-day Final Sale with no refunds, swaps in a refurbished unit instead of a brand-new one, or adds a 55 USD shipping fee right after payment authorization. Third, post-purchase seller policy changes. Even when checkout looks clean, a seller can quietly edit their website two weeks later, changing free 30-day returns to a 25 percent restocking fee, leaving the buyer fighting a PayPal dispute with screenshots instead of real proof. We built VeriPact to turn PayPal from a simple checkout button into an active cryptographic clearinghouse and programmable safety wall for autonomous AI shopping.

What it does

VeriPact sits between autonomous shopping agents (across our Web Studio, CLI, ChatGPT Actions, and Claude or Cursor MCP) and the PayPal platform to enforce strict budget limits, pre-purchase store verification, and automatic post-purchase dispute resolution.

1-Step PayPal Vault and Partitioned Task Budgets: Instead of exposing an entire wallet, users connect their PayPal Vault in one click and set a Master Agentic Budget, such as 350 USD. From that master limit, users carve out isolated budget slices for specific shopping tasks, such as 190 USD for a 4K monitor watcher, 100 USD for wireless headphones, and 30 USD for a mechanical keyboard. Even if an agent fails or gets tricked, it cannot spend a single cent past its assigned slice.

Multi-Store and Live Web Coupon Hunter: Given a plain-English request or any live store URL, VeriPact scans merchant pages and promo codes across stores. It automatically blocks prompt-injection scams, catches refurbished items pretending to be brand new via the Channel3 catalog, and rejects promo codes that secretly void the buyer's 30-day return policy.

Pre-Capture Surcharge Auto-Void: If a merchant shipping update pushes the final price over the buyer's budget cap after authorization, VeriPact automatically voids the PayPal authorization hold before any money leaves the account.

24/7 Background Price-Watcher Daemon: Sleeping background agents are saved in Neon Serverless Postgres, polling product catalogs every 15 seconds and listening for real-time price-drop webhooks. When a 149 USD pair of headphones drops to 100 USD all-in at 3:00 AM, the background agent wakes up on the server, verifies that the 30-day return policy is still intact, and completes the purchase through PayPal Vault with zero human clicks.

Tamper-Proof Proof Inside PayPal: Before any purchase settles, VeriPact creates a 68-character SHA-256 cryptographic fingerprint (VP1 commitment) of the exact price, item condition, and return policy promised on the store page, and stamps that proof directly inside the PayPal Order custom_id field.

Automated Dispute Referee and Payment Sync: Using AG Grid, VeriPact syncs historical PayPal transactions (comparing legacy unprotected orders against VeriPact-protected orders) and resolves contested PayPal disputes in seconds by comparing the seller's claim against the immutable VP1 proof stored inside PayPal's own order record.

How we built it

VeriPact is built as an 8-package TypeScript monorepo (core, term-extractor, witness-client, paypal-client, sdk, cli, mcp-server, and workbench) deployed on Vercel with Neon Serverless Postgres.

  1. Three-Rung Verification Pipeline (SELF to WIT to SIGN): Every transaction must pass three independent checks before settlement. First, the Buyer Mandate (SELF) signs the user's rules (maximum all-in price, brand-new condition, minimum 30-day returns, and 0 percent restocking fee) using an Ed25519 key. Second, the Independent Witness (WIT) fetches the live store HTML, runs a 13-rule DOM scanner to catch hidden text or prompt injections, cross-checks the product condition and reference price against the Channel3 catalog, confirms that applied coupons did not strip the return policy, and attaches an RFC 3161 trusted timestamp. Third, the PayPal Settlement Anchor (SIGN) canonicalizes the receipt using RFC 8785 and stamps the resulting VP1 hash directly into the PayPal Orders v2 custom_id field.

  2. PayPal Developer Platform Integration: We integrated five core PayPal Sandbox APIs: Orders v2 (create, patch, authorize, and capture with custom_id commitment anchoring), Payments v2 Authorizations Void (automatic pre-capture hold cancellation on shipping surcharges), Payment Method Tokens v3 (PayPal Vault pairing and partitioned agentic budgets), Customer Disputes v1 (automated evidence submission and adjudication), and Transaction Search v1 (syncing and classifying historical orders).

  3. Sponsor and AI Tools: We used the APIMatic PayPal API Context plugin to build our TypeScript PayPal client against exact request and response schemas and HATEOAS state transitions. We integrated Channel3 as our product catalog oracle to verify item conditions and baseline pricing. We used AG Grid v31 to power our Live Contested Disputes table, our 72-run Regression Benchmark view, and our Orders Sync table. For natural-language understanding, we paired a fast deterministic catalog parser with Google Gemini 2.5 Flash to parse shopping requests and discover candidate promo codes, alongside a Model Context Protocol (MCP) server for Claude and Cursor agents.

Challenges we ran into

Simplifying the Interface into a Clean Monochrome Product: Early versions of our dashboard showed too much developer telemetry, uneven multi-column cards, and visual clutter. We redesigned the entire interface into modular components with a clean carbon-and-zinc monochrome theme, equal-height 2-card rows, uniform 36px buttons, and on-demand proof dialogs so the main screen stays simple and fast to use. Running File-Locked Ledgers and Background Pollers on Vercel: Adapting a stateful clearing ledger and background price poller to run on Vercel's read-only serverless environment required building an automatic temporary filesystem fallback paired with non-blocking Neon Serverless Postgres synchronization and cron-compatible polling endpoints. Handling Wild External URLs Safely: When building our live URL and coupon hunter, we had to account for client-rendered single-page apps where return policies only appear after JavaScript execution, as well as Server-Side Request Forgery (SSRF) risks. We built a multi-hop SSRF guard that blocks private, loopback, and cloud metadata IP addresses, and configured our verification gate to fail closed whenever return terms cannot be deterministically verified from the page.

Accomplishments that we're proud of

Anchoring Cryptographic Proofs Inside Standard PayPal Orders: We designed a compact 68-character commitment format that fits cleanly inside PayPal's standard 127-character custom_id field, allowing any browser or dispute referee to verify what the merchant promised directly from PayPal's order record without requiring custom database changes on PayPal's side. Catching Real Coupon Fine-Print Traps: Our verification engine reliably catches the exact trap that fools standard AI shopping bots, such as promo codes that lower the price by 70 USD while quietly changing the return policy in the footer to a 0-day Final Sale. End-to-End Automated Verification: We verified the entire platform with 349 passing unit and integration tests across 19 test suites, 28 passing Playwright end-to-end browser checks across 4 screen sizes, a 60-run multi-agent swarm stress simulation testing concurrent budget limits and adversarial store traps, and a 72-run contested dispute benchmark achieving 100 percent classification accuracy between seller policy drift and buyer receipt tampering.

What we learned

We learned that in autonomous commerce, large language models and deterministic code must have strict separation of duties. AI models like Gemini 2.5 Flash are great at turning messy human requests into structured shopping tasks and discovering candidate promo codes across the web, but an LLM should never have the final say on releasing money. Every AI-discovered deal and coupon must be treated as untrusted until deterministic DOM inspection, catalog verification, and hard PayPal Vault budget limits confirm the purchase is safe.

What's next for VeriPact: Cryptographic Clearinghouse for Agentic PayPal

Browser Extension for Everyday Shoppers: Packaging our verification overlay into a 1-click Chrome and Safari extension so shoppers get automatic coupon-trap detection and VP1 receipt locking on any store checkout. Live PayPal Webhooks and Multi-Currency Partitions: Expanding our background watcher engine to consume live PayPal capture and dispute webhooks directly while supporting multi-currency sub-agent budgets across USD, INR, and EUR. Headless Browser Worker Pool for Dynamic Storefronts: Adding an isolated headless browser worker pool behind our live URL hunter so the witness engine can fully hydrate JavaScript-heavy merchant storefronts before running the 13-rule DOM scan.

Built With

Share this project:

Updates

Submission history