The problem Most fraud checks give each payment a score and move on. Organised fraud is designed to look normal one payment at a time: a few accounts sharing one emulator phone and paying the same wallet each look harmless on their own. And a score isn’t a decision, because someone still has to work out why a payment looks risky, often after the money has already been captured.

What Sentinel does PayPal’s Orders API separates the buyer approving a payment from the merchant capturing it. Sentinel makes its risk decision in that gap, before any money moves:

Our demo store, SENTINEL MERCHANT, creates a real PayPal Sandbox order on the server, using server-side prices. The buyer approves in PayPal. Sentinel fetches the order back from PayPal and checks the status, the amount and that it belongs to this shopper. It scores the payment with three signals: a machine-learning model over 26 behavioural features, explained with SHAP; an Isolation Forest anomaly check; a relationship graph that detects shared devices, flagged mule wallets and circular money flows. Low-risk payments are captured automatically. Medium and high risk are held: approved in PayPal, but not captured. For high risk, a LangGraph AI agent investigates with seven tools. It writes a report in which every finding must cite tool-produced evidence; anything uncited is removed automatically. A reviewer re-enters their password, types the transaction ID and approves, rejects or escalates. Only an approval triggers the PayPal capture. Every step is recorded in a hash-chained audit log that detects tampering. Why PayPal is central Sentinel’s core guarantee is that risky money doesn’t move without a human, and that guarantee rests on PayPal’s design:

Order creation: we create orders with server-side prices and make them idempotent with PayPal-Request-Id. Verification before scoring: we fetch each approved order back from PayPal and check its status, amount and owner before scoring it. Gated capture: capture happens only when policy or a reviewer allows it, with a database lock so a payment can never be captured twice. Webhooks: they are verified through PayPal’s signature API. PayPal’s status and Sentinel’s decision are stored separately, so a held payment is never shown as paid. Sentinel runs on PayPal Sandbox with synthetic data and doesn’t access PayPal’s internal fraud systems.

Results (synthetic data, hold-out test set)

Model: Random Forest was selected automatically by PR-AUC (0.914; precision 0.970, recall 0.889). XGBoost came third, and we report that honestly. Graph-only fraud: in our fraud-ring demo the model alone scored the payment 0.33. The graph found the shared emulator device and mule wallets and raised it to HIGH. Tests: 26 automated tests pass, including tests that high-risk payments can’t bypass review and that nothing is captured twice

Built With

  • capture)
  • explains-why-with-ml
  • get
  • graph-analysis-and-an-evidence-citing-ai-investigator
  • javascript
  • oauth-2.0
  • orders-api-v2-(create
  • paypal
  • paypal:-paypal-developer-platform-(sandbox)
  • sdk
  • webhooks-with-signature-verification
Share this project:

Updates

posted an update —

SENTINEL is live!

SENTINEL checks every PayPal payment for fraud after the buyer approves it but before any money is captured.

What's in it

  • PayPal Orders API v2 (Sandbox): server-side orders, risk-gated capture, verified webhooks
  • ML risk scoring: Random Forest, XGBoost and Logistic Regression, with SHAP explanations for every score
  • Graph intelligence: NetworkX finds shared devices, fraud rings and mule wallets
  • LangGraph AI agent: 7 tools and an evidence-cited report; it recommends but never moves money
  • Human-in-the-loop: a reviewer re-enters their password before approving or rejecting
  • Tamper-evident audit trail: every action is hash-chained and verifiable

Try it: https://sentinel-payment-risk.netlify.app (the backend wakes in about 50 seconds on first load) Code: https://github.com/Tanisha-dey18/hackathon

All data is synthetic, and no real money moves.

Submission history