•6 min read

Rethinking Risk in the Age of AI

Rethinking Risk in the Age of AI

I spent most of my career building fraud detection systems the old way: rules, thresholds, review queues. You'd write a rule, watch false positives pile up, tune it, repeat. Then someone on the data team would find a pattern you missed three months later.

AI flips that entirely. Not because it's magic, but because it can sit inside the transaction stream and adapt faster than any ruleset I've ever maintained.

Audio Briefing
0:00 / 0:00

What AI Actually Changes

The fundamental shift is moving from reactive to near-real-time detection. With rules, you can only catch what you've already seen and written a rule for. A model trained on transaction patterns can flag anomalies that don't match any existing rule: a purchase from a new device in a new location that still fits the user's spending profile otherwise, for example.

But there's a catch I didn't anticipate: models drift faster than rules. A rule either matches or it doesn't. A model's confidence thresholds shift as the data distribution changes. I've had models that performed great at deployment degrade noticeably within three months because fraud patterns evolved.

The Maintenance Reality

A ruleset needs updating when you spot a new pattern. A model needs monitoring constantly: accuracy, recall, false positive rate, data drift. The maintenance burden is different, not lower.

Advertisement

Where Rules Still Win

Not every fraud scenario benefits from ML. Simple velocity checks ("more than 5 transactions from this card in 10 minutes") are faster and more reliable as rules. The model might catch novel patterns, but it also introduces latency and complexity for cases that a three-line if-statement handles perfectly.

The line I use: if you can describe the fraud pattern in one sentence, write a rule. If the pattern is "I'll know it when I see it," train a model.

Deploying a Model in Production

The hardest lesson wasn't building the model: it was serving it. Real-time fraud detection needs inference in under 100ms. That meant:

  • Feature engineering that runs at transaction time, not batch. Computing the "average transaction amount for this user in the last 24 hours" needs to happen instantly, not from a daily job.
  • Model serialization that doesn't bloat. Pickle files with 200MB of dependencies don't belong in a payment pipeline.
  • A fallback strategy. When the model server is down (and it will go down), the ruleset needs to keep running. I've seen teams build beautiful ML pipelines with no fallback, and the first outage took their entire risk system offline.
Fallback Isn't Optional

Every ML-based risk system I've seen in production has a degraded-mode ruleset underneath. Design that fallback from day one, not after the first outage.

What I'd Tell Someone Starting Now

Start with rules for the obvious patterns. Add ML for the edge cases rules can't catch. Monitor model performance constantly: not just accuracy, but business impact (how many legitimate transactions are you blocking?). And always, always have a fallback.

The best risk systems I've seen aren't pure ML or pure rules. They're hybrids where each covers the other's blind spots.

Advertisement

You Might Also Like

Deep Dive: The Core Mechanics

When we look beneath the surface, the underlying mechanics reveal a complex interplay of systems. In modern development, understanding these mechanics is what separates a novice from an expert.

Consider this practical example:

// A comprehensive example demonstrating advanced patterns
class ServiceManager {
  constructor() {
    this.services = new Map();
    this.initialized = false;
  }

  register(name, service) {
    if (this.services.has(name)) {
      throw new Error(`Service ${name} already registered`);
    }
    this.services.set(name, service);
  }

  async initializeAll() {
    this.initialized = true;
    for (const [name, service] of this.services) {
      if (typeof service.init === 'function') {
        await service.init();
      }
    }
  }

  get(name) {
    if (!this.initialized) {
      console.warn('Accessing services before initialization');
    }
    return this.services.get(name);
  }
}

This pattern ensures that our architecture remains scalable and robust even as business requirements change. It's a fundamental approach that pays dividends in large-scale applications.

Real-world Application and Scaling

Implementing this in a production environment introduces a new set of challenges. We must account for concurrency, state management, and memory leaks.

For instance, when dealing with high-throughput systems, every micro-optimization counts. We often rely on profiling tools to identify bottlenecks that aren't apparent during local development.

The diagram above illustrates a typical deployment strategy where our application scales horizontally.

Test Your Understanding

Frequently Asked Questions

Deterministic rules execute in sub-millisecond time and are ideal for regulatory sanctions, binary blacklists, and basic card-testing velocity limits. ML models excel at detecting subtle multidimensional fraud rings, synthetic identities, and anomalous behavioral shifts. Combining deterministic rules as tier-1 filters with ML for ambiguous scores provides optimal throughput and recall.
Fraud vectors evolve rapidly as attackers probe detection boundaries. Teams mitigate drift by: (1) Running real-time feature stores (such as Redis or Feast) that compute rolling behavioral windows on the fly; (2) Continuously tracking Population Stability Index (PSI) and feature distributions; and (3) Running automated shadow-evaluation retraining pipelines when false-positive rates drift.
Low latency requires keeping inference and feature computation close to payment gateways. Engineers pre-compute historical customer metrics into low-latency in-memory databases, deploy quantized tree ensembles or ONNX models on co-located microVMs, and restrict deep synchronous scoring only to ambiguous borderline transactions.
Global regulations (such as FCRA and GDPR) require clear adverse-action reasons when blocking transactions or credit. Risk teams use TreeSHAP or feature-attribution algorithms to extract the top-contributing risk factors (such as device fingerprint divergence or anomalous geo-velocity) and store signed decision payloads alongside transaction logs.
Overly aggressive fraud models increase false declines, driving away legitimate paying customers. Modern risk architectures employ adaptive 3D Secure (3DS) and step-up verification: low-risk shoppers experience zero-friction one-click payment, while suspicious scores trigger biometric passkey or SMS challenges rather than outright declines.

This additional context provides more background on the topics discussed above, ensuring a comprehensive understanding of the nuances involved in real-world scenarios.

Share this article:

Stay Updated

Get the latest posts delivered straight to your inbox.

Free Developer Utilities

Free In-Browser Developer Tools

Clean AI CLI logs, build cron expressions, decode JWTs, and calculate chmod permissions offline.

Explore Tools
Advertisement