Scaling fraud defense: How Nubank evolved its risk analysis platform

Nubank Editorial23 Jul 2025

Problem

Nubank's fraud detection started out decentralized. Each product team integrated with separate systems, and new defenses took long to reach production. A payment such as a PIX transaction needs dozens of rules and models to run fast enough to approve or block it in real time, across several products and countries.

Example from the article: a PIX transaction arrives with its origin, destination and amount, and over 40 processes, both business rules and machine learning models, may run in parallel before the system decides.

Solution in brief

Nubank built one Defense Platform that every product calls. A flow orchestrator picks the rules and models for each event type, runs them in parallel on shared features, and returns an action. A slow model is skipped when a rule already marks the event as high-risk, every new defense is shadow-tested first, and the orchestrator was rebuilt as a dependency graph.

Questions this case answers
  • How to evaluate many rules and models per event in real time when slow models make the total latency too high
  • How to ship new detection logic without risking false blocks on real users
  • How to run dozens of fraud rules and ML models on every payment without blowing the latency budget?
  • How to give every product team one fraud decision service instead of separate integrations?

Tools and methods

  • Flow Orchestrator — picks and runs the rules and models for each event type, then decides the action
  • Features system — one access layer to internal and third-party data
  • Rules before models — skips a slow model when a rule already marks the event as high-risk
  • Shadow testing — runs new rules and models on real inputs without affecting customers
  • Nodely (DAG library) — starts each component as soon as its data is ready
  • Apache Kafka, Amazon DynamoDB — stack components
Continue reading — it's free

Google or a one-time email code. No password.