# How to build real-time fraud detection on a lakehouse

> Real-time fraud detection on a lakehouse streams transactions through Kafka into open tables, scores each event with a model trained on governed history, and pushes decisions back to payment systems in seconds. On DataNature, StreamHouse, DataNature AI and AI360 Studio do this inside your jurisdiction.

Source: https://datanature.ai/blog/how-to-build-real-time-fraud-detection-on-a-lakehouse
Publisher: Dlytica Inc. (DataNature is a Dlytica company)
Updated: 2026-11-05

## What does the architecture look like?

1. Connect captures transactions with change data capture.
2. StreamHouse streams them into Bronze tables.
3. A model trained on Gold history scores each event.
4. AI360 Studio pushes decisions and alerts to payment and case systems.
5. [Atlas](/platform/atlas) logs every score for audit.

## Why use a lakehouse rather than a separate fraud engine?

One copy of data serves real-time scoring, investigation and model retraining. Analysts see the same events the model saw.

## What data improves fraud models most?

Transaction history, device and channel data, customer tenure and behaviour, and network features such as shared devices or beneficiaries.

## How do you keep it compliant?

Keep data and models in-country, mask personal data for analysts who do not need it, and keep lineage from alert to source event.

## What does the build look like in DataNature, component by component?

| Step | Component | Detail |
|---|---|---|
| Capture transactions | StreamHouse | Change data capture from the card or core banking database, or events from the payment switch, into managed Kafka |
| Enforce event contracts | StreamHouse schema registry | Producers cannot break the schema scoring depends on |
| Maintain short-window features | StreamHouse in-flight processing | Velocity counts, new-device flags, merchant risk per card, keyed by card or account |
| Slow features | dbt Gold and the feature store | Customer tenure, historical spend profile, chargeback history |
| Score | DataNature AI | Model versioned in the DataNature AI registry, served for real-time inference |
| Decide and act | AI360 Studio and Voir | Rules plus model score → approve, step up or hold; analyst case created with context |
| Audit | Iceberg and Atlas | Every event, feature value, score, model version and decision written back for audit and retraining |

Mask card numbers with a "show last 4" mask and hash customer IDs for analysts, while fraud investigators get an exempt policy. Reconcile hot-path transaction counts against the batch path daily to catch dropped events. See [StreamHouse: the real-time hot path](/blog/streamhouse-real-time-hot-path-lakehouse) for the streaming design.

## How does DataNature Atlas keep this secure and compliant?

Investigators see what they need; analysts see masked identifiers; every score and decision is auditable. [DataNature Atlas](/platform/atlas) is the platform's governance module:

- **Knows your data**: a catalog with automated PII detection and classification across Bronze, Silver and Gold.
- **Controls access**: role-based grants plus attribute-based policies, row filters and column masks (null, redact, partial, hash, year only).
- **Governs AI**: Voir agents are scoped principals; masks, row filters and PII guardrails apply to every tool call and answer.
- **Proves it**: lineage from source to metric to decision, and an audit log of who or what accessed which data.
- **Stays local**: Atlas runs inside your deployment, so policies, lineage and logs never leave your jurisdiction.

These controls support GDPR, PIPEDA, Quebec Law 25, CCPA, HIPAA and sector rules such as OSFI E-23. Read [DataNature Atlas in depth](/blog/datanature-atlas-governance-rbac-abac-pii-masking) or see [security and compliance](/security).
