Inspiration Traditional autopay blindly pulls funds on a schedule, offering no protection against unexpected price spikes, unauthorized fees, or delayed paychecks. We built an AI Mandate Firewall to inspect incoming charges and verify user conditions before funds are debited.

What It Does Users create plain-English spending rules, such as capping Wi-Fi bills at $50 or holding rent until a $1,000 paycheck clears.

Condition Met: Automatically settles via PayPal Vault setup tokens and Orders v2 Capture.

Condition Violated: Instantly freezes the capture, debits $0.00, and triggers a Human-in-the-Loop card to approve an override or file a dispute.

How We Built It Backend & Storage: Python Flask running on Render, with SQLite (autopay.db) managing rules, idempotency, and audit trails.

AI & NLP: Google Gemini 2.5 Flash extracts structured fields (thresholds, operators, payees) from plain text, backed by local deterministic heuristics.

PayPal REST APIs: Integrated OAuth2 tokens, Vault v3 setup tokens, Orders v2 checkout/capture, and webhook signature verification.

Dashboard: A real-time UI featuring an interactive webhook simulator, audit ledger, and mandate management.

Challenges & Accomplishments Lifecycle & Safety: Built strict state guards and idempotency checks to avoid duplicate charges or accidental re-arming on retried webhooks.

Fail-Closed Execution: Ensured the firewall halts transactions before any Orders v2 capture call runs on violating bills.

100% Passing Tests: Verified all 12 production test suites across rule parsing, lifecycle states, and live API traces.

What's Next Adding spending velocity checks (detecting repeated micro-charges within short windows) and direct integrations with accounting and SaaS invoicing platforms.

Built With

Share this project:

Updates

Submission history