Rules vs. ML
- Rules: You can read the logic and change it yourself. They suit patterns you can name and procedures you're required to follow
- ML: Scores complex patterns at scale, if your labeled outcomes support it. Needs data science expertise
- A layering worth testing: hard rules for what you've already decided (blocklists, and a sanctions match routed to your required procedure) → a machine-learning score → softer rules that use the score to block, review or allow (thresholds, overrides)
- Start with rules: Use processor ML (Stripe Radar, Adyen Protect) until you have data science resources
- Layer with velocity rules (guide), device fingerprinting (guide), behavioral analytics
Starting out? Use rules plus your processor's built-in machine learning. Which matters more after that depends on the fraud types you actually see.
Comparison
| Aspect | Rules | Machine Learning |
|---|---|---|
| Interpretability | You can read the logic | Varies by model. Some, like decision trees, can be read directly |
| Speed to deploy | Plan on hours or days, once you know the pattern | Plan on weeks or months if you build it. Your processor's may already be running |
| Maintenance | Manual updates | Retraining required |
| Novel fraud | Can trigger on a new case that meets the condition, if you've written it | Can flag anomalies. Prove it on your outcomes |
| Known fraud | Suits it, while the pattern holds | Depends on your labels |
| False positives | Test on your own orders | Test on your own orders |
| Expertise needed | Domain knowledge | Data science + domain |
When to Use Rules
Rules fit when:
Known Fraud Patterns
Illustrative condition below. Choose age and amount cutoffs from your own order history and test before enforcing.
IF transaction_country != billing_country
AND account_age < 7_days
AND transaction_amount > $500
THEN block
Regulatory Requirements
IF possible_OFAC_list_match = true
THEN route_to_sanctions_procedure
Resolve the match first, because a name hit can be a false match. Then check the sanctions program, any exemption or license, and take the required block, reject or permitted action (OFAC FAQ 5, OFAC's decision chart, accessed 3 November 2026). An automated decline isn't the same as blocking property. See AML Basics for compliance requirements.
Business Logic
IF order_contains(gift_cards)
AND order_total > $1000
AND first_order = true
THEN manual_review
Immediate Response
When you discover a new fraud pattern, a rule can go in quickly, once you've checked what it would block.
When to Use ML
Machine learning can help when:
Pattern Complexity
- Hundreds of features interacting
- Non-linear relationships
- Patterns too complex for human rule-writing
Scale
- Millions of transactions
- Need for real-time scoring
- Too many segments for manual rules
Evolution
- Fraud patterns shifting constantly
- Need to catch novel approaches
- Want to optimize over time
Probability Needed
- Gradated risk scores (not just yes/no)
- Threshold tuning required
- Different actions at different confidence levels
The Hybrid Approach
The hybrid below layers both. The score bands in this diagram are illustrative; fit them to your model's scale, loss budget and review capacity:
Layer 1: Hard Rules (Pre-ML)
- Blocklists
- Possible sanctions matches, routed to your required procedure. See AML Basics
- Impossible transactions (velocity > max)
- Known fraud fingerprints (via device fingerprinting)
Layer 2: ML Scoring
- Probability of fraud
- Contextual risk assessment
- Feature-rich evaluation
Layer 3: Soft Rules (Post-ML)
- Threshold application (score > 80 = block). See risk scoring
- Override rules (VIP customers)
- Manual review triggers
- Business logic gates
Building Effective Rules
Rule Anatomy
Illustrative rule record. Fill performance fields from your own mature outcomes, using the Fraud Metrics definitions. Unknowns stay separate.
RULE: High-risk first purchase
CONDITIONS:
- first_order = true
- order_value > $300
- shipping_address != billing_address
- email_age_days < 30
ACTION: manual_review
RATIONALE: Test whether this combination identifies fraud worth investigating
PERFORMANCE:
- Trigger count / Total attempts: [measured]
- Confirmed fraud / All hits: [measured]
- Confirmed legitimate / All hits: [measured]
- Unknown outcomes / All hits: [measured]
Rule Hygiene
- Document every rule: Purpose, conditions, rationale
- Track performance: How often each rule fires, how many of its hits were really fraud (precision), and how much of the fraud it caught (recall)
- Review quarterly: Remove underperformers
- Sunset old rules: Don't let rules accumulate
- Version control: Track changes over time
Building Effective ML
Feature Engineering
Start with features like:
- Velocity (transactions per hour/day/week)
- Deviation from normal (customer's own baseline)
- Network features (links to other accounts)
- Device/IP reputation
- Time-based patterns
Model Considerations
| Factor | Recommendation |
|---|---|
| Algorithm | Test gradient boosting (XGBoost, LightGBM) against your current baseline |
| Training data | Use confirmed fraud, not just chargebacks |
| Refresh frequency | Set it from new usable labels, traffic changes and validation results. On a vendor's model, ask who controls it |
| Feature stability | Monitor for drift |
| Explainability | Use SHAP values for investigation |
Next Steps
Just starting fraud detection?
- Start with rules → Known patterns are easier to block with rules
- Use your processor's ML → Stripe Radar, Adyen Protect for baseline scoring
- Build a review queue → Some transactions need human eyes
Improving your detection?
- Analyze your rule performance → Which rules catch fraud? Which just add friction?
- Add velocity rules → Velocity Rules guide
- Layer signals → Rules + ML + device fingerprinting together
Going advanced?
- Build custom ML models → If you have the data science resources
- Invest in feature engineering → Better signals beat better algorithms
- A/B test continuously → Track precision/recall tradeoffs
Related Topics
- Prevent Fraud: The fraud hub
- Building Fraud Rules: Starter rule set, allow/block lists, rule lifecycle
- Fraud Model Feedback: How ML learns from your data
- Velocity Rules: Detecting abuse patterns
- Behavioral Analytics: How users interact
- Data Enrichment: IP, email, phone signals for rules and ML features
- Device Fingerprinting: Tracking devices
- Risk Scoring: Combining signals
- Manual Review: Human investigation
- Fraud Metrics: Measuring performance
- Evidence Framework: Tier 1/Tier 2 indicators
- 3D Secure: Authentication layer
- AVS & CVV: Verification signals
- Processor Rules Configuration: Processor-level rules
- Fraud Vendors: Vendor ML capabilities
- Running Fraud Operations: Operational cadence playbook
- Experimentation: Testing rule changes