Skip to content
Regolo Logo
Benchmarks & Cost Optimization

Sub-second payment fraud detection with Clef-Flash: combining deterministic rules, pre-scoring, and YAML security policies in Europe

European non-cash payments hit 83.5 billion transactions in H2 2025, with 25% of retail credit transfers now instant and irrevocable. We walk through fraudclef, an open-source Python fraud engine combining microsecond YAML hard rules, pre-scoring, and Clef-Flash on our /v1/systemone endpoint ($0.0004/call, 0 output tokens), benchmarked on 1,050 IBM TabFormer card payments under DORA, GDPR, PSD3/PSR, and EU AI Act Annex III 5(b).

Alex Genovese
19 min read
Share

Across the euro area, non-cash payments reached 83.5 billion transactions worth €117.8 trillion in the second half of 2025 according to European Central Bank statistics published in July 2026, with instant credit transfers already accounting for 25% of retail credit transfers. Once an instant transfer or card authorization clears, recovering stolen funds is slow and uncertain, which shrinks the useful fraud-check window to milliseconds.

European banks are responding by layering explainable AI and modular models on top of their existing rule engines rather than ripping out core compliance stacks. In March 2026, Commerzbank partnered with Hawk to add explainable anti-money-laundering models alongside its rule-based monitors, and in May 2026 Chief Data and AI Officer Oliver Dörler reported to CIO Germany that real-time FraudAI cut false alarms in fraud monitoring by 40% in Q1 2026 while keeping backend AI models interchangeable to preserve digital sovereignty. On November 11, 2026, Commerzbank, Deutsche Bank, and the German Savings Banks Association (DSGV) formed a joint venture to share cross-bank fraud intelligence under EU data rules.

How can a banking or insurance risk team score ambiguous payment scams in hundreds of milliseconds, update fraud logic without waiting weeks for model retraining, and keep customer data under European Zero Data Retention?

In this engineering guide, we walk through fraudclef, an open-source Python payment fraud scoring engine and local web console (reference repository on GitHub) built around a three-tier cascade and Clef-Flash, the 9-billion-parameter Apache-2.0 decision model served on our /v1/systemone API. We evaluate it across a 2,000-customer Eurozone multi-channel portfolio (Milan, Rome, Frankfurt, Munich, Paris, and Madrid), a 27-case European compliance suite, and 4,250 IBM TabFormer card transactions, showing both where YAML-driven decision models stop Authorized Push Payment (APP) scams and where plain deterministic rules still win.

THREE-TIER CASCADE & WIRE INSPECTOR · FRAUDCLEF
How fraudclef settles habitual traffic in microseconds and scores grey-zone payments in one forward pass

Python computes exact behavioral features and enforces YAML hard rules locally before any GPU call happens. Only ambiguous or high-value payments reach Clef-Flash on our /v1/systemone endpoint, with all personal identifiers hashed first.

Stage 0 & 1 · 0.14 ms
HMAC privacy & features
Hashes IBAN, name, and device ID; computes z-score, velocity, km/h, and VoP flags.
Stage 2 · 0.16 ms
YAML hard rules
Blocks sanctions, interbank mule IBANs, 900 km/h travel, and micro-charge bursts ($0).
Stage 3 · 0.01 ms
Pre-score gate
Approves 72% to 91% of habitual spend locally at 0.2 ms median latency ($0).
Stage 4 · 148 to 298 ms
Clef-Flash (/v1/systemone)
Single forward pass on grey zone, ≥€500, and SEPA Instant (~$0.0004/call, 0 output tok).
Stage 5 · <0.1 ms
SCA, fail-safe & audit
Applies PSD2 TRA rules, per-channel DORA fail modes, and SHA-256 hash chain.
Pseudonymized request sent to POST /v1/systemone (~2,500 input tok)
{
  "model": "clef-flash",
  "state": {
    "customer": {"segment": "retail", "home_country": "DE", "hours_since_profile_change": 8.2},
    "history_summary": {"median_amount": 54.8, "countries": ["DE"]},
    "candidate": {
      "when": "now", "amount": 3850.0, "currency": "EUR",
      "channel": "sepa_instant", "device_id": "h:9f2a81c4e10b",
      "beneficiary": {"iban": "h:3d71bc09a412", "vop_result": "no_match"}
    },
    "features": {"amount_zscore": 68.4, "new_device": true, "vop_mismatch": true}
  },
  "questions": {
    "scam_pattern": {"type": "choice", "criteria": {"none": "...", "app_scam": "..."}},
    "fraud_risk": {"type": "score", "criteria": ["Usual", "Unusual", "Suspicious", "Fraud"]}
  }
}
Single-pass probability response (0 output tokens billed)
{
  "model": "clef-flash",
  "answers": {
    "scam_pattern": {
      "type": "choice",
      "choice": "app_scam",
      "confidence": 0.987,
      "probabilities": {"none": 0.0000001, "card_fraud": 0.0086, "app_scam": 0.991}
    },
    "fraud_risk": {
      "type": "score",
      "score": 2.9999,
      "confidence": 0.9999,
      "legend": {"0": "Usual", "1": "Unusual", "2": "Suspicious", "3": "Fraud"}
    }
  },
  "usage": {"input_tokens": 2596, "output_tokens": 0}
}

Source: fraudclef live measurements on Regolo API (/v1/systemone, clef-flash, Nov 12, 2026). Local CPU timings measured on Apple Silicon; GPU timings include HTTPS round trip to our shared European endpoint.

Why payment latency budgets split between synchronous gates and grey-zone judgement

Before picking a model architecture, a risk engineering team has to separate the deadline of the payment rail from the budget of the scoring service. As Redis engineering and PaymentBrief note in their 2026 architecture reviews, a 100 to 300 ms card authorization window includes network transit, card-scheme routing, and core ledger checks, leaving only 10 to 50 ms for feature lookup and model inference on synchronous POS traffic. Under the EU Instant Payments Regulation (Regulation (EU) 2024/886), banks have a 10-second end-to-end ceiling to settle euro transfers and confirm completion after mandatory Verification of Payee (VoP), which leaves roughly half a second to a second for pre-execution fraud scoring.

Modern banking pipelines meet those budgets by splitting fast deterministic streaming from contextual AI judgement. On the streaming side, Databricks benchmarked Apache Spark Real-Time Mode with Lakebase in May 2026 on a Kafka-in, Kafka-out card-fraud pipeline (60-second velocity state plus feature enrichment), recording sub-40 ms p50 and 215 to 392 ms p99 end-to-end latency. On the rule-governance side, Commonwealth Bank of Australia disclosed in April 2026 that an internal AI system monitoring 80 million daily signals has helped draft or update three quarters of its card fraud rules, always gated by human analyst approval before a rule touches live payments.

Calling an autoregressive chat LLM on every card swipe breaks both latency and GPU budgets. If you already use small non-generative classifiers for support ticket routing or automated guardrail checks, payment scoring pushes the same pattern one step further: local CPU code must settle obvious cases in microseconds, and the GPU model must evaluate only the grey zone in a single forward pass.

Payment rail budgets, dedicated vs cloud timeouts, and DORA fail-safe modes

How retail-eu.yaml and sepa-instant-dach.yaml separate card authorization deadlines from irrevocable SEPA Instant transfers

Constraint Card presentPOS & contactless Card not presentE-commerce & remote SEPA InstantReg. (EU) 2024/886 SEPA Direct DebitMandate pull
End-to-end rail windowTotal network deadline 100 to 300 msScheme + issuer path 150 to 500 msBefore 3DS / PSP timeout Max 10 s legal capSub-second bank target Batch / settlement cyclePayer is offline
Co-located GPU budgetDedicated H200 in same region 150 ms max38.8 ms H200 median 300 ms maxFits grey-zone check 800 ms maxAlways routed to Clef 500 ms targetScored on new mandates
Cloud API policy timeoutOver public HTTPS (multi-tenant) 3,000 msAvoids queueing false fails 3,000 msAvoids breaker trips 3,500 msFits 10 s IPR cap 3,000 msOffline settlement
Primary fraud vectorsWhat rules vs model catch Cloned card, skimming900 km/h rule + profile Card testing, stolen PANBurst rule + Clef choice APP hotline scam, ATO, BECVoP mismatch + Clef Unauthorized new creditor48h mandate rule + Clef
DORA backend fail modeWhen model API times out use_prescoreStand-in on local score step_upTrigger PSD2 SCA step_up (never approve)Irrevocable funds guard holdQueue for analyst check
SOVEREIGN EUROPEAN INFERENCE
Run Clef-Flash, Qwen, and GLM in Europe with zero data retention

Score structured decisions on /v1/systemone at €0.15 per million input tokens (€0 output), or deploy dedicated Apache-2.0 vLLM and SGLang GPUs inside our 100% green European datacenters.

Start 30-day free trial →

Free trial credits included · 100% renewable European energy · ✓ GDPR & DORA ready   ✓ Certified Zero Data Retention

Inside fraudclef: hard rules, pre-scoring, and Clef-Flash on /v1/systemone

In fraudclef, every rule, feature weight, routing threshold, model question, PSD2 Strong Customer Authentication (SCA) exemption, and backend fail mode lives in a versioned YAML policy rather than application code. At startup, the policy loader enforces a four-eyes check (governance.author cannot match approved_by), verifies that feature and question weights sum to 1.0, and dry-runs every rule expression inside a restricted evaluator (simpleeval, with no Python eval) against a sample transaction.

As we covered in our benchmark guide to Jev and SystemOne decision models, Clef-Flash is post-trained from Qwen/Qwen3.5-9B with a joint schema transformer head. On the Decision Index 0.2.1 suite, Clef-Flash reaches 97.1% macro-F1 on FinEntity and 90.9% on BANKING77 with a 38.8 ms median latency (122.4 ms p95) on a single H200 GPU, while scoring 67.3% on GSM8K arithmetic. Because 9B models are weaker at raw arithmetic than at pattern judgement, fraudclef computes exact numeric features in Python (robust amount z-scores, 10-minute micro-charge bursts, implied travel speed in km/h, hours since a phone-number change, interbank mule IBAN matches, and VoP mismatch flags) in 0.14 ms and hands those precomputed signals to Clef-Flash.

Two domain choices in retail-eu.yaml and sepa-instant-dach.yaml came directly from testing European retail and Mittelstand fraud typologies. When an account-takeover pattern fires (contact phone changed within 48 hours plus a new device and a new beneficiary), sending a one-time SMS passcode (step_up) would deliver the code straight to the attacker’s new phone number, so the policy routes that pattern to hold for out-of-band verification. Similarly, on a SEPA Direct Debit where the payer is offline, unavailable_actions automatically upgrades any step_up verdict to hold.

On a 250-payment benchmark drawn from our 2,000-customer Eurozone multi-channel portfolio at concurrency 3, enabling the cascade gate in retail-eu dropped model calls from 87.2% to 27.6%, raised throughput 3.6x (5.1 to 18.1 requests per second), cut median end-to-end payment time from 668.5 ms to 0.2 ms, and cut API spend from $0.0861 to $0.0277 ($111 per million payments) while stopping all 40 fraudulent transactions with zero timeouts and interrupting fewer genuine customers (29 vs 34 of 210).

BANKING FRAUD & DECISION MODELS · REGOLO LABS

Eurozone portfolio throughput

Cascade sends 27.6% of payments to Clef-Flash vs 87.2% for always.

Cascade18.1 req/s
Model all5.1 req/s

Measured live on 250 payments from the 2,000-customer Eurozone multi-channel portfolio (retail-eu policy, concurrency 3, Nov 12, 2026, 0 timeouts): cascade cut median payment time from 668.5 ms to 0.2 ms and cut API spend from $0.0861 to $0.0277. Measured with fraudclef on Regolo API (/v1/systemone, clef-flash, Nov 12, 2026) across the Eurozone retail portfolio and IBM TabFormer holdout (n=1,050).

fraudclef Results view on 250 localized Eurozone multi-channel payments with retail-eu: cascade stops 40 of 40 frauds, cuts average wait from 587 ms to 165 ms, cuts API spend from $0.0861 to $0.0277 ($111 per million payments), and records zero fallback timeouts.

Live Results view on 250 localized Eurozone retail and SME payments (Milan, Rome, Frankfurt, Munich, Paris, Madrid): cascade routing stops 40 of 40 frauds, sends 27.6% of traffic to Clef-Flash, cuts cost from $0.0861 to $0.0277 ($111 per million payments), and records zero fallback timeouts.

Designing the question schema and history window for sub-second scoring

Running live probes against POST https://api.regolo.ai/v1/systemone uncovered two practical rules for anyone deploying SystemOne decision models in production. First, billed input tokens and latency grow linearly with the number of questions in your schema because the state is encoded once per question. Asking five separate questions over a 10-payment state (retail-eu-explainable.yaml) consumed roughly 6,100 input tokens and pushed median latency to 566 ms. Collapsing the policy into two rich questions in retail-eu.yaml (one choice over fraud typologies and one ordered 0-to-3 score) cut the payload to roughly 2,500 input tokens, brought sequential median latency down to 148 ms, and kept each model call around €0.0004 (~$0.0004 in benchmark USD accounting) at our catalog rate of €0.15 per million input tokens and €0 output.

BANKING FRAUD & DECISION MODELS · REGOLO LABS

Median latency by question schema

Each question re-encodes the state on /v1/systemone (Clef-Flash).

Summary, 2Q143 ms
Full, 2Q148 ms
Summary, 5Q281 ms
Full, 5Q566 ms

Medians of 6 sequential calls per state configuration on the shared Regolo API. Two typed questions (scam_pattern choice + fraud_risk score, ~2,500 input tokens) cost ~$0.0004 per call with zero output tokens. Measured with fraudclef on Regolo API (/v1/systemone, clef-flash, Nov 12, 2026) across the Eurozone retail portfolio and IBM TabFormer holdout (n=1,050).

Second, binary noul (yes/no) questions saturated at 0.0 or 1.0 on borderline cases, leaving risk teams with no room to separate a step-up challenge from a hard block. By contrast, choice and 0-to-3 score questions produced usable intermediate expectations in the grey zone: habitual grocery shopping scored 0.002 out of 3, a plausible DB ICE rail trip from Frankfurt to Munich scored 0.95, and a vulnerable Madrid retiree’s first €1,150 instant transfer to Cyprus scored 2.45 out of 3.

How many past transactions you include in the request creates a second trade-off between context, token budget, and latency. Each historical payment adds roughly 140 input tokens. Trimming the window to 5 payments (1,716 tokens) missed a monthly Netflix Europe subscription that fell outside the lookback, triggering an unnecessary step-up (11 of 12 core cases met). Expanding to 30 payments (5,118 tokens) met every case but pushed p50 latency to 867 ms and p95 to 994 ms. A 10-payment raw window (2,462 tokens) paired with precomputed 90-day profile aggregates hit every core case at a 258 ms median ($0.37 per 1,000 model calls).

BANKING FRAUD & DECISION MODELS · REGOLO LABS

Input tokens by history window

10 past payments meet all core scenarios at 258 ms p50 ($0.37/1k).

10 past tx2,462 tok
5 past tx1,716 tok
30 past tx5,118 tok

Each past payment adds ~140 input tokens: 5 payments ($0.26/1k) miss monthly recurring bills (11/12); 10 payments hit 12/12 at 258 ms p50; 30 payments ($0.77/1k) push p50 to 867 ms (994 ms p95). Measured with fraudclef on Regolo API (/v1/systemone, clef-flash, Nov 12, 2026) across the Eurozone retail portfolio and IBM TabFormer holdout (n=1,050).

What 1,050 IBM TabFormer payments reveal about rules versus decision models

Alongside our Eurozone multi-channel datasets, we tested fraudclef on IBM TabFormer, an Apache-2.0 dataset of 24.4 million labelled US card transactions. The web console downloads the archive directly from IBM and samples stratified cohorts locally. We tuned card policies on a 3,200-payment 2018 cohort (200 frauds, 3,000 genuine) and evaluated once on an untouched 2019 to 2020 holdout of 1,050 payments (50 frauds, 1,000 genuine), scaling hold precision to the period’s true 0.101% fraud share.

Running our unmodified Eurozone retail policy (retail-eu.yaml) on US card habits stopped only 50% of the frauds while interrupting 15.2% of genuine shoppers, because Clef-Flash rated frequent small US shop purchases at 2.12 out of 3. Rewriting the YAML instructions for US card portfolios (cards-us.yaml, zero retraining) dropped median genuine risk to 0.41 and raised stopped fraud to 74%. Adding customer.usual_countries (countries visited in the 90 days ending 30 days before the payment, so a burst of stolen-card charges abroad cannot poison the recent window) lifted stopped fraud to 92.0% (46 of 50 frauds) while sending only 8.8% of traffic to Clef-Flash ($0.045 total API spend across 1,050 payments).

BANKING FRAUD & DECISION MODELS · REGOLO LABS

TabFormer fraud stopped by policy

1,050 card payments (2019-2020): YAML policies vs country rule.

Profile YAML92.0%
Country rule90.0%
cards-us74.0%
retail-eu50.0%

IBM TabFormer 2019-2020 holdout (50 frauds, 1,000 genuine, cascade mode). Profile YAML cut model calls to 8.8% ($0.045 total); because all 50 frauds in this period are foreign merchants, a deterministic usual-country rule stops 90% at $0 and 0.5% friction. Measured with fraudclef on Regolo API (/v1/systemone, clef-flash, Nov 12, 2026) across the Eurozone retail portfolio and IBM TabFormer holdout (n=1,050).

The comparison table below shows the key engineering lesson from that holdout. Because every fraud in TabFormer’s 2019 to 2020 window happens at a merchant outside the United States, a single deterministic rule holding payments outside customer.usual_countries caught 45 of the 50 frauds (90.0%) with only 0.5% genuine friction at $0 cost, while Clef-Flash caught 1 additional fraud at the cost of 83 extra genuine interruptions (68 step-ups, 15 holds).

IBM TabFormer 2019-2020 holdout: YAML policy iteration vs profile rules

1,050 card payments (50 frauds, 1,000 genuine), cascade mode, precision scaled to 0.101% period fraud rate

Policy / configuration Sent to modelShare of 1,050 tx Fraud stoppedStep-up, hold, block Genuine frictionInterrupted legit tx Hold precision & costAt 0.101% base rate
retail-eu (Eurozone default)Before US card tuning 17.0%179 model calls 50.0%25 of 50 stopped 15.2%Shop spend flagged Baseline run$0.058 total API cost
cards-us YAMLQuestions rewritten for US cards 14.4%151 model calls 74.0%37 of 50 stopped 9.0%1.8% held 1.8% precision$0.075 total API cost
cards-us-profile YAMLAdds 90-day usual_countries 8.8%92 model calls 92.0%46 of 50 stopped 8.8%2.0% held 4.5% precision$0.045 total API cost
Single rule: outside usual countriesDeterministic baseline (no GPU) 0.0%CPU rule only 90.0%45 of 50 held 0.5%5 of 1,000 genuine ~15.0% precision$0 (dataset artifact)

That result explains why production fraud stacks do not replace rules or gradient-boosted trees (LightGBM or XGBoost) on clean tabular features. Where a decision model like Clef-Flash earns its GPU budget is on multi-signal grey-zone cases that pure card tables lack: device swaps shortly after a phone change, VoP close-match or no-match warnings on SEPA Instant, spoofed bank-hotline APP scams, SME supplier IBAN redirects, and rapid zero-retraining YAML updates when a new scam wave starts.

At real banking scale, the cascade also keeps hardware footprints small. Dividing the ECB’s 83.5 billion half-year payments gives roughly 315,000 euro-area payments per minute on average, or about 50,000 payments per minute (~830 requests per second) at peak for a large bank with a 5% market share. Scoring 100% of 830 RPS through a 9B model at 2,500 tokens would require roughly 93 H200 GPUs. Routing only the 2% to 5% grey zone through the cascade shrinks that requirement to 3 to 5 dedicated H200 GPUs (~20x smaller fleet) while keeping utilization well below the queueing knee.

Using fraudclef: web console, localized datasets, YAML policies, CLI, and Python API

The fraudclef repository packages the scoring engine as both a local FastAPI web console (bound strictly to 127.0.0.1) and a standard Python library managed with uv. You need Python 3.12+, uv, and an API key from our 30-day free trial.

1. Start the local console and run the European reference suite

Clone the repository and run ./run.sh start. Before opening http://127.0.0.1:8080, the launcher creates .env with a fresh 32-byte FRAUDCLEF_HMAC_KEY (permissions 0600), syncs dependencies, dry-runs all five YAML policies (retail-eu, sepa-instant-dach, retail-eu-explainable, cards-us, and cards-us-profile), verifies that clef-flash is available and your API key passes /key/info, builds the 27 European scenarios plus the 2,000-customer Eurozone portfolio, and runs all 70 offline unit tests.

git clone https://github.com/regolo-ai/tutorials.git
cd tutorials/sub-second-bank-fraud-clef-flash

./run.sh start          # runs preflight checks, starts uvicorn on 127.0.0.1:8080, opens browser
./run.sh check          # runs preflight & 70 offline pytest checks without starting the server
./run.sh start --fake   # offline mode using FakeBackend (zero external API calls)
./run.sh stop           # stops the local console cleanlyCode language: PHP (php)

Paste your API key in the sidebar and click Run a quick comparison on the Start tab to score the 24 benchmarked European reference cases with retail-eu. Hard rules settle 14 clear-cut payments (58%) in 0.1 ms, pre-scoring settles 2 habitual payments (8%), and Clef-Flash evaluates only the 8 grey-zone cases (33%) in a 298 ms median for $0.0031 total, meeting 24 of 24 analyst expectations and stopping all 16 frauds.

fraudclef Start view on the 24-case European fraud and compliance reference suite with retail-eu: 58% settled by hard rules, 8% by pre-score, 33% by Clef-Flash, 0.2 ms median payment time, 298 ms model median, 16 of 16 frauds stopped, and 0 timeouts.

Start view after scoring the 24-case European reference suite with retail-eu: 58% settled by hard rules, 8% by pre-scoring, and 33% by Clef-Flash (0.2 ms median payment time, 298 ms model median, 16 of 16 frauds stopped).

In the Test wizard, you can benchmark up to three policies side by side across seven localized and public datasets: the 24-case European reference suite, 387 SEPA Instant and credit transfers, 615 European e-commerce card payments, 868 POS and ATM transactions, the full 2,000-customer Eurozone multi-channel portfolio across Milan, Rome, Frankfurt, Munich, Paris, and Madrid, or the 3,200-payment and 1,050-payment IBM TabFormer cohorts (plus custom cohorts synthesized on demand by mistral-small-4-119b).

fraudclef Test dataset selector showing the 24-case European reference suite, 387 SEPA Instant and credit transfers, 615 European e-commerce cards, 868 POS and ATM transactions, 2,000 Eurozone multi-channel customers, and IBM TabFormer cohorts (3,200 and 1,050 payments).

Built-in localized datasets in the Test wizard: 24 curated European reference cases, 387 SEPA transfers, 615 e-commerce card payments, 868 POS and ATM taps, 2,000 multi-channel Eurozone accounts, and IBM TabFormer cohorts (3,200 and 1,050 transactions).

2. Edit regional YAML policies without a software release

Opening the Policies tab loads each rulebook in a live YAML editor. Regional policies inherit from retail-eu.yaml via extends: and override only what differs. For example, sepa-instant-dach.yaml lowers the Clef-Flash trigger to €250 across both sepa_instant and sepa_credit_transfer, holds German Empfängerüberprüfung (VoP) mismatches starting at €500, and applies tighter step-up and hold thresholds for DACH retail and Mittelstand accounts. Note also how retail-eu.yaml sets 3,000 ms timeouts for public HTTPS calls to avoid false circuit-breaker fallbacks under multi-tenant queueing, while documenting the 150 to 300 ms card timeouts used on dedicated co-located GPUs.

fraudclef Policies tab editing sepa-instant-dach.yaml, inheriting retail-eu.yaml to inspect SEPA transfers from EUR 250, hold Empfaengerueberpruefung (VoP) mismatches from EUR 500, and block interbank mule intelligence hits.

Editing sepa-instant-dach.yaml in the Policies tab: the DACH profile inherits retail-eu.yaml, routes transfers from EUR 250 to Clef-Flash, holds Empfaengerueberpruefung (VoP) mismatches from EUR 500, and blocks interbank mule intelligence hits.

3. Inspect graded probabilities, HMAC payloads, and the SHA-256 audit chain

Every scored transaction appends a canonical JSON record to logs/decisions.jsonl carrying the SHA-256 hash of the previous line. Clicking any row in the Audit log tab expands the full provenance trace. In the capture below from scenario 22_madrid_vulnerable_foreign_instant (a vulnerable Madrid retiree sending a first €1,150 instant transfer to an unfamiliar Cyprus IBAN, completed in 158 ms under sepa-instant-dach), analysts see the pre-score contributions, Clef-Flash’s probability bars (fraud_risk: 2.45 of 3, 54.7% on Suspicious and 45.3% on Very likely fraudulent), and the pseudonymized state showing keyed HMAC digests (h:89dc024a9c3e83bb) instead of raw IBANs or names.

fraudclef Audit log expanded on scenario 22_madrid_vulnerable_foreign_instant (Hold in 158 ms under sepa-instant-dach): Clef-Flash scores fraud_risk at 2.45 of 3 with HMAC-pseudonymized IBANs and SHA-256 record hashes.

Expanded Audit log record on scenario 22_madrid_vulnerable_foreign_instant (Hold in 158 ms under sepa-instant-dach): Clef-Flash returns fraud_risk 2.45 of 3 alongside HMAC-hashed IBANs (h:89dc024a9c3e83bb) and chained SHA-256 hashes.

4. Run benchmarks from the CLI or embed FraudEngine in Python

All console operations map directly to the fraudclef CLI for CI pipelines, shadow-mode replay, and scheduled audit verification:

# Score the 27 European scenarios against Clef-Flash on Regolo
uv run fraudclef score data/scenarios --policy policies/retail-eu.yaml --backend regolo

# Compare always vs cascade routing on the Eurozone multi-channel portfolio
uv run fraudclef bench --dataset data/random_dataset.json --policy policies/retail-eu.yaml --backend regolo --routing always,cascade --concurrency 3

# Verify that no line in logs/decisions.jsonl was edited, reordered, or deleted
uv run fraudclef audit-verify logs/decisions.jsonl

# Run the 70 offline tests plus the live /v1/systemone contract check
uv run python -m pytest && uv run python -m pytest -m liveCode language: PHP (php)

To embed the engine inside an existing payment gateway or Kafka stream consumer, instantiate FraudEngine with your YAML policy, regolo_backend("clef-flash"), a keyed Pseudonymizer, and an AuditLog:

import asyncio
import json
import os
from pathlib import Path

from fraudclef.audit import AuditLog
from fraudclef.backends import regolo_backend
from fraudclef.engine import FraudEngine
from fraudclef.models import ScoringRequest
from fraudclef.policy import load_policy
from fraudclef.privacy import Pseudonymizer


async def score_payment(payload: dict) -> dict:
    policy = load_policy("policies/sepa-instant-dach.yaml")
    backend = regolo_backend(policy.model.name)  # reads REGOLO_API_KEY from env
    audit = AuditLog("logs/decisions.jsonl", hash_chain=True)
    pseudo = Pseudonymizer(os.environ["FRAUDCLEF_HMAC_KEY"])

    engine = FraudEngine(policy=policy, backend=backend, audit=audit, pseudonymizer=pseudo)
    try:
        req = ScoringRequest.model_validate(payload)
        decision = await engine.score(req, context={"source": "sepa-gateway"})
        return {
            "action": decision.decision,         # approve | step_up | hold | block
            "decided_by": decision.decided_by,   # rule | prescore | model | fail_mode
            "risk_score": decision.risk_score,   # 0.0 to 1.0 combined risk
            "sca_exemption": decision.sca_exemption,
            "latency_ms": decision.latency_ms,
            "reasons": [r.model_dump() for r in decision.reasons],
        }
    finally:
        await engine.aclose()


if __name__ == "__main__":
    sample = json.loads(Path("data/scenarios/16_frankfurt_spoofed_hotline_app.json").read_text())
    print(asyncio.run(score_payment(sample["request"])))Code language: Python (python)

Meeting DORA, GDPR, PSD3/PSR, and AI Act requirements by design

For European banks, electronic money institutions, and insurers managing card or payout rails, compliance constraints shape the code as much as latency:

  • EU AI Act fraud-detection exception (Regulation (EU) 2024/1689, Annex III point 5(b)): As documented on the European Commission AI Act Service Desk, AI systems evaluating creditworthiness are high-risk, with the explicit exception of AI systems used for the purpose of detecting financial fraud. Keep your fraud engine strictly separated from credit-underwriting pipelines to preserve that status, while maintaining human oversight and audit logs as standard model-risk governance.
  • Instant Payments VoP and PSD3/PSR liability: Mandatory IBAN-name Verification of Payee has applied across the euro area since October 9, 2025 under Regulation (EU) 2024/886, and the final EU Council PSD3 and PSR compromise texts published on April 23, 2026 expand PSP refund duties on bank-employee impersonation scams (expected to apply in late 2027 or early 2028). Combining vop_mismatch with recent contact changes and Clef-Flash’s app_scam pattern lets a bank hold suspicious transfers for a human callback before funds leave.
  • GDPR Article 22 and data minimization: privacy.py replaces IBANs, names, customer IDs, creditor IDs, and device IDs with keyed HMAC-SHA256 digests and strips free-text merchant descriptions before sending the state to our Zero Data Retention infrastructure. Every hold or block writes a canonical JSON record chained to the previous record’s SHA-256 hash (verifiable via fraudclef audit-verify) so analysts can inspect and contest automated decisions.
  • DORA operational resilience (Regulation (EU) 2022/2554): Under DORA (applicable since January 17, 2025), an external inference API is an ICT third-party dependency. fraudclef enforces per-channel timeouts and a rolling circuit breaker so payments never stall when an API degrades, and because Clef-Flash is licensed under Apache-2.0, the exact same YAML policies and /v1/systemone contract run unchanged on dedicated GPUs or on-premises SGLang clusters (compare open-weight deployment options).
ARCHITECTURE & COMPLIANCE MAP · REGOLO LABS
Matching payment workloads to deterministic rules, Clef-Flash, and GPU capacity

Keep known typologies and habitual spend on CPU, route contextual grey-zone payments to Clef-Flash, and size dedicated Apache-2.0 replicas for strict card SLAs.

1. Payment scenario & signal
2. Recommended pattern
3. Banking & regulatory outcome
Habitual spend & hard typologies
Groceries, recurring bills, sanctions, mule IBANs, 900 km/h travel
72% to 91% of retail card and transfer volume with clear tabular boundaries.
→
Local CPU gate
YAML rules + GBDT pre-score
Sub-millisecond evaluation with TreeSHAP or feature weights
0.2 ms p50$0 API cost
→
Retail issuers & acquirers
Zero friction on everyday spend + PSD2 TRA exemptions
Provides stand-in processing on POS cards if external networks degrade.
Contextual grey zone
SEPA Instant (≥€250 to €500), VoP mismatches, APP scams, ATO, new SDD
Multi-signal combinations where static rules cause alert fatigue and false blocks.
→
Single-pass decision API
Clef-Flash on /v1/systemone
2 typed YAML questions (choice + 0-3 score) over 10 past tx
~$0.0004/call0 output tokHMAC + ZDR
→
EU banks, EMIs & insurers
Zero-retraining policy updates with four-eyes governance
Aligned with Reg. (EU) 2024/886 VoP, PSR impersonation rules, and AI Act Annex III 5(b).
High-throughput card SLA
50,000 payments/min peaks (~830 RPS) with <150 ms model ceiling
Tier-1 issuer workloads where shared multi-tenant queueing breaks tail latency.
→
Dedicated or on-prem GPU
3 to 5 H200 GPUs (SGLang / vLLM)
Cascade cuts fleet 20x vs scoring 100% of traffic (41-93 GPUs)
38.8 ms H200 p50Apache-2.0
→
CISO & DORA compliance
Full DORA exit strategy with identical YAML policies
Move between our dedicated EU GPUs and on-premises clusters without code changes.
Source: fraudclef architecture & sizing benchmarks on Regolo (Nov 12, 2026), ECB payment statistics H2 2025 (Jul 22, 2026), and Cloudflare/clef-flash H200 benchmarks.
ZERO DATA RETENTION
Get engineering notes and model releases in your inbox.

Sovereign AI inference, OpenAI-compatible, EU-hosted. Benchmarks, new models (Mistral, Qwen, GLM), and cost insights. One email, no spam.

✓
Thank you for subscribing!

Please check your inbox to confirm your subscription.

100% European infrastructure · Zero spam · Unsubscribe anytime.

Frequently asked questions

Is an AI payment fraud detection model classified as high-risk under the EU AI Act?

No, provided it is used strictly for fraud detection. Annex III, point 5(b) of Regulation (EU) 2024/1689 classifies creditworthiness and credit-scoring AI as high-risk, with an explicit exception for AI systems used for detecting financial fraud. If your team reuses the same score to set overdraft limits or loan eligibility, that exemption no longer applies.

Why use Clef-Flash on /v1/systemone instead of a chat LLM for transaction scoring?

A chat LLM generates tokens one by one and forces your application to parse JSON text, which adds hundreds of milliseconds of latency and output token fees. Clef-Flash uses a joint schema head on top of a 9B backbone to score every allowed option of your policy questions in a single forward pass, returning structured probabilities with zero output tokens.

Why should cloud API timeouts differ from co-located card authorization timeouts?

Over public HTTPS to a shared multi-tenant API, sequential 2-question calls hit a 148 ms median, while concurrent batches reach 500 to 900 ms due to internet transit and queueing. Setting a 150 ms card timeout against a shared cloud endpoint trips the DORA circuit breaker and forces fallback decisions. Keep 3,000 ms timeouts when evaluating over the shared API, and tighten card timeouts to 150 ms only on dedicated H200 replicas co-located in the same region (38.8 ms median).

When do deterministic rules outperform a 9B decision model on payment fraud?

Whenever the signal is a clean arithmetic or lookup boundary, such as sanctioned countries, interbank mule IBAN feeds, physically impossible card-present travel above 900 km/h, or foreign card cloning outside a customer’s 90-day country profile. On the IBM TabFormer 2019-2020 holdout, a single usual-country rule stopped 90% of cloned-card fraud at zero GPU cost, whereas Clef-Flash adds value on multi-signal grey zones like impersonation scams, account takeover, and new direct debit mandates.

How does fraudclef handle DORA resilience and customer privacy?

Before a grey-zone payment leaves the scorer process, fraudclef hashes customer IDs, IBANs, beneficiary names, creditor IDs, and device IDs with a secret HMAC key and drops free-text fields. If the model endpoint times out or trips the circuit breaker, each payment rail falls back immediately to a policy-defined safe action (such as stand-in pre-scoring on small POS taps and mandatory step-up on SEPA Instant), while Apache-2.0 weights guarantee a clean DORA exit path.

PRODUCTION-READY EU INFERENCE · ZERO DATA RETENTION OpenAI-Compatible API
Ship Private AI. Not Infrastructure.

You have the architecture and the open-source workflow. Now give it a sovereign European inference layer built for production: fast access to GLM-5.2, Qwen3.8-27B, Qwen3.5-122B, Gemma 4, Mistral Small 4, and Brick (brick-v1-beta) with zero data retention and no new SDK to learn.

DROP-IN ENDPOINT export OPENAI_BASE_URL="https://api.regolo.ai/v1" Keep your existing SDK & agent setup
Private AI should not require a private data center. Regolo gives your team an EU-native path from local experimentation to production-grade inference.