Skip to main content

Rules vs. ML

TL;DR
  • 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​

AspectRulesMachine Learning
InterpretabilityYou can read the logicVaries by model. Some, like decision trees, can be read directly
Speed to deployPlan on hours or days, once you know the patternPlan on weeks or months if you build it. Your processor's may already be running
MaintenanceManual updatesRetraining required
Novel fraudCan trigger on a new case that meets the condition, if you've written itCan flag anomalies. Prove it on your outcomes
Known fraudSuits it, while the pattern holdsDepends on your labels
False positivesTest on your own ordersTest on your own orders
Expertise neededDomain knowledgeData 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)​

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​

  1. Document every rule: Purpose, conditions, rationale
  2. 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)
  3. Review quarterly: Remove underperformers
  4. Sunset old rules: Don't let rules accumulate
  5. 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​

FactorRecommendation
AlgorithmTest gradient boosting (XGBoost, LightGBM) against your current baseline
Training dataUse confirmed fraud, not just chargebacks
Refresh frequencySet it from new usable labels, traffic changes and validation results. On a vendor's model, ask who controls it
Feature stabilityMonitor for drift
ExplainabilityUse SHAP values for investigation

Next Steps​

Just starting fraud detection?

  1. Start with rules → Known patterns are easier to block with rules
  2. Use your processor's ML → Stripe Radar, Adyen Protect for baseline scoring
  3. Build a review queue → Some transactions need human eyes

Improving your detection?

  1. Analyze your rule performance → Which rules catch fraud? Which just add friction?
  2. Add velocity rules → Velocity Rules guide
  3. Layer signals → Rules + ML + device fingerprinting together

Going advanced?

  1. Build custom ML models → If you have the data science resources
  2. Invest in feature engineering → Better signals beat better algorithms
  3. A/B test continuously → Track precision/recall tradeoffs

Something wrong on this page? Email matt at paymentsandrisk.com and say what needs fixing.