Inspiration: Can AI Agents Be Trusted With Money?
As autonomous AI agents begin buying products, calling paid services, and executing transactions online, traditional payment flows break down. Merchants face three unaddressed revenue leaks:
- Card-Testing Bots: Attackers flood checkout endpoints with stolen cards, racking up merchant authorization fees and gateway penalties.
- Unmonetized AI Crawlers: LLM scrapers consume paid APIs and compute bandwidth for free.
- The $15 Dispute Trap: Contesting low-value chargebacks incurs a mandatory $15 non-refundable PayPal dispute fee, making small-claim defense a guaranteed loss.
We built PayShield AI to solve all three as an autonomous pre-transaction trust and monetization layer on PayPal rails.
What It Does
- Risk Radar (<50ms): A calibrated LightGBM model scores incoming transactions before payment clearing. High-risk orders are blocked with mathematical SHAP additivity proof ($|\Delta| < 10^{-4}$) so merchants can justify decisions to banks.
- HTTP 402 (L402) Machine Tollgate: Instead of blocking AI agents, PayShield issues cryptographic challenges. Agents autonomously capture a $0.05 micropayment via PayPal Orders v2 in the sandbox and receive an HMAC-SHA256 bearer token to unlock telemetry.
- Expected Value (EV) Dispute Engine: Autonomously evaluates disputed charges ($P_{\text{win}} \times \text{Amount} > \$15$). It auto-writes off unprofitable claims to avoid fees and automatically compiles tracking, timestamps, and AVS evidence to file winning claims directly to PayPal Disputes v1.
- Append-Only SHA-256 Audit Vault: Every score, token, and dispute decision is cryptographically chained in an immutable audit ledger.
How i Built It
- Machine Learning: LightGBM classifier trained on transaction velocity, geolocation mismatches, and fraud vectors with TreeExplainer SHAP attribution.
- Backend: FastAPI with modular routers for pre-clearing risk scoring, L402 machine payment state machines, and PayPal REST SDK integrations.
- Frontend: React + Tailwind CSS dashboard featuring real-time risk simulation, SHAP waterfall charts, and interactive dispute dossiers.
- Deployment: Single-container multi-stage Docker build deployed live on Render with unified SPA static serving.
Challenges i Ran Into
- Sub-100ms Inference Window: Pre-transaction scoring must never bottleneck checkout. We optimized feature extraction and tree depth to hit <50ms local execution.
- Human-Free Machine Payments: Designing a smooth L402 flow required stateful token verification without browser session cookies or human redirects.
- The $15 Dispute Dilemma: Formulating a mathematical threshold that prevents merchants from winning a $10 dispute while losing $15 to filing fees.
Accomplishments i am Proud Of
- 63 automated tests passing in CI across all API routes, ML invariants, and webhook pipelines.
- Zero-downtime unified deployment live on Render with full interactive Swagger docs.
- Seamless end-to-end integration with both PayPal Orders v2 and Disputes v1 APIs.
What We Learned
Deep dive into PayPal's Orders v2 and Disputes v1 schemas, cost-sensitive threshold tuning for financial ML, and cryptographic state verification for machine commerce.
What's Next for PayShield AI
- Native multi-rail settlement supporting Razorpay and UPI for instant Asian cross-border corridors.
- Shopify and WooCommerce drop-in plugin adapters.
- Continuous online model retraining based on confirmed chargeback feedback loops.
Built With
- cybersecurity
- docker
- fastapi
- fintech
- lightgbm
- machine-learning
- paypal
- python
- react
- render
- shap
- tailwindcss
Log in or sign up for Devpost to join the conversation.