|
|
Fraud Detection Agent
Author: Venkata Sudhakar
Online fraud costs Indian e-commerce platforms crores annually through COD refusals, chargeback abuse, and account takeovers. An ADK fraud detection agent scores each order against multiple risk signals before it reaches the warehouse, flagging suspicious orders for manual review without blocking legitimate customers.
The agent evaluates four risk dimensions: account age and history, order value vs typical spend, delivery address novelty, and order velocity (how many orders placed in a short window). A composite score determines whether to approve, review, or reject the order automatically.
It gives the following output,
[u_ankit] Decision: REJECT (fraud score: 13)
Risk signals: new account (<7 days), first-time buyer, order value 5x above
average spend, high-value COD order, high order velocity (4 orders in 24h),
new delivery address.
Recommendation: Cancel order and flag account for manual review.
[u_meena] Decision: APPROVE (fraud score: 0)
No risk signals detected. Established customer, 720 days active,
48 previous orders. Order value within normal range. Approve for dispatch.
[u_rahul] Decision: REVIEW (fraud score: 5)
Risk signals: unverified mobile number, high-value COD (Rs 45,000),
new delivery address.
Recommendation: Hold for manual verification - contact customer to confirm order.
The agent correctly blocked Ankit (multiple high-risk signals including a 3-day-old account placing a Rs 74,999 COD order after 4 orders in 24 hours), approved Meena's routine purchase, and flagged Rahul for review due to the combination of unverified mobile and a high-value COD order to a new address.
For ShopMax India production, integrate this agent as a synchronous pre-dispatch check in the order processing pipeline. Call it via a Cloud Run endpoint after payment confirmation but before warehouse notification. If the decision is REVIEW, write the order to a fraud_review Firestore queue for the operations team. If REJECT, trigger an automated order cancellation and send the customer an SMS requesting them to contact support. Log all decisions and scores to BigQuery for weekly fraud trend analysis.
|
|