What it does

PayGuard Agent autonomously works through a queue of invoice and bill payment requests. For each request, an explainable AI "brain" decides PAY, SKIP or ESCALATE — scoring the request on necessity, vendor trust, and price fairness against a per-category reference price, and detecting duplicate invoices. Every decision carries a confidence score and a one-sentence human-readable reason.

Before any money moves, a separate RiskGuard independently re-checks the payment and can VETO the brain: a $500 per-transaction cap, a $1,000 daily spend cap with a kill switch that halts the agent, a payee allowlist, a minimum-confidence floor, and a duplicate-payment veto.

Approved payments execute through PayPal (Orders API v2: create order, then capture, on the PayPal Sandbox), and each one is recorded as a signed payment intent in a hash-chained, tamper-evident receipt log — so the full history of what the agent paid, and why, can be audited and any tampering detected.

Demo run

Demo run (deterministic, offline): 12 requests, 6 payments executed ($303.00), 6 stopped — a duplicate invoice, a quote at 2.25x the reference price, an untrusted vendor, a $900 purchase vetoed by the per-transaction cap, a low-confidence escalation, and a non-allowlisted payee. Audit chain valid, 10/10 tests passing.

How it uses PayPal and AI

How it uses PayPal and AI: PayPal is the payment rail, not a logo — payments execute via a PayPalSandboxClient implementing the real Orders API v2 flow (OAuth, create order, capture) against the PayPal Sandbox; receipts carry the PayPal order IDs and capture statuses. With sandbox credentials in the environment the same code runs against the live sandbox API; with none it falls back to a deterministic mock transport so anyone can run the demo. The AI is the decision layer: a transparent scoring model (necessity, vendor trust, price fairness, duplicate detection) chosen deliberately over a black box, because an agent that spends money must explain every decision in one sentence. The component that wants to pay is never the component that gets the final say.

How I built it

Tech: Python 3, standard library only — zero dependencies. HMAC-signed payment intents plus a SHA-256 hash-chained receipt log. The architecture reuses the brain-vs-guard pattern from the builder's Horizon Agent (HashKey Chain Horizon Hackathon), re-targeted from signed trade intents to signed payment intents over PayPal; all PayPal-specific code is new for this hackathon.

Honesty note

Honesty note: sandbox/simulation only — deterministic scenario data, mock PayPal transport by default, no real money moved, no real credentials used. Receipts record which mode ran (SANDBOX_SIMULATED vs SANDBOX_API).

Built With

Share this project:

Updates

Submission history