SENIORAICHAPTER 56

AI on the rails: success-rate anomalies, mule scoring and the human controls

A model that watches the network is graded on what it never raised an alert for. Start from the threshold an operator would write, count the alerts the model adds, and decide who may act on its word

60 MINPAYMENTSUPDATED 2026-11-18
PREDICT

Ezinne trains a mule model on the labels Northmere actually has: the 10 accounts that received a victim's money in a reported fraud. She sets the threshold so that all 10 are flagged. The week also contains 37 second-hop mule accounts, which receive money from those 10 and cash it out. How many of the 47 mule accounts does the model flag?

What a model can watch on the rails

An instant transfer leaves a trail in several places. The sending bank logs the debit and the answer it got. The switch logs the name enquiry, the transfer, the response code and the time. The receiving bank logs the credit. The earlier chapter on Nigeria’s rails names the parts, and the one on payment states explains the response codes. The week in labs/finance (a generated week, Monday 15 to Sunday 21 June 2026) holds 17,998 transfers and 12,158 name enquiries across 32 participants. Northmere is participant B05 in it. Every code, limit and timing in it is illustrative: none of them is NIBSS’s or the CBN’s.

Two kinds of thing can go wrong there, and they need different watchers.

The network itself. A bank goes down, a switch slows, a bank hits a limit. The signals are rates and counts: how many transfers a participant handled this hour, what share of first responses were a timeout (the lab’s code 97, which other platforms define differently), whether a name enquiry was answered 91, meaning the bank is unavailable. The event is an incident. The people who act are operations staff, and the action is to find out, tell people and, at the switch, perhaps route around the fault. The later chapters on running a switch and on when a bank or a switch goes down are about those people.

The people using it. A fraudster takes money from a victim’s account and passes it through accounts that exist to forward it, called mule accounts. The first account to receive the victim’s money is the first hop. The accounts it pays onwards are the second hop. The signals are behaviours of single accounts: how old the account is, how fast it forwards money, how many ways it splits it. The event is a crime. The people who act are a fraud desk, and the action touches a customer, which is a much heavier thing than a rate on a dashboard. The chapter on fraud between banks follows the money through the chains; this one only needs their signals.

No institution in real life sees all of this. A switch sees every transfer but not the cash taken out at an agent, an ATM or a point-of-sale terminal. A bank sees its own customers’ side of each transfer and little of what happens in other banks. The lab merges the views so that you can compare methods. Keep in mind that a real team would have a part of it, and that what it lacks decides what any model can learn.

Before you build anything, answer three questions for each watcher. What is the signal? What is the event it is meant to find? Who acts, and how much harm does a wrong action do? The rest of the chapter is those three questions, asked of a rule and then of a model.

Start with the threshold an operator would write

Step 1 writes three rules from what an operator already knows, with no model at all.

Rule A: a name enquiry answered 91. A participant has said it is unavailable. Rule B: in a ten-minute window with at least 20 transfers, at least 10% of first responses are 97, the lab’s timeout code. Rule C: any transfer answered 51, which in the lab means the sender is over its limit at the switch.

In the week, rule A fires 11 times, all on B07 between Wednesday 17 June at 11:07 and 11:48, the first when B15 asked B07 and was told the bank was unavailable. Rule B fires once, on Thursday at 15:20, with 15 timeouts in 38 transfers. Rule C fires on B13, four transfers recorded from 12:16 to 12:18 on Friday, all before B13’s top-up at 12:19. The lab’s outages table lists B07’s outage (11:02 to 11:49) and a switch incident (15:20 to 15:34), and the third event, B13 hitting its limit, is one you can confirm from its transfers. Three rules, three real events, no false alert.

A tidy result like this deserves suspicion, so look at how it depends on the numbers you chose.

Rule B threshold Alerts in the week What that means
5% 2 the real window and one that is chance: 2 timeouts in 38 transfers is enough
10% 1 the real window
15% 1 the real window, 15 of 38 (39%), which clears any of these by a distance; a milder incident would not

Of the 1,008 ten-minute windows in the week, 401 have 20 or more transfers; the 20-transfer floor is what stops a window with two transfers and one timeout from being a 50% failure. It also costs something: the 15:30 window, still inside the incident, has 19 transfers (5 of them timeouts), so rule B never looks at it. Each rule has a blind spot you can name. Rule A fires only if somebody asks the failed bank something. B07 is a large bank, so someone asked within five minutes; a small bank, or a quiet hour, could stay unasked far longer, and a bank that is down while no one calls it looks like silence. The outage also shows on the transfers themselves, where four sent to B07 between 11:29 and 11:39 were answered 91, and rule A does not count them. About a third of transfers (6,254 of 17,998) reuse a saved beneficiary and carry no name enquiry, so a rule that reads name enquiries alone sees only part of the traffic. Rule B is blind to a slow bank whose timeouts spread across hours at 3%, which is how the lab’s B19 behaves. A threshold is only as good as the operator’s picture of failure. That is the case for a learned baseline, and the next section tests it.

A learned baseline, and what it costs

A learned baseline replaces “what the operator expects” with “what the data did on days known to be normal”. Step 2 builds two, using only Monday and Tuesday as training data, and scores Wednesday onwards.

The volume model asks whether a participant is quieter than usual for that hour. Its expected count for a participant in an hour is the participant’s share of Monday and Tuesday’s traffic times the network’s volume for that hour of the day. The count is modelled as a Poisson variable: counts of independent events in a fixed time, whose chance of any value follows from one number, the mean. The model scores how unlikely the observed count is as its surprise, the negative base-10 logarithm of that chance. A surprise of 2 is a one-in-a-hundred event, and 3 is one in a thousand. Only participant-hours with an expected count of 1 or more are scored, since a bank expected to carry nothing cannot be quiet.

The timeout model does the same for the switch as a whole: Monday and Tuesday had 19 timeouts in 5,989 first responses, 0.0032, and each later ten-minute window is scored by how unlikely its count of timeouts is at that rate (a binomial tail).

Here is what they found: the volume model on Wednesday to Friday, the timeout model on every window from Wednesday to Sunday.

Model and threshold Alerts Real
Volume, surprise 2.0 4 1 (B07)
Volume, surprise 2.5 3 1 (B07)
Volume, surprise 3.0 1 1 (B07)
Timeouts, surprise 2.0 4 2 windows inside the incident
Timeouts, surprise 3.0 2 the Thursday 15:20 and 15:30 windows

B07’s outage hour ranks first of 2,001 scored participant-hours: 10 transfers where about 26.4 were expected, a surprise of 3.62. The other three alerts at surprise 2 are B12 and B14 on Wednesday at 18:00 and B01 on Thursday at 14:00, and nothing in the lab’s data explains them. They are the chance events a one-in-a-hundred alert produces: across 2,001 participant-hours at 1%, you can expect up to about twenty by luck, and the model produced four. Setting the volume model and the timeout model both to 3.0 gives three weekday alerts, all real. That looks as good as the three rules, but it was chosen by looking at which alerts were real, and the same threshold raises 100 alerts on the weekend. The three rules gave three real events and no false alert.

Then compare what each saw, and when.

Threshold rules Learned baseline
B07’s outage (11:02 to 11:49) alert at 11:07, five minutes in alert at 12:00, 11 minutes after it ended
Switch incident (15:20 to 15:34) alert when the window closes, 15:30 the same
B13 over its limit found by rule C not found: the model has no feature for 51
False alerts, Wednesday to Friday 0 3 at surprise 2; 0 at 3.0, but 100 on the weekend

The baseline finds the outage the threshold already found, 53 minutes later, and adds false alerts unless the threshold is set where the weekend breaks it. It does earn one thing: it found B07 from the dip in its traffic, with no one asking B07 a question, which is how it could find a small bank that nobody queries. Reading that as a win for the model needs care, though. The hour was scored when it closed. A rolling window would cut the delay, and a shorter window would make every count smaller and noisier.

The same trade shows up when the model is not a toy. Counting alerts at lower thresholds gives step 5’s table: if every alert at surprise 2 goes to an analyst for 15 minutes (an assumption you can change), Wednesday to Sunday costs 63.5 hours of analysts for one real event. The weekend explains most of it. Saturday and Sunday carried about 1,500 transfers a day against about 3,000 on weekdays, and a model trained on two weekdays has never seen a weekend: 250 alerts at surprise 2 came from Saturday and Sunday, against 4 from Wednesday to Friday. Training on more weeks would fix that, but the lab holds only one week, so you cannot test it here. In a real network, calendar effects such as month ends, salary days and public holidays do the same, and the model has to meet them in its training data before it can know them.

Google’s SRE Workbook gives four properties for judging an alert: precision (the share of alerts that matter), recall (the share of events that raise one), detection time and reset time. It is written about service-level objectives, but it is the right frame here. Ask of the model what you would ask of any alert, at the alert volume you can afford to read. A bigger model, with more features and seasonal terms, moves the curve and does not remove it: every point on it is a number of alerts. It earns its place only if, at equal alert volume, it finds events the rules do not. The hard work is naming the events, which is building the key.

Mules: what the labels cover

A mule rule needs signals the bank can see. Step 3 computes four for every account that received a transfer of ₦50,000 or more that week (926 accounts; the ₦50,000 floor is the lab’s own choice): how much of the transfer left within 30 minutes, how many outward transfers carried it, how soon the first one left, and how much was cashed out within an hour. The rule flags an account when at least half of one inbound transfer was gone within 30 minutes by transfer or within an hour by cash-out.

It flags 47 accounts: 10 that forward the money in three to five transfers, and 37 that have it cashed out. No other account in the week behaves that way.

Step 4 trains the model on the labels a bank has. Reports arrive from victims’ banks, and each names the transfer that took the victim’s money. In the lab that is 10 reported sessions, and the labelled accounts are the 10 that received them. The model is the same kind as the fraud scoring chapter built: a logistic regression on standardised features, fitted in pure Python. The threshold is the lowest score among the labelled accounts, so that every reported account is caught, which is how a team would set it to keep its known cases.

Only then does the script open answers/mule_truth.csv, which says which of the 926 accounts are mules and at which hop. Results:

first hop (10) second hop (37) not mules
rule from step 3 10 37 0
model at that threshold 10 0 0

The model’s weights say why: fan-out carries 0.68 per standard deviation and the other features 0.13 to 0.21, because every labelled account split its money. The 37 second-hop accounts have no outward transfers and score between 0.011 and 0.027, and some accounts that are not mules score higher, up to 0.055. The model catches what its labels describe, and fraud reports describe the first hop. The rule catches the second hop because an analyst who knew the second hop wrote it down.

It would be wrong to read that as “rules beat models”. Feed the model the labels for all 47 accounts and it catches all 47 (the break at the end of the lab does this). The algorithm was never the limit. The labels were. Reports arrive late and name one account per fraud, which is the same label problem the fraud scoring chapter measured for cards, and the rest of the chain is found only when somebody follows it.

Account age does not separate the mules, and the data is still too clean, so say that before anyone quotes these scores. Of the 47 flagged accounts, 30 were 30 days old or less at the transfer (3 to 27 days) and 17 were older (102 to 1,151 days), the kind of account that has been rented out. And 44 of the 879 ordinary accounts that received ₦50,000 or more were 30 days old or less as well (the youngest is 1 day), because new customers receive money too. A rule on age alone would flag 74 accounts, 30 of them mules, and miss 17 of the 47. What does separate them here is behaviour: every mule passes at least half of one transfer on within the hour, and no ordinary account does. The generator planted that, so the rule’s 47 of 47 with no false flag measures the generator. Real mule detection is harder than any lab: real mules pass on part of the money, over days, among ordinary spending, and ordinary accounts sometimes forward quickly. Treat the score as a test of the code and nothing more.

Two research projects from the Bank for International Settlements (BIS) are worth reading against this. Both ran on synthetic data. Project Hertha, a BIS Innovation Hub and Bank of England project, ran its experiments on a simulated data set of 1.8 million accounts and 308 million transactions, and its project page says the analytics helped find 12% more illicit accounts than would otherwise have been found, and a 26% improvement on previously unseen behaviours, with practical, legal and regulatory questions out of scopeas of 2026-11. That description comes from search summaries of the BIS pages, which this chapter did not open in full, and it is a result on synthetic data, not on real banks. Its predecessor, Project Aurora (report of 31 May 2023), says that payments data combined with privacy-enhancing technologies, machine learning and network analysis helped detect complex money-laundering schemes across institutionsas of 2026-11, again from summaries, on synthetic data. Both point at what the second hop needs: a view across banks. A model run inside one bank sees the second hop only when the money lands there, and it learns only from labels that bank confirms.

What the rules say, as far as search showed

This section states what search results showed and where they stopped.

A law-firm note on the CBN’s circular of 12 March 2026, which took effect on 1 July 2026, says financial institutions must implement and activate enterprise fraud monitoring for both inflows and outflows, and imposes inflow and outflow limits (₦20,000 in press reports) on a newly activated mobile banking applicationas of 2026-11. The note and other search results are law-firm and press summaries: this chapter did not open the CBN’s own text, and sources differ on the cap’s scope and duration. Read the circular before you rely on its scope or wording. Two things follow for the lab. Monitoring of inflows as well as outflows is what the mule signals above are. The cap attaches to a newly activated app, not to the age of an account, so it does not replace an account-age signal.

Search found no CBN or NIBSS document that says how a bank must use machine learning or AI in fraud monitoring. What it found was commentary urging it, so this chapter states no such rule. NIBSS publishes an annual fraud landscape report, and a 2023 edition appears in the search results (see Reading); this chapter did not read it and quotes none of its figures. Press reports describe a draft CBN framework on authorised push payment fraud (where the victim authorised the payment, having been deceived) reported in December 2025, with reporting and refund windows that the reports give differently. The search results gave no CBN text, so this chapter states none of its terms. If a final framework binds your institution, the cost of a missed second hop is no longer only the victim’s, and an alert budget has to be set with that in mind.

On blocking an account, commentary in the results says banks use post-no-debit restrictions, which stop debits but allow credits, where fraud is suspected, cites a CBN circular on fraud desks, and reports that Nigerian courts have differed on whether a bank may restrict an account without a court order. This chapter states no rule from it. Take the question to counsel, and write the policy so that it can be shown to a court.

Who may act on a score

A model’s score is information. An action is a decision with a victim if it is wrong. The two should not share a door.

Rank the actions by how much harm a wrong one does and how easily it is undone.

Action Harm if wrong Undone by Who may order it (this lab’s policy)
Put an alert in a queue an analyst’s 15 minutes nothing needed the model alone
Hold one outward transfer for review a customer’s payment is late releasing the hold one analyst, with a score above a floor
Restrict an account a person cannot get at their money lifting it, after the damage an analyst and the fraud lead, with a reason code, and the customer told how to reach a person
Reroute switch traffic other institutions’ customers are affected rerouting back the shift lead and the incident lead; no score counts as an approver

Step 5 writes that table as data and tests eight decisions against it. Three properties matter more than the numbers in it. A score can open the door to an action, as a floor, but it never counts as an approver. Every action above a queue needs a reason code, so the log says why. And the actions that cannot be undone, or that affect other institutions, need two people.

A policy in data is also something a validator can read. The fraud scoring chapter covers what a validator checks: an inventory, independent validation, monitoring and a way to switch the model off. For a model that can touch a customer’s money, add the false-alert table from this chapter and the count of which cases the labels do not cover.

The law also has a view. Section 37 of the Nigeria Data Protection Act 2023 is described by commentary as limiting decisions based solely on automated processing that have a legal or similar impact, with exceptions such as consent or legal authorisation, and, where such a decision is allowed, a right to ask for human involvement, to state a view and to contest itas of 2026-11. That is from law-firm commentary in search results. The DataGuidance copy of the Act appeared in search only as a table of contents listing section 37 as automated decision making; this chapter did not read the operative text or the gazetted version, and commentary differs on the exceptions. Ask counsel whether restricting an account is a significant effect. The human-approval rows in the table are the safer design either way.

A switch is a different case from a bank. A bank’s wrong block hurts its own customer. A switch’s wrong reroute hurts every institution on the network, and those institutions did not agree to the model. That is why the table puts the switch’s decision with people who can call the other institutions, whatever the score says.

What the lab cannot show

It is one week, generated, with two infrastructure events and 47 mule accounts. The volume model learned from two days, the mule model from ten labels, and neither result has an interval you could trust. Every generated mule moves money on within the hour, which real mules need not. The lab’s response codes, thresholds and timings are invented, and the policy is an example, not Northmere’s or any regulator’s. What carries over is the method: write the rule, count what the model adds at equal alert volume, find out what the labels cover, and decide who acts.

LAB Compare a threshold, a learned baseline and a mule model on one generated week ~60 MIN
YOU NEEDPython 3.9 or later (standard library only)labs/finance: rails.py writes the week in about 3 secondsa free chat assistant or a local model for step 6 (no paid account); steps 0 to 5 need no model

You work in labs/finance. Every script is standard library only and lives in a new ai/ folder. The sqlite3 command-line tool may not be installed, so the scripts use Python’s sqlite3 module. Steps 1, 2, 3 and 5 never open answers/. Step 4 opens answers/mule_truth.csv after the model is trained, to grade it. Results are exact for seed 42 at scale 1.

0. Generate the week and check it.

cd labs/finance
python3 rails.py
python3 check.py --rails-only
mkdir -p ai
32 participants, 22,835 accounts, 17,998 transfers, 12,158 name enquiries, 136 status queries
21 settlement sessions, 125 batch files, 193 RTGS payments, 3,412 USSD sessions, 3,453 PSB postings
planted (answers/rails_truth.csv): credited_without_settlement 4, customer_fee_not_charged 6, customer_reversed_twice 3, levy_not_charged 5, mmo_trust_shortfall 1, participant_limit 4, participant_outage 1, psb_cash_out_fee_not_posted 1, psb_cash_out_posted_twice 1, reversed_after_late_success 4, same_number_two_banks 8, switch_incident 1, telco_record_missing 12
rails week: 17,998 transfers, 21 settlement sessions, 22,835 accounts; checks 21-25 run
OK: all invariants hold

The first three lines are rails.py’s, the last two check.py’s. The week is Monday 15 to Sunday 21 June 2026. Do not open data/answers/ yet.

1. Write the shared library. railslib.py holds what the later steps share: the time helpers, the Poisson and binomial models, the mule features and a logistic regression. Money is integer kobo throughout; naira() only formats it.

cat > ai/railslib.py <<'EOF'
"""Shared code for the AI-on-the-rails lab. Standard library only. Money is integer kobo."""
import collections, datetime as dt, math, sqlite3

DB = "data/rails.sqlite"
WAT = dt.timezone(dt.timedelta(hours=1))
T0 = dt.datetime(2026, 6, 15, tzinfo=WAT)          # Monday 00:00, the start of the week
TRAIN_HOURS = 48                                   # the model learns from Monday and Tuesday only
MULE_MIN_IN = 50_000 * 100                         # ILLUSTRATIVE: inbound transfers below ₦50,000 are ignored


def connect():
    return sqlite3.connect(DB)


def when(text):
    return dt.datetime.fromisoformat(text)


def hour_of(text):                                  # hours since Monday 00:00
    return int((when(text) - T0).total_seconds() // 3600)


def window_of(text, minutes):
    return int((when(text) - T0).total_seconds() // (60 * minutes))


def label(hour):                                    # 59 -> 'Wed 11:00'
    return (T0 + dt.timedelta(hours=hour)).strftime("%a %H:%M")


def window_label(k, minutes=10):                    # window 524 -> 'Thu 15:20'
    return (T0 + dt.timedelta(minutes=minutes * k)).strftime("%a %H:%M")


def naira(kobo):
    return f"₦{kobo // 100:,}"


# ---------------------------------------------------------------- the network monitor
def binom_tail(k, n, p):
    """P(X >= k) for X ~ Binomial(n, p)."""
    return sum(math.comb(n, i) * p ** i * (1 - p) ** (n - i) for i in range(k, n + 1))


def poisson_cdf(k, mu):
    """P(X <= k) for X ~ Poisson(mu)."""
    return sum(math.exp(-mu) * mu ** i / math.factorial(i) for i in range(k + 1))


def surprise(p):
    """-log10 of a probability: 2 means 1 in 100, 3 means 1 in 1,000."""
    return -math.log10(max(p, 1e-15))


def switch_windows(db, minutes=10):
    """Per window, the whole switch: [transfers, first responses of 97 (timeout)]."""
    w = collections.defaultdict(lambda: [0, 0])
    for at, first in db.execute("SELECT at, first_response FROM transfers"):
        k = window_of(at, minutes)
        w[k][0] += 1
        w[k][1] += first == "97"
    return w


def bank_hours(db):
    """Transfers touching each participant (as sender or receiver) in each hour."""
    c = collections.Counter()
    for src, dest, at in db.execute("SELECT src, dest, at FROM transfers"):
        h = hour_of(at)
        c[(src, h)] += 1
        c[(dest, h)] += 1
    return c


class VolumeModel:
    """Expected transfers per participant-hour = the participant's share of Monday-Tuesday traffic
    times the network's volume for that hour of the day. A Poisson model, learned from two days."""
    def __init__(self, counts, banks):
        total = sum(counts[(b, h)] for b in banks for h in range(TRAIN_HOURS))
        self.share = {b: sum(counts[(b, h)] for h in range(TRAIN_HOURS)) / total for b in banks}
        self.by_hour = [sum(counts[(b, h)] for b in banks for h in (hh, hh + 24)) / 2 for hh in range(24)]

    def expected(self, bank, hour):
        return self.share[bank] * self.by_hour[hour % 24]

    def surprise_low(self, bank, hour, seen):         # how unlikely is a count this low?
        return surprise(poisson_cdf(seen, self.expected(bank, hour)))


# ---------------------------------------------------------------- the mule signals
def mule_features(db):
    """For each account that received a transfer of at least MULE_MIN_IN: the inbound transfer that
    was forwarded fastest and most completely, and how soon. Only what the bank could see that week."""
    inbound, outward, cash = (collections.defaultdict(list) for _ in range(3))
    for at, src, dest, dacc, cacc, amt in db.execute(
            "SELECT at, src, dest, debit_account, credit_account, amount_kobo FROM transfers WHERE final_status = '00'"):
        inbound[(dest, cacc)].append((when(at), amt))
        outward[(src, dacc)].append((when(at), amt))
    for at, inst, no, amt in db.execute("SELECT at, institution, account_no, amount_kobo FROM cash_outs"):
        cash[(inst, no)].append((when(at), amt))
    opened = {(i, n): dt.date.fromisoformat(o) for i, n, o in db.execute("SELECT institution, account_no, opened FROM accounts")}
    out = {}
    for key, ins in inbound.items():
        best = None
        for t, amt in ins:
            if amt < MULE_MIN_IN:
                continue
            fwd = [(u, a) for u, a in outward.get(key, []) if t < u <= t + dt.timedelta(minutes=30)]
            cso = [(u, a) for u, a in cash.get(key, []) if t < u <= t + dt.timedelta(minutes=60)]
            passed = (sum(a for _, a in fwd) + sum(a for _, a in cso)) / amt
            first = min([(u - t).total_seconds() / 60 for u, _ in fwd + cso], default=999.0)
            row = dict(fan_out=len(fwd), passed=passed, minutes=first, cash_outs=len(cso), amount=amt,
                       age_days=(t.date() - opened[key]).days)
            if best is None or row["passed"] > best["passed"]:
                best = row
        if best:
            out[key] = best
    return out


def sigmoid(z):
    return 1.0 / (1.0 + math.exp(-z)) if z > -30 else 0.0


def vector(f):
    """Four behaviour features, each scaled to about 0..1. Account age is left out on purpose."""
    return [min(f["fan_out"], 5) / 5, min(f["passed"], 1.0),
            1 - min(f["minutes"], 60) / 60 if f["minutes"] < 999 else 0.0, math.log10(f["amount"] / 100) / 6]


def fit(xs, ys, l2=10.0, iters=400, rate=0.5):
    """Logistic regression by batch gradient descent on standardised features, with an L2 penalty."""
    d, n = len(xs[0]), len(xs)
    mu = [sum(x[j] for x in xs) / n for j in range(d)]
    sd = [max(1e-9, math.sqrt(sum((x[j] - mu[j]) ** 2 for x in xs) / n)) for j in range(d)]
    zs = [[(x[j] - mu[j]) / sd[j] for j in range(d)] for x in xs]
    w, b = [0.0] * d, math.log(sum(ys) / (n - sum(ys)))
    for _ in range(iters):
        gw, gb = [0.0] * d, 0.0
        for z, y in zip(zs, ys):
            e = sigmoid(b + sum(wi * zi for wi, zi in zip(w, z))) - y
            gb += e
            for j in range(d):
                gw[j] += e * z[j]
        w = [wi - rate * (g + l2 * wi) / n for wi, g in zip(w, gw)]
        b -= rate * gb / n
    return {"mu": mu, "sd": sd, "w": w, "b": b}


def score(m, x):
    return sigmoid(m["b"] + sum(w * (xi - mu) / sd for w, xi, mu, sd in zip(m["w"], x, m["mu"], m["sd"])))
EOF

Then the three threshold rules:

cat > ai/step1_threshold.py <<'EOF'
"""Step 1: three threshold rules on the network. Never opens answers/."""
import collections
from railslib import *

db = connect()
print("rule A: a name enquiry answered 91 (the bank says it is unavailable)")
for at, src, dest, no in db.execute("SELECT at, src, dest, account_no FROM name_enquiries WHERE response = '91' ORDER BY at"):
    print(f"  {at[:16]}  {src} asked {dest}")

print("\nrule B: in a 10-minute window of 20 or more transfers, at least 10% answered 97 (timeout)")
windows = switch_windows(db)
big = [k for k, (n, f) in windows.items() if n >= 20]
print(f"  {len(big)} of 1,008 windows have 20 or more transfers")
for share in (0.05, 0.10, 0.15):
    hits = sorted(k for k in big if windows[k][1] / windows[k][0] >= share)
    print(f"  at {share:.0%}: {len(hits)} alert{'s' if len(hits) != 1 else ''}", [(window_label(k), f"{windows[k][1]}/{windows[k][0]}") for k in hits] if share == 0.10 else "")

print("\nrule C: a transfer answered 51 (the sender is over its limit at the switch)")
for src, n, first, last in db.execute("SELECT src, COUNT(*), MIN(at), MAX(at) FROM transfers WHERE first_response = '51' GROUP BY src"):
    print(f"  {src}: {n} transfers between {first[11:16]} and {last[11:16]} on {first[:10]}")

print("\nwhat the outages table says happened:")
for who, start, end, what in db.execute("SELECT * FROM outages"):
    print(f"  {who:7s} {start[:16]} to {end[11:16]}  {what}")
EOF
python3 ai/step1_threshold.py
rule A: a name enquiry answered 91 (the bank says it is unavailable)
  2026-06-17T11:07  B15 asked B07
  2026-06-17T11:09  B20 asked B07
  2026-06-17T11:21  B18 asked B07
  2026-06-17T11:28  B22 asked B07
  2026-06-17T11:31  B22 asked B07
  2026-06-17T11:32  B22 asked B07
  2026-06-17T11:38  B03 asked B07
  2026-06-17T11:40  B17 asked B07
  2026-06-17T11:40  B08 asked B07
  2026-06-17T11:43  S02 asked B07
  2026-06-17T11:48  B11 asked B07

rule B: in a 10-minute window of 20 or more transfers, at least 10% answered 97 (timeout)
  401 of 1,008 windows have 20 or more transfers
  at 5%: 2 alerts 
  at 10%: 1 alert [('Thu 15:20', '15/38')]
  at 15%: 1 alert 

rule C: a transfer answered 51 (the sender is over its limit at the switch)
  B13: 4 transfers between 12:16 and 12:18 on 2026-06-19

what the outages table says happened:
  B07     2026-06-17T11:02 to 11:49  participant unavailable
  switch  2026-06-18T15:20 to 15:34  degraded: timeouts across participants

Eleven name enquiries to B07, the first five minutes into its 47-minute outage, trip rule A. Rule B finds the Thursday window at 10% and two windows at 5%, one of them chance. Rule C finds B13’s four declined transfers. The outages table lists the first two events.

2. Learn a baseline from Monday and Tuesday and score the rest.

cat > ai/step2_baseline.py <<'EOF'
"""Step 2: learn what normal looks like from Monday and Tuesday, then score the rest of the week. Never opens answers/."""
from railslib import *

db = connect()
banks = [r[0] for r in db.execute("SELECT code FROM participants")]
counts = bank_hours(db)
model = VolumeModel(counts, banks)
outage_bank, outage_hours = "B07", {hour_of("2026-06-17T11:02:00+01:00"), hour_of("2026-06-17T11:49:00+01:00")}

# (a) volume: is a participant quieter than its normal hour? Only participant-hours expected to carry 1 or more.
rows = []
for h in range(TRAIN_HOURS, 168):
    for b in banks:
        mu = model.expected(b, h)
        if mu >= 1.0:
            rows.append((model.surprise_low(b, h, counts[(b, h)]), b, h, counts[(b, h)], mu))
rows.sort(reverse=True)
weekday = [r for r in rows if r[2] < 120]          # Wednesday to Friday
weekend = [r for r in rows if r[2] >= 120]
print(f"(a) volume model: {len(weekday)} participant-hours scored Wed-Fri, {len(weekend)} on Sat-Sun")
print("    alerts at surprise >=    Wed-Fri   Sat-Sun   (surprise 2 = 1 chance in 100)")
for th in (2.0, 2.5, 3.0):
    print(f"    {th:<22.1f}{sum(r[0] >= th for r in weekday):7d}{sum(r[0] >= th for r in weekend):10d}")
print("    top 5 on Wed-Fri:")
for rank, (s, b, h, seen, mu) in enumerate(weekday[:5], 1):
    mark = "  <- the outage" if b == outage_bank and h in outage_hours else ""
    print(f"      {rank}. {b} {label(h)}  saw {seen}, expected {mu:.1f}, surprise {s:.2f}{mark}")
rank = next(i for i, r in enumerate(weekday, 1) if r[1] == outage_bank and r[2] in outage_hours)
print(f"    B07's outage hour ranks {rank} of {len(weekday)}")

# (b) timeouts: is the share of 97s in a 10-minute window higher than Monday-Tuesday's?
windows = switch_windows(db)
n0 = sum(windows[k][0] for k in range(288))
f0 = sum(windows[k][1] for k in range(288))
p0 = f0 / n0
print(f"\n(b) timeout model: Monday-Tuesday rate {f0} of {n0} first responses = {p0:.4f}")
scored = sorted(((surprise(binom_tail(windows[k][1], windows[k][0], p0)), k) for k in range(288, 1008) if windows[k][1]), reverse=True)
print("    alerts at surprise >=  all windows with a timeout")
for th in (2.0, 3.0):
    print(f"    {th:<22.1f}{sum(s >= th for s, _ in scored):4d}")
for s, k in scored[:4]:
    n, f = windows[k]
    print(f"      {window_label(k)}  {f} of {n} timeouts, surprise {s:.2f}")
EOF
python3 ai/step2_baseline.py
(a) volume model: 2001 participant-hours scored Wed-Fri, 1334 on Sat-Sun
    alerts at surprise >=    Wed-Fri   Sat-Sun   (surprise 2 = 1 chance in 100)
    2.0                         4       250
    2.5                         3       171
    3.0                         1       100
    top 5 on Wed-Fri:
      1. B07 Wed 11:00  saw 10, expected 26.4, surprise 3.62  <- the outage
      2. B12 Wed 18:00  saw 5, expected 15.6, surprise 2.75
      3. B01 Thu 14:00  saw 9, expected 21.6, surprise 2.72
      4. B14 Wed 18:00  saw 0, expected 4.8, surprise 2.08
      5. B12 Wed 19:00  saw 5, expected 13.0, surprise 1.97
    B07's outage hour ranks 1 of 2001

(b) timeout model: Monday-Tuesday rate 19 of 5989 first responses = 0.0032
    alerts at surprise >=  all windows with a timeout
    2.0                      4
    3.0                      2
      Thu 15:20  15 of 38 timeouts, surprise 15.00
      Thu 15:30  5 of 19 timeouts, surprise 8.44
      Sun 10:20  2 of 17 timeouts, surprise 2.88
      Thu 08:30  2 of 38 timeouts, surprise 2.18

B07’s outage hour ranks first of 2,001, and the three alerts below it that reach surprise 2 are hours that nothing in the data explains. The hour is scored at 12:00, after the outage ended at 11:49. The weekend flood (171 alerts at 2.5, against 3 on weekdays) is a model that has never seen a Saturday. In the timeout model, the 15:20 window scores 15.00 and the 15:30 window, also inside the incident, 8.44; Sunday 10:20 and Thursday 08:30 are chance.

3. Write the mule rule. This step never opens the key.

cat > ai/step3_mule_rule.py <<'EOF'
"""Step 3: a mule rule from three signals the bank can see. Never opens answers/."""
from railslib import *

db = connect()
feat = mule_features(db)
print(f"{len(feat)} accounts received a transfer of {naira(MULE_MIN_IN)} or more and completed it")
flag = {k: f for k, f in feat.items() if f["passed"] >= 0.5}
print(f"rule: at least half of one such inbound transfer left within 30 minutes (or was cashed out within 60)")
print(f"  flagged {len(flag)} accounts")
print("  by pattern:")
fan = [k for k, f in flag.items() if f["fan_out"] >= 3]
cash = [k for k, f in flag.items() if f["cash_outs"] >= 1]
print(f"    forwarded in {min(f['fan_out'] for f in flag.values() if f['fan_out'])}-{max(f['fan_out'] for f in flag.values())} transfers: {len(fan)}")
print(f"    cashed out at an agent, ATM or POS: {len(cash)}")
for key in sorted(flag, key=lambda k: -flag[k]["amount"])[:3]:
    f = flag[key]
    print(f"    e.g. {key[0]} {key[1]}  in {naira(f['amount'])}, {f['passed']:.0%} out in {f['minutes']:.0f} min, "
          f"fan-out {f['fan_out']}, account {f['age_days']} days old")
young = [k for k, f in feat.items() if f["age_days"] <= 30]
older = [k for k in flag if feat[k]["age_days"] > 30]
print(f"\nand a check on whether account age would do instead: accounts that were 30 days old or less at the transfer: {len(young)}; "
      f"of those, flagged by the rule: {sum(k in flag for k in young)}")
print(f"flagged by the rule but older than 30 days: {len(older)}")
EOF
python3 ai/step3_mule_rule.py
926 accounts received a transfer of ₦50,000 or more and completed it
rule: at least half of one such inbound transfer left within 30 minutes (or was cashed out within 60)
  flagged 47 accounts
  by pattern:
    forwarded in 3-5 transfers: 10
    cashed out at an agent, ATM or POS: 37
    e.g. F03 7232620142  in ₦1,654,697, 91% out in 5 min, fan-out 3, account 295 days old
    e.g. F01 3281227526  in ₦1,380,425, 92% out in 7 min, fan-out 3, account 13 days old
    e.g. B01 9587745777  in ₦1,091,955, 98% out in 8 min, fan-out 3, account 7 days old

and a check on whether account age would do instead: accounts that were 30 days old or less at the transfer: 74; of those, flagged by the rule: 30
flagged by the rule but older than 30 days: 17

The rule flags 47 accounts: 10 that split the money in three to five transfers and 37 that have it cashed out. The last two lines are the warning about age: 74 accounts were 30 days old or less at the transfer and the rule flags only 30 of them, while 17 of its 47 flags are older accounts, and the largest example is 295 days old. Age alone would miss a third of these accounts and flag 44 others. The key has not been opened, so the script cannot say which are mules, but what separates the 47 is what they did with the money.

4. Train on the labels the bank has, then open the key. The labels are the accounts that received a reported fraud. The threshold is the lowest score among them.

cat > ai/step4_mule_model.py <<'EOF'
"""Step 4: train on the labels the bank has, then open the key and grade the rule and the model by hop."""
import csv, json
from railslib import *

db = connect()
feat = mule_features(db)
reported = {r[0] for r in db.execute("SELECT session_id FROM fraud_reports")}
labelled = {(d, c) for s, d, c in db.execute("SELECT session_id, dest, credit_account FROM transfers") if s in reported}
keys = sorted(feat)
xs = [vector(feat[k]) for k in keys]
ys = [1 if k in labelled else 0 for k in keys]
print(f"{len(keys)} accounts, {sum(ys)} labelled: the account that received each reported fraud")
model = fit(xs, ys)
names = ["fan_out", "passed", "speed", "log_amount"]
print("weights per standard deviation:", {n: round(w, 2) for n, w in zip(names, model["w"])})
scores = {k: score(model, x) for k, x in zip(keys, xs)}
cut = min(scores[k] for k in labelled)
print(f"threshold = the lowest score among the labelled accounts = {cut:.3f}")

rule = {k for k, f in feat.items() if f["passed"] >= 0.5}
model_flags = {k for k, s in scores.items() if s >= cut}
print("\nopening answers/mule_truth.csv (47 mule accounts: 10 that receive a victim's money, 37 that receive from them)")
key = {(r["institution"], r["account_no"]): int(r["level"]) for r in csv.DictReader(open("data/answers/mule_truth.csv"))}  # the key: for grading only
print(f"{'':28s}{'first hop (10)':>15s}{'second hop (37)':>17s}{'not mules':>11s}")
for name, flagged in (("rule (step 3)", rule), ("model at that threshold", model_flags)):
    print(f"{name:28s}{sum(key.get(k) == 1 for k in flagged):15d}{sum(key.get(k) == 2 for k in flagged):17d}"
          f"{sum(k not in key for k in flagged):11d}")
lv = {n: [scores[k] for k in keys if (key.get(k, 0)) == n] for n in (0, 1, 2)}
for n, nm in ((1, "first hop"), (2, "second hop"), (0, "not mules")):
    print(f"model score, {nm:10s}: min {min(lv[n]):.3f}  max {max(lv[n]):.3f}")
above = sum(s > max(lv[0]) for s in lv[2])
print(f"second-hop mules scoring above every non-mule: {above} of {len(lv[2])}")
json.dump(model, open("ai/mule_model.json", "w"))
EOF
python3 ai/step4_mule_model.py
926 accounts, 10 labelled: the account that received each reported fraud
weights per standard deviation: {'fan_out': 0.68, 'passed': 0.13, 'speed': 0.21, 'log_amount': 0.16}
threshold = the lowest score among the labelled accounts = 0.829

opening answers/mule_truth.csv (47 mule accounts: 10 that receive a victim's money, 37 that receive from them)
                             first hop (10)  second hop (37)  not mules
rule (step 3)                            10               37          0
model at that threshold                  10                0          0
model score, first hop : min 0.829  max 0.994
model score, second hop: min 0.011  max 0.027
model score, not mules : min 0.003  max 0.055
second-hop mules scoring above every non-mule: 0 of 37

The model finds the first hop (10 of 10, in-sample, on ten labels) and none of the second (0 of 37). The rule finds all 47. Second-hop scores top out at 0.027, below the highest-scoring account that is not a mule (0.055), so the model does not rank them either.

5. Price the alerts and write the policy. The 15 minutes per alert is an assumption: change it.

cat > ai/step5_controls.py <<'EOF'
"""Step 5: what the alerts cost people, and who may act on a score. Never opens answers/."""
from railslib import *

# ---- the alert load of step 2's volume model, if every alert goes to a person
MINUTES_PER_ALERT = 15                              # an ASSUMPTION: change it
db = connect()
banks = [r[0] for r in db.execute("SELECT code FROM participants")]
counts = bank_hours(db)
model = VolumeModel(counts, banks)
rows = [(model.surprise_low(b, h, counts[(b, h)]), h) for h in range(TRAIN_HOURS, 168) for b in banks
        if model.expected(b, h) >= 1.0]
print(f"volume alerts Wed-Sun at {MINUTES_PER_ALERT} minutes each (one real event among them: B07 on Wednesday)")
print("surprise >=   alerts   analyst hours")
for th in (2.0, 2.5, 3.0, 4.0):
    n = sum(s >= th for s, _ in rows)
    print(f"{th:<12.1f}{n:8d}{n * MINUTES_PER_ALERT / 60:12.1f}")

# ---- a policy as data: which action needs which approvals. ILLUSTRATIVE: the real rules are the institution's
# own, set with its regulator and its lawyers.
POLICY = {
    "queue_alert":      dict(min_score=0.0, approvers=0, reason=False, who="the model may do this alone"),
    "hold_transfer":    dict(min_score=0.5, approvers=1, reason=True, who="one analyst"),
    "restrict_account": dict(min_score=0.5, approvers=2, reason=True, who="an analyst and the fraud lead"),
    "reroute_traffic":  dict(min_score=None, approvers=2, reason=True, who="the shift lead and the incident lead"),
}


def decide(action, score, approvals, reason):
    """A score can open the door for an action. It never counts as an approver. Rerouting ignores the score."""
    p = POLICY[action]
    if p["min_score"] is not None and score < p["min_score"]:
        return "DENY", f"score {score:.2f} is below {p['min_score']}"
    if approvals < p["approvers"]:
        return "DENY", f"needs {p['approvers']} approval(s) from {p['who']}, has {approvals}"
    if p["reason"] and not reason:
        return "DENY", "a reason code is required"
    return "ALLOW", "logged" + (f" with reason {reason}" if reason else "")


cases = [("queue_alert", 0.30, 0, ""), ("hold_transfer", 0.65, 0, "M1"), ("hold_transfer", 0.65, 1, "M1"),
         ("restrict_account", 0.97, 1, "M1"), ("restrict_account", 0.97, 2, "M1"), ("restrict_account", 0.97, 2, ""),
         ("reroute_traffic", 0.99, 1, "TIMEOUTS"), ("reroute_traffic", 0.99, 2, "TIMEOUTS")]
print("\naction            score approvals reason     decision")
for a, s, n, r in cases:
    d, why = decide(a, s, n, r)
    print(f"{a:17s} {s:5.2f} {n:9d} {r or '-':9s} {d:6s} {why}")
EOF
python3 ai/step5_controls.py
volume alerts Wed-Sun at 15 minutes each (one real event among them: B07 on Wednesday)
surprise >=   alerts   analyst hours
2.0              254        63.5
2.5              174        43.5
3.0              101        25.2
4.0               26         6.5

action            score approvals reason     decision
queue_alert        0.30         0 -         ALLOW  logged
hold_transfer      0.65         0 M1        DENY   needs 1 approval(s) from one analyst, has 0
hold_transfer      0.65         1 M1        ALLOW  logged with reason M1
restrict_account   0.97         1 M1        DENY   needs 2 approval(s) from an analyst and the fraud lead, has 1
restrict_account   0.97         2 M1        ALLOW  logged with reason M1
restrict_account   0.97         2 -         DENY   a reason code is required
reroute_traffic    0.99         1 TIMEOUTS  DENY   needs 2 approval(s) from the shift lead and the incident lead, has 1
reroute_traffic    0.99         2 TIMEOUTS  ALLOW  logged with reason TIMEOUTS

At surprise 2 the volume model costs 63.5 analyst hours for the week, against 6.5 at surprise 4. A score of 0.99 does not reroute traffic with one approver, and a score of 0.97 does not restrict an account without two people and a reason.

6. Ask an assistant to check your work. The script prints three prompts and the key for the second. Paste each into a free assistant or a local model, three times. No customer data goes in.

cat > ai/step6_prompts.py <<'EOF'
"""Step 6: prompts for a free assistant or a local model. No customer data: lab rows only. Prints the key to check against."""
print("PROMPT A (read an alert)")
print("A volume monitor on an instant-payment network watched 2,001 participant-hours on Wednesday to Friday and raised")
print("these alerts (surprise 2 means a 1 in 100 chance). Which look like real incidents and which like noise?")
print("What would you check first for each? Do not invent causes: say what you cannot know from this table.")
print("  B07 Wed 11:00  saw 10, expected 26.4, surprise 3.62")
print("  B12 Wed 18:00  saw 5, expected 15.6, surprise 2.75")
print("  B01 Thu 14:00  saw 9, expected 21.6, surprise 2.72")
print()
print("PROMPT B (read amounts)")
print("Give the amount in kobo, as an integer, for each narration. If one is ambiguous, say so and do not guess.")
narrations = [("SCHOOL FEES N150,000 TERM 2", 15_000_000), ("pls send 1.5k for data", 150_000),
              ("I don send fifty thousand naira give my brother", 5_000_000), ("2.3m supplier payment", 230_000_000),
              ("1500 naira for the driver", 150_000), ("15k abeg", 1_500_000)]
for i, (text, _) in enumerate(narrations, 1):
    print(f"  {i}. {text}")
print()
print("PROMPT C (a message to a customer whose transfer was held)")
print("A bank held a transfer for review. Write two sentences to the customer in English, Nigerian Pidgin and Yoruba.")
print("Do not say it is a fraud alert, do not say what triggered it, and say how to reach a person.")
print()
print("KEY for prompt B (kobo):", [k for _, k in narrations])
EOF
python3 ai/step6_prompts.py
PROMPT A (read an alert)
A volume monitor on an instant-payment network watched 2,001 participant-hours on Wednesday to Friday and raised
these alerts (surprise 2 means a 1 in 100 chance). Which look like real incidents and which like noise?
What would you check first for each? Do not invent causes: say what you cannot know from this table.
  B07 Wed 11:00  saw 10, expected 26.4, surprise 3.62
  B12 Wed 18:00  saw 5, expected 15.6, surprise 2.75
  B01 Thu 14:00  saw 9, expected 21.6, surprise 2.72

PROMPT B (read amounts)
Give the amount in kobo, as an integer, for each narration. If one is ambiguous, say so and do not guess.
  1. SCHOOL FEES N150,000 TERM 2
  2. pls send 1.5k for data
  3. I don send fifty thousand naira give my brother
  4. 2.3m supplier payment
  5. 1500 naira for the driver
  6. 15k abeg

PROMPT C (a message to a customer whose transfer was held)
A bank held a transfer for review. Write two sentences to the customer in English, Nigerian Pidgin and Yoruba.
Do not say it is a fraud alert, do not say what triggered it, and say how to reach a person.

KEY for prompt B (kobo): [15000000, 150000, 5000000, 230000000, 150000, 1500000]

I did not run a model while writing this chapter, so there is no model output to quote. Compare what you get with the table in the first prompt and the key. Does it invent a cause for B12’s quiet hour, or say that it cannot know? Does it say that 2,001 hours at 1% could produce about twenty chance alerts? Does it read all six narrations, “1.5k”, “N150,000”, “fifty thousand naira”, “2.3m”, “1500 naira” and “15k”, the same way as the key, and flag any it cannot? Do the Pidgin and Yoruba messages say more than the English, and would a Pidgin or Yoruba speaker send them?

In step4_mule_model.py, move the key = ... line (the one that reads mule_truth.csv) to the line above the one that builds labelled, then add labelled = set(key) on the line after labelled is first built, so that all 47 mule accounts are labelled (this uses the key, as an investigation that confirmed the whole chain would). Rerun. The model now flags 10 first-hop and 37 second-hop accounts and no others, the weight on fan-out falls from 0.68 to 0.03, the weight on the share forwarded rises to 1.16, and the lowest labelled score is 0.844 against 0.315 for the highest non-mule. Nothing about the algorithm changed. The labels did. The first line of output will say 47 labelled. Then ask what your own team’s labels cover, and who would have to follow a chain for them to cover the second hop.

ARTEFACT Write the vendor model pilot evaluation memo ~45 MIN
YOU PRODUCEVendor model pilot evaluation memo

Template

# Vendor model pilot evaluation: <model and feed>
Author: <name, role>   Signs: <name, role>   Date: <date>   Status: <draft | for signature>
Scope: <feed and period tested; what this memo does not cover>

## 1. Decision needed
<One sentence: what you ask the signer to approve, and by when.>

## 2. What the vendor claims
- Claim, quoted as theirs: <...>
- Shown on: <their demonstration | our data>

## 3. The baseline, at equal alert volume
- Rules we run today: <one line each>
- Test data: <period, transfers, what the model trained on>
- Alerts compared: <N for the rules, N for the model, how you matched them>

## 4. Labels
- What we have: <count and source>
- What they cover: <...>
- What they cannot see: <...>

## 5. Results the lab printed
| Method | Alerts | Real events found | Missed | When it alerted |
|---|---|---|---|---|

## 6. Alert budget
- Analyst hours a week: <h> at <minutes> an alert = <N alerts> (assumption)
- Threshold that fits: <...>   What it misses: <...>

## 7. Who may act on an alert
| Action | Harm if wrong | Who may order it | Reason code needed |
|---|---|---|---|

## 8. Decision and conditions
- Recommendation: <...>
- Pilot length: <...>   Stop if: <...>   Measured by: <...>

## 9. How this could be wrong
<One way, and the result that would show it.>

Signed: <role> ______   Date: ______
WORKED EXAMPLE

At Northmere Bank, Erhunmwunse leads fraud analytics and writes this memo from Ezinne’s test; the head of fraud and risk signs it.

Decision needed. Approve a 90-day pilot of the vendor’s model as an alert-only second opinion beside our rules. The vendor says it finds a bank going quiet or a mule account before a rule does; that is the vendor’s claim, shown on its own demonstration.

Baseline. We ran three rules and the model on one generated week, counting alerts per event so both sides show three. The rules raised no false alert and found three real events (B07’s outage at 11:07, five minutes in; the Thursday switch incident; B13 over its limit). The volume model at surprise 2.5 raised three alerts on Wednesday to Friday and found one real event, B07, at 12:00, after the outage ended at 11:49. The other two were chance.

Labels. We hold 10 reported accounts, which are first-hop accounts. The model caught those 10 and 0 of the 37 second-hop mules; the written rule caught all 47. Reports cannot show us a second hop.

Alert budget. We assume 10 analyst hours a week at 15 minutes an alert, so 40 alerts. From Wednesday to Sunday the model raised 254 alerts at surprise 2.0 (63.5 hours) and 26 at 4.0 (6.5 hours, which fits), and 4.0 misses B07, whose surprise was 3.62.

Who may act. The model may queue an alert. One analyst may hold a transfer. An analyst and the fraud lead, with a reason code, restrict an account. The shift lead and incident lead reroute traffic, whatever the score.

Decision. Run 90 days alert-only; stop if analysts spend more than the budget; do not let it hold transfers yet.

Could be wrong. One generated week with two events proves little; a real week with a missed event would show it.

Now you

You are an analyst in the fraud and risk operations team at Owoleaf, the consumer wallet, at 200 people. A vendor says its model finds mule accounts receiving wallet top-ups before Owoleaf’s rules do. Owoleaf has 6 reported accounts, all confirmed as the first to receive a victim’s money, and a risk team that can give 7 analyst hours a week to this feed, at 15 minutes an alert. Use your own run of the lab’s step 5 table and step 4 result as your evidence: which printed threshold fits 7 hours, does it still find the event that mattered, and what do 6 first-hop labels let a model learn? Write the memo your team’s lead will sign, deciding whether to pilot, and under what conditions.

Self-check

DECIDE

Erhunmwunse has Ezinne's results. On one generated week the model found B07's outage 11 minutes after it ended and the rule found it five minutes in. At the loose threshold the model raised three false alerts for one real one on weekdays, a flood at weekends, and could not see a bank over its limit. On mules it flagged the 10 first-hop accounts its labels describe and none of the 37 second-hop accounts, while a written rule found all 47. The vendor wants a production pilot, and the head of operations asks whether it can hold transfers automatically above a score.

READING
  1. DOC
    Project Hertha: identifying financial crime patterns in real-time retail payment systems BIS Innovation Hub and Bank of England, 2025

    A synthetic-data trial of machine learning and network analysis on retail payments, in the same setting as the lab. Its project page reports gains on synthetic data only. Read how it measures an improvement, and skip the technical annexes on a first pass.

  2. DOC
    Project Aurora: the power of data, technology and collaboration to combat money laundering across institutions and borders BIS Innovation Hub, 2023

    Compares detection by one institution with detection across several, on synthetic data. Read it for why the second hop needs a view across banks and what privacy techniques it tried. This chapter saw only summaries of it, so check its claims in the report.

  3. DOC
    The Financial Stability Implications of Artificial Intelligence Financial Stability Board, 2024

    Names the vulnerabilities supervisors worry about: provider concentration, correlated models, cyber risk, and model risk with data quality. Read its section on vulnerabilities to see what a bank's model governance has to answer. The FSB's recommendations are not binding.

  4. BOOK
    Alerting on SLOs Google SRE Workbook, 2018

    Precision, recall, detection time and reset time, the four ways to judge an alert. Read it before you compare any detector. It is about service objectives, not payments, so skip the Prometheus rule examples. Read: chapter 5, the sections on the properties of a good alert and on burn rate.

  5. DOC
    2023 Annual Fraud Landscape NIBSS, 2024

    NIBSS's own industry report on fraud reported by institutions. This chapter did not open it, so read it for the channels, the victim counts and what it says about reporting. Press coverage of it gives figures that differ, so take numbers only from the report.

  6. DOC
    The Central Bank of Nigeria Introduces New Instant Payment Security Requirements Aluko & Oyebode (law-firm note), 2026

    A law firm's summary of the CBN circular of 12 March 2026, with the monitoring and newly activated app requirements. It is a summary, not the circular, so use it to find what to look for in the CBN's own text.

  7. DOC
    Nigeria Data Protection Act 2023 (a copy of the Act) Federal Republic of Nigeria (copy hosted by DataGuidance), 2023

    The Act's text as hosted by a data-protection information site, which is not the gazetted version. Read section 37 on automated decisions and compare it with the commentary above before you let a model restrict an account.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Project: a sending bank, a switch and a receiving bank, settled and reconciled →