Inspiration

Small merchants should not have to choose between manually watching stock and giving an AI unrestricted access to their money. A supplier's message can contain a prompt injection, an inflated price or a changed payment address. I wanted an agent that could help run a store while keeping spending authority with the merchant.

What it does

GuardBuy monitors Shopify inventory and sales, estimates days of stock cover, and proposes supplier purchases when stock runs low. The AI recommends a supplier and quantity; a deterministic policy engine checks the proposal against rules signed by the merchant.

Purchases that pass every check can be paid automatically through PayPal Payouts. Flagged purchases wait for explicit approval in GuardBuy or through PayPal Orders. Checks cover spending limits, cash reserves, approved suppliers, price changes, unusual quantities and purchases split across a 24-hour window.

The Home workspace uses AG Grid, AG Charts and AG Studio to connect inventory, purchasing power, supplier comparisons and purchase history. A read-only assistant helps merchants explore the data without authorizing payments. Deliveries tracks incoming stock and records received goods back into Shopify. Optional Telegram alerts bring unresolved issues to the merchant.

How we built it

I built the embedded Shopify app with TypeScript, React and React Router, backed by PostgreSQL and Prisma. Shopify inventory webhooks create durable restock jobs, and order events update sales history. The proposer uses AI SDK model providers with fallback support.

PayPal Payouts handles supplier payments; PayPal Orders supports merchant approval in PayPal. The PayPal Agent Toolkit provides order and transaction lookups for reconciliation. Verified payout webhooks update recorded payment outcomes.

Before a payment request is sent, GuardBuy records its route, amount, payee and request identity. Database leases coordinate concurrent workers. A hash-chained, append-only audit log connects proposals, policy decisions, approvals and payment evidence, with a public verification page that limits disclosed information.

Challenges we ran into

The hardest problem was uncertainty: a timed-out payment request might already have succeeded. Retrying it as a new purchase could pay twice. GuardBuy preserves the original request identity, keeps uncertain amounts reserved, and separates payment submission from confirmed settlement.

Another challenge was making safety understandable. Merchants need to know why a purchase stopped, how pending payments affect their budget, and why repeated small purchases can still require approval. Live data updates, expandable purchase details and specific policy explanations make those decisions easier to follow.

Accomplishments that we're proud of

The app connects a real Shopify development store to PayPal payment flows, from a stock change through proposal, policy review, payment and delivery tracking. The safety controls sit outside the language model, and the assistant cannot use its analysis tools to send money.

Automated tests cover payment races, retries, uncertain outcomes, stock receipts, account binding and audit integrity. The deployment guide gives judges and their agents a path to create their own isolated instance and test the flows.

What we learned

Reliable financial agents need more than a good prompt. They need explicit authority, durable state and a clear distinction between what was requested, what was submitted and what a provider actually confirmed. Interface design is part of that reliability: a pending payment must never look like a completed purchase or a fresh approval request.

What's next for GuardBuy

publishing in the App Store

Built With

Share this project:

Updates

Submission history