Inspiration
AI shopping agents are becoming increasingly capable of discovering products, comparing options, and initiating purchases. But giving an AI agent the ability to act should not mean giving it unrestricted authority to spend money.
We asked: How can autonomous commerce become useful while keeping users in control of their money?
That question inspired LEASH — The Trust Layer for Agentic Commerce.
What it does
LEASH is an authorization and trust layer between autonomous shopping agents and payment execution.
Users create purchase mandates that define spending budgets, permitted merchants and categories, item limits, and approval requirements.
The AI Shopping Agent searches a simulated product catalogue and proposes purchases. LEASH evaluates each proposal through a deterministic policy engine containing 12 policy rules.
An independent AI Intent Auditor identifies potential inconsistencies and risks. Its output is advisory only: it cannot authorize purchases or override deterministic policy decisions.
Users review the authorization and provide explicit purchase consent separately. The payment executor then handles the PayPal Sandbox workflow when authorization requirements are satisfied.
How we built it
Frontend: React, Vite, JavaScript, custom CSS and Lucide icons.
Backend: Python, FastAPI, Pydantic, SQLite and HTTPX.
AI: Groq API with Qwen for AI-powered shopping and intent auditing. Gemini is retained as an alternative provider.
Payments: PayPal Orders API v2 in Sandbox mode.
Security: HMAC-based authorization controls, single-use approval tokens, owner-bound sessions, idempotent payment handling and a hash-chained audit log.
The architecture separates AI recommendations, deterministic policy evaluation, user consent and payment execution.
Challenges we ran into
One of the main challenges was ensuring that AI-generated recommendations could never become payment authorization.
We addressed this by separating the AI components from the deterministic policy engine and payment executor.
Another challenge was maintaining trustworthy authorization across proposal evaluation, user consent and payment execution. We implemented signed, time-limited approval controls and idempotent payment handling to address these concerns.
Accomplishments that we're proud of
- Built an end-to-end agentic commerce authorization prototype.
- Implemented a deterministic policy engine with 12 rules.
- Separated AI advisory assessment from authorization decisions.
- Integrated PayPal Orders API v2 in Sandbox mode.
- Implemented explicit purchase consent and isolated payment execution.
- Added hash-chained audit events and HMAC-based integrity checkpoints.
What we learned
We learned that building an autonomous agent is only one part of agentic commerce. Trust requires clear permission boundaries, deterministic enforcement, user consent and verifiable execution.
What's next for LEASH
We envision LEASH as a reusable trust and authorization layer for agentic commerce, allowing people to delegate shopping tasks while retaining meaningful control over spending, consent and payments.
LEASH currently uses a simulated product catalogue and PayPal Sandbox. It is a working prototype, not a production-certified financial authorization system.