STAFFAICHAPTER 45

Governing AI credit models: inventory, monitoring, change control and what regulators ask

A model that was sound on the day it was signed drifts quietly. Governing it means a job that watches it, an owner for every alert and a record of every change

60 MINLENDING AND CREDITUPDATED 2026-11-14
PREDICT

Your monitoring job runs on the last day of each month from April to October. The card went live for applications from 1 April, and its wallet-inflow feature drifts. Outcomes use the 120-day label from chapter 2.2, and the job rates the AUC only when at least 300 live loans have a label. On which run can the job first rate the card's AUC from outcomes?

A model is a method that turns inputs into a number that drives a decision, and chapter model risk defined the term, the inventory and the three roles of developer, owner and validator. Model governance is everything that keeps that number trustworthy after the day it is signed: the inventory, validation, monitoring, change control, a record of each decision and a plan for retirement. Chapter fairness in AI credit covers whether the model is fair; this chapter covers whether anyone would notice if it stopped working. “AI credit model” here means any scorecard, boosted-tree model or vendor score that decides or shapes a credit decision. How such models work is the AI Engineering course’s subject, for instance what an LLM is; this chapter treats them as functions that take an application and return a number, which is all a governor needs.

Monitoring has two clocks

A model is checked on three things: what goes in, what comes out and what happened afterwards. The first two are known at once. The third is not.

Inputs and scores are known the day the application arrives. The population stability index (PSI) from chapter 3.6 compares today’s mix with the mix the model was built on, bin by bin, using the edges fixed at build time. It says the applicants changed. It does not say the model got worse. Its two marks, 0.10 and 0.25, are conventions, not a regulator’s numbers.

Outcomes arrive late. The 2.2 label asks whether a loan reached 90 days past due within 120 days of disbursement, so a loan has no label until 120 days after it was made. The first table of the lab shows the cost. At the 30 June run, the card has scored 3,102 live loans and none has a 120-day label. On 31 July, 41 do. On 31 August, 711. On 28 October, all of them. A monitoring pack that waits for outcomes tells you in August about a change in April.

The remedy is an early indicator: an outcome that matures faster and predicts the slow one. The lab uses the first instalment still unpaid 30 days after it fell due. A BNPL loan’s first instalment is due 14 days after disbursement and every other product’s 30 days after, so this label is known 44 to 60 days after disbursement. On 30 June, 763 live loans have it, and the card ranks them with an AUC of 0.667. The indicator is not the target: it counts a borrower who pays on day 35, and it has no view of failures at instalment three. It is a faster, noisier reading from the same loans, and the job reports it next to the slow one.

So the job has two clocks, and the report has to say which clock each figure comes from. A drift alarm in June and an AUC in August are the same system seen at different delays, not two disagreeing opinions.

What the job watches

Four groups of measures, each with a purpose.

  1. Drift in the score and in each feature. The score’s PSI is a smoke alarm for the whole card, and each feature’s PSI says where the smoke is. The score can be calm while one feature is not. Step 2 shows exactly that.
  2. Ranking and calibration, once labels exist. The AUC with a 90% interval (the interval is made by redrawing the loans 500 times in chapter 3.6; here 200 redraws with a fixed seed so every run gives the same figures), and observed against expected bad loans as a z-score.
  3. The benchmark. The bureau score alone, on the same loans. A card that no longer beats the thing you can buy for nothing extra has lost its reason to exist.
  4. Use. Whether the card is applied the way it was meant to be: the share of applicants below the cut-off, overrides, applications scored by a stale version. The lab’s book has no override log, so the job does not compute this, but the inventory entry should name an owner for it.

A fifth measure is not a number: fairness, which chapter 3.13 tests and which belongs in the monitoring plan as a scheduled re-test.

Alerts that someone owns

An alert is a rule, a level, an owner and an action. A rule with no owner is a dashboard.

The lab’s rules are illustrative and written to be changed. PSI of a score or feature at 0.10 or more is amber and at 0.25 or more is red. The AUC is rated only when 300 labelled loans exist. It is red if even the top of its 90% interval is below 0.60, and amber if it falls below the bureau score alone on the same loans. Observed against expected bad loans (the z-score: observed minus expected, divided by the standard deviation of the expected count) further than 3 from zero is amber. Amber is for the model owner to look at. A red alert must also reach the validator, who decides with the owner whether to keep using the card, restrict it or switch it off; the lab’s log names an owner by kind of alert (drift to the model owner, performance to the owner and then the validator) and does not route that step, so a person must. Every alert closes with a written answer. Chapter credit risk governance covers the committees and three lines of defence that receive these escalations.

The design choice that matters most is what each rule is compared with. A rule on the point AUC is the easiest to write and the worst to run. In the lab the card’s AUC is 0.678 on 31 August, 0.652 on 30 September and 0.678 on 28 October, and the card never changed. The 90% interval on 30 September runs from 0.617 to 0.688, wide enough to hold both neighbours. A rule that fires on a fall of 0.02 from the signed 0.678 fires on 30 September and clears on 28 October: a false alarm that costs a meeting. Do that three times and the team stops reading alerts. The break step makes it happen. Rules on the interval and on the benchmark fire only when the evidence is strong.

Not every line in the run log is an alert. When there are no new applications (in the lab the lender stops lending at the end of June), the job writes an information line, not a silence, because a model that sees no data is a finding too.

Changing a model

Every change to a decision model is a change to decisions. Change control is the rule that none happens without a record. What counts as a change: a new version, a refit, a feature added or removed, a cut-off moved, a vendor’s model updated, a data source rebuilt. A record has the same fields every time.

  • What changed and why, and which alert or finding triggered it.
  • Evidence, before and after, on the same loans: ranking, calibration, and how many decisions move.
  • Roles: developer, owner and validator. The validator is not the developer and not the owner.
  • A rollback: how to go back, and what triggers it.
  • Monitoring: new baselines. A new version has new score bands, so the PSI history of the old one cannot be compared with it.
  • Approval by the body the tier requires, with a date (chapter credit risk governance covers who that is).

The lab’s change comes from its own alert. The wallet-inflow feature went red on 30 June. Chapter 3.6 found part of the cause: for applications before 2 March, the 60-day window reaches before the data begin, so the feature is understated for 184 of the 543 training loans. A candidate version, 1.1, removes the feature and refits the other three on the same loans. Step 4 compares them on the same 3,102 test loans. The AUC is 0.678 for both, KS 0.292 against 0.289, and the number of bad loans the card expects goes from 270.8 to 290.2 against 278 observed (z from 0.47 to −0.77). The new card has the same ranking and gives up a little calibration. Its bottom score band, the cut-off for this comparison, moves from 557 to 562 points, so 467 test loans fall in it instead of 405: 395 in both, 72 that enter and 10 that leave. Of the 72 that enter, 10 went bad; of the 10 that leave, 2 did. That is the decision impact, in loans, and it is what the committee reads.

Two cautions are in the record, and the check in step 4 fails the first draft for them. First, the candidate was chosen after looking at the test months. Its test result is no longer clean, so the record must name a fresh window, here a quarter of shadow running with both versions. Second, dropping one feature moves weight to the others, and the weight on KYC tier rises from 0.55 to 0.65. Chapter 3.13 found that tier acts as a proxy, so the record asks for the fairness tests to be repeated on 1.1. A change that fixes a drift alarm can create a different problem; the record is where that is written down.

A record of every decision

Monitoring watches the model in aggregate. A decision record lets you answer for one customer. For each scored application, store the model version, the inputs as the model saw them, the score, the reasons and the decision. Step 5 replays an application from such a record.

Application 584, a thin-file tier 1 applicant, scores 544 points under 1.0 and 550 under 1.1. The reasons are the same bureau history and low KYC tier, with the tier’s shortfall rising from 24 to 28 points. If the record stored only the score, a customer who complained in January could not be told which of the two numbers applied to them in April. Reason codes are not causes: they say what the card weighed. Chapter gradient-boosted models and explaining declines covers what a declined customer is owed.

Commentators say section 37 of the Nigeria Data Protection Act 2023 gives a person the right not to be subject to a decision based solely on automated processing, including profiling, that has legal or similar effects, with exceptions (for example consent, a legal requirement, or a written law with suitable safeguards) and, where an exception applies, safeguards such as asking for human involvement, giving a view and contesting the decisionas of 2026-11. This rests on law-firm commentary, not on the statute text this chapter read. The cited PDF is a consultancy’s copy of the Act, so check the section number and wording against the Nigeria Data Protection Commission’s or the Gazette’s text, where commentators differ on the exceptions. Whether a credit decision has such an effect is a legal question. Whatever the answer, a lender that cannot replay a decision cannot offer the human review the safeguards describe.

Vendor models

A lender cannot open a vendor’s model, and the vendor’s score still drives decisions. From Owoleaf’s side the bureau score is a vendor model: a number comes in, nothing is known about how it was made, and it is changed without asking. The lab monitors it from outside, using what the lender holds. It logs every score it received and the outcome. In the benchmark column of the lab’s output the bureau score alone ranks the same loans at 0.617 on 31 August, 0.621 on 30 September and 0.648 on 28 October. That is the score’s AUC on loans where thin files are treated as the lowest, and it moves in the same noisy way the card’s does.

What the lender cannot do from outside it must get by contract. Ask for documentation of the data and method at a level a validator can use, evidence of performance on your population (and the right to see how it was measured), notice before the model changes and a version number on every score, an explanation for each decision, the right to audit or to receive audit reports, and a way out: what happens to your data and your decisions when you end the contract. A vendor’s claim of accuracy is a vendor’s claim until you have reproduced it on your own loans, as chapter AI in lending said. The inventory entry for a vendor model names an owner on your side, who can say what it is used for and what its last change was.

What the rules ask

Three regimes touch this chapter. None is a Nigerian rule for a Nigerian lender’s scorecard, and each is stated only as far as search results supported it.

The Federal Reserve’s SR 26-2, “Revised Guidance on Model Risk Management”, is dated 17 April 2026, was issued jointly with the Federal Deposit Insurance Corporation and the Office of the Comptroller of the Currency, and supersedes SR 11-7 and SR 21-8; the Fed’s letter describes a risk-based approach in which practices vary with each bank’s risk profile and model useas of 2026-11. Secondary summaries say it keeps SR 11-7’s structure and narrows the definition of a model, and they disagree on whether generative and agentic AI are in scope. This chapter did not read the full text, so check scope before relying on any of that. It is US supervisory guidance, and it binds no Nigerian lender. It matters because a funder or partner bank may ask a lender to meet the same questions: an inventory, independent validation, ongoing monitoring and governance of change.

A search for a CBN guideline on model risk management or on validating credit scoring models found none; the closest document is the 2019 Guidelines on the Management of Interest Rate Risk in the Banking Book, which search summaries say expect a board-approved model management policy, named roles for building, validating and using models and regular independent model review and validationas of 2026-11. That guideline is about interest-rate risk models and is not a credit scoring rule. Chapter 3.6 reached the same finding.

The European Commission’s AI Act Service Desk page on Article 26 and summaries of it say that a deployer of a high-risk AI system must use it according to its instructions, assign competent people to oversee it, monitor its operation, and keep the logs it generates for a period suited to its purpose and at least six months, and inform the provider or authorities of risksas of 2026-11. Summaries also say AI systems that assess the creditworthiness of natural persons are high-risk, and that the provider of a high-risk system must run post-market monitoring, with the plan part of its technical documentationas of 2026-11. One result lists Article 86 as the “right to explanation of individual decision-making”; the searches returned its title and no text.

Law-firm summaries report that Regulation (EU) 2026/1744, the Digital Omnibus on AI, amends the AI Act, was published in the Official Journal on 24 July 2026 and entered into force on 27 July 2026, and moves the start of the stand-alone high-risk obligations, which they say include credit scoring, from 2 August 2026 to 2 December 2027as of 2026-11. EUR-Lex lists a consolidated AI Act dated 27 July 2026 that shows this amendment, but this chapter did not read the text of either, and secondary sources disagree on some other dates in the amendment. Read the consolidated text before quoting any date, and note that wording in Articles 26 and 72 may differ from the summaries. The Act does not bind a Nigerian lender, but it binds vendors who sell into Europe, and its list of duties (logs, human oversight, monitoring) is the lab’s job in other words.

Put side by side, the documents ask for what the lab builds: an inventory, independent validation, monitoring with owners, change control and records that let a decision be replayed. A regulator who has not asked yet is not a reason to wait. A funder like Northmere will.

Back at Owoleaf

Abasi runs the job and the change step. The run log answers Ekanem’s questions: the card’s wallet feature was amber on 31 May and red on 30 June; the early indicator held at 0.667 and 0.650 while labels were scarce; the AUC was first rated on 31 August at 0.678, above the bureau score’s 0.617 on the same loans; nothing fired on performance. Change record CHG-0001 says what was proposed, who must validate it and what is still missing: a fresh window, a fairness re-test and the committee’s approval. He also has to tell Ekanem what the job cannot see. It has no override log, the card is blind to product and employer (chapter 3.6), and a quarter of shadow running has not happened yet. Northmere’s own funding terms are a separate matter: the chapter on funding a loan book covers what a funder asks of a borrower’s book. Ekanem’s questionnaire is answered with files, and files age, so the job has to run next month.

LAB A monitoring job and a change record for the 2.2 scorecard on data1 ~60 MIN
YOU NEEDPython 3.9 or later, standard library onlylabs/finance/data1/finance.sqlite and your scorecard.py from chapter 2.2about 5 minutes of reading per step

You write two files next to scorecard.py: monitor.py, which runs the monthly job, and change.py, which tests a candidate version and checks its change record. Work in labs/finance. Do not open data1/answers/loans_truth.csv: a real lender has no such file. Money is in integer kobo; every threshold, role and tier is illustrative. If data1/finance.sqlite is missing, build it with the command in chapter 2.2, step 0.

0. Check you have the 2.2 card. The job monitors that card, so confirm your file reproduces the chapter’s figures.

python3 scorecard.py | grep -E "^test: AUC"
test: AUC 0.678  KS 0.294
test: AUC 0.678  Gini 0.356  KS 0.292

The first line is the model step, the second the whole-point card of step 5. If your numbers differ, fix scorecard.py before you go on: a monitor of the wrong card is worse than none.

1. What can the job know on each run date? Save the first half of monitor.py. It loads every approved loan with only what was known at application, defines the two labels, and prints what each month-end run can see.

"""monitor.py: a monthly monitoring job for the chapter 2.2 scorecard (data1, scale 1).

Standard library only. Every threshold below is ILLUSTRATIVE: a lender sets its own.
Imports scorecard.py from chapter 2.2: `import scorecard as s`.
"""
import collections
import csv
import datetime as dt
import math
import random

import scorecard as s

NAMES = ["bureau_score", "delinquent_12m", "kyc_tier", "wallet_in_60d"]   # the card's features
GO_LIVE = "2026-04-01"                  # applications from here are scored live; the card was built on earlier ones
RUNS = [dt.date(2026, 4, 30), dt.date(2026, 5, 31), dt.date(2026, 6, 30), dt.date(2026, 7, 31),
        dt.date(2026, 8, 31), dt.date(2026, 9, 30), s.CUT_OFF]              # the month-end runs
EARLY_DAYS = 30                         # the early indicator: first instalment still unpaid this long after its due date


def load_live():
    """Every approved loan, labelled or not, with what was known at application. Nothing here reads an outcome."""
    loans, due, paid, wallet = s._raw()
    rows = []
    for (loan_id, app_id, applied, disbursed, product, status, dpd, hit, score, dq, enq, hist, open_loans,
         tier, customer) in loans:
        rows.append(dict(loan_id=loan_id, application_id=app_id, applied_at=applied, product=product,
                         disbursed=s.day(disbursed), hit=hit, score=score, delinquent_12m=dq,
                         enquiries_90d=enq, history_years=hist, open_loans=open_loans, kyc_tier=tier,
                         wallet_in_60d=wallet[loan_id]))
    return rows, due, paid


def label_120(r, run, due, paid):
    """The chapter 2.2 label (bad within 120 days), or None while the window is still open on the run date."""
    if r["disbursed"] + dt.timedelta(days=s.WINDOW_DAYS) > run:
        return None
    return s.went_bad(r["loan_id"], r["disbursed"], s.WINDOW_DAYS, due, paid)


def label_early(r, run, due, paid):
    """The early indicator: 1 if the first instalment was not fully paid 30 days after its due date; None until then."""
    n, due_date, total = due[r["loan_id"]][0]
    check = due_date + dt.timedelta(days=EARLY_DAYS)
    if check > run:
        return None
    return int(sum(a for when, a in paid[(r["loan_id"], n)] if when <= check) < total)


def show_known(rows, due, paid):
    print(f"{'run date':<12}{'applied in month':>17}{'live loans':>11}{'120-day label':>14}{'early label':>12}")
    for run in RUNS:
        month = run.isoformat()[:7]
        live = [r for r in rows if r["applied_at"] >= GO_LIVE and r["applied_at"] <= run.isoformat()]
        in_month = sum(1 for r in live if r["applied_at"][:7] == month)
        n120 = sum(1 for r in live if label_120(r, run, due, paid) is not None)
        nearly = sum(1 for r in live if label_early(r, run, due, paid) is not None)
        print(f"{run.isoformat():<12}{in_month:>17}{len(live):>11}{n120:>14}{nearly:>12}")

Save this as known.py and run it.

import monitor as m

rows, due, paid = m.load_live()
m.show_known(rows, due, paid)
python3 known.py
run date     applied in month live loans 120-day label early label
2026-04-30                633        633             0           0
2026-05-31               1009       1642             0          73
2026-06-30               1460       3102             0         763
2026-07-31                  0       3102            41        1858
2026-08-31                  0       3102           711        3102
2026-09-30                  0       3102          1734        3102
2026-10-28                  0       3102          3102        3102

Read the columns, not the rows. At 30 June all 3,102 live loans are scored, and none has a 120-day label. The first instalment’s early label is known for 763. By 31 August 711 have the slow label, and 3,102 have the early one. On 31 July only 41 loans have the slow label, which is under the 300 the job needs to rate an AUC.

2. Drift and performance. Add this to monitor.py. psi is the formula from chapter 3.6, drift applies it to the score bands and to each feature, and performance rates ranking, calibration and the benchmark once labels exist.

# ---- drift: needs no outcomes, so it is the first signal -----------------------------------------------
def psi(base, new, bins):
    """Population stability index: sum of (actual share - expected share) x ln(actual share / expected share).
    A share of zero is floored at 0.0001 so the logarithm exists."""
    cb, cn = collections.Counter(base), collections.Counter(new)
    total = 0.0
    for b in bins:
        expected = max(cb[b] / len(base), 1e-4)
        actual = max(cn[b] / len(new), 1e-4)
        total += (actual - expected) * math.log(actual / expected)
    return total


def band_edges(card, train, bands=5):
    """Score band edges from the training loans. Fixed at build time and never moved: moving them breaks history."""
    ordered = sorted(s.score(card, r) for r in train)
    return [ordered[len(ordered) * k // bands] for k in range(1, bands)]


def feature_bin(name, r):
    b = s.FEATURES[name][0](r)
    return "no data" if b is None else b


def drift(card, train, month_rows, edges):
    """PSI of the score bands and of each feature's bins, a month's applications against the training loans."""
    band = lambda r: sum(s.score(card, r) >= e for e in edges)
    out = {"score": psi([band(r) for r in train], [band(r) for r in month_rows], range(len(edges) + 1))}
    for n in card["names"]:
        base = [feature_bin(n, r) for r in train]
        new = [feature_bin(n, r) for r in month_rows]
        out[n] = psi(base, new, sorted(set(base) | set(new)))
    return out


# ---- performance: needs outcomes, so it arrives months later -------------------------------------------
def auc_interval(risk, bad, seed=42, draws=200):
    """90% interval for the AUC by redrawing the loans with replacement; seeded, so the same every run."""
    rng = random.Random(seed)
    n, values = len(risk), []
    for _ in range(draws):
        pick = [rng.randrange(n) for _ in range(n)]
        b = [bad[i] for i in pick]
        if 0 < sum(b) < n:
            values.append(s.auc([risk[i] for i in pick], b))
    values.sort()
    return values[int(0.05 * len(values))], values[int(0.95 * len(values)) - 1]


def performance(card, loans, labels):
    """Ranking (AUC with interval), calibration (observed against the card's own expected bad loans) and the
    benchmark: the bureau score alone on the same loans, thin files treated as the lowest."""
    bad = [labels[r["loan_id"]] for r in loans]
    risk = s.log_odds_bad(card, loans)
    p = [1 / (1 + math.exp(-x)) for x in risk]
    expected = sum(p)
    z = (sum(bad) - expected) / math.sqrt(sum(q * (1 - q) for q in p))
    lo, hi = auc_interval(risk, bad)
    vendor = [-(r["score"] if r["hit"] else 500) for r in loans]
    return dict(n=len(loans), bad=sum(bad), expected=expected, z=z, auc=s.auc(risk, bad), lo=lo, hi=hi,
                bench=s.auc(vendor, bad))

Save a small script, parts.py, that calls them.

import monitor as m
import scorecard as s

rows, due, paid = m.load_live()
train, test = s.split(s.load_sample())
card = s.build_card(train, m.NAMES)
edges = m.band_edges(card, train)
print("score band edges", edges)
for month in ("2026-04", "2026-05", "2026-06"):
    d = m.drift(card, train, [r for r in rows if r["applied_at"][:7] == month], edges)
    print(month, "  ".join(f"{k} {v:.3f}" for k, v in d.items()))
live = [r for r in rows if r["applied_at"] >= m.GO_LIVE]
labels = {r["loan_id"]: m.label_120(r, m.RUNS[-1], due, paid) for r in live}
p = m.performance(card, live, labels)
print(f"at the cut-off: {p['n']} loans, {p['bad']} bad, expected {p['expected']:.1f}, z {p['z']:.2f}")
print(f"AUC {p['auc']:.3f}, 90% interval {p['lo']:.3f} to {p['hi']:.3f}; bureau score alone {p['bench']:.3f}")
python3 parts.py
score band edges [557, 576, 591, 617]
2026-04 score 0.039  bureau_score 0.009  delinquent_12m 0.000  kyc_tier 0.004  wallet_in_60d 0.052
2026-05 score 0.033  bureau_score 0.002  delinquent_12m 0.001  kyc_tier 0.010  wallet_in_60d 0.132
2026-06 score 0.052  bureau_score 0.009  delinquent_12m 0.011  kyc_tier 0.037  wallet_in_60d 0.334
at the cut-off: 3102 loans, 278 bad, expected 270.8, z 0.47
AUC 0.678, 90% interval 0.655 to 0.704; bureau score alone 0.648

The score’s PSI never passes 0.052. The wallet feature goes from 0.052 to 0.132 to 0.334. Redo June by hand. Training had 136 of 543 loans (0.250) with under ₦25,000 of wallet inflow in 60 days, and June had 88 of 1,460 (0.060): the difference is −0.190, ln(0.060 ÷ 0.250) is −1.424, and the bin adds 0.271. The other two bins add 0.006 and 0.057, and the total is 0.334. The card’s AUC is 0.678 at the cut-off, above the bureau score’s 0.648 on the same loans.

3. Alerts and the run log. Add the rules, the run function and the printer at the end of monitor.py.

# ---- rules, alerts and the run log ---------------------------------------------------------------------
PSI_AMBER, PSI_RED = 0.10, 0.25         # rules of thumb (chapter 3.6), not a regulator's numbers
MIN_LABELLED = 300                      # fewer labelled loans than this and the AUC is not rated
AUC_FLOOR = 0.60                        # red if even the top of the 90% interval is below this
EARLY_FLOOR = 0.60                      # amber if the card's AUC on the early indicator is below this
Z_LIMIT = 3.0                           # amber if observed against expected bad loans is further out than this
REF_AUC = 0.678                         # the test AUC the validator signed
AUC_POINT_DROP = None                   # the break step sets this to 0.02: alert on a fall of the point AUC
OWNERS = {"drift": "model owner", "performance": "model owner, then the validator", "data": "data owner"}


def run_once(run, card, train, edges, rows, due, paid):
    live = [r for r in rows if r["applied_at"] >= GO_LIVE and r["applied_at"] <= run.isoformat()]
    month = [r for r in live if r["applied_at"][:7] == run.isoformat()[:7]]
    out = dict(run=run.isoformat(), month_loans=len(month), alerts=[])
    add = lambda level, kind, text: out["alerts"].append((level, kind, text))
    if month:
        d = drift(card, train, month, edges)
        out["psi_score"] = d["score"]
        worst = max(card["names"], key=lambda n: d[n])
        out["worst_feature"], out["psi_worst"] = worst, d[worst]
        for name, value in d.items():
            if value >= PSI_RED:
                add("RED", "drift", f"{name} PSI {value:.3f} is {PSI_RED} or more")
            elif value >= PSI_AMBER:
                add("AMBER", "drift", f"{name} PSI {value:.3f} is {PSI_AMBER} or more")
    else:
        add("INFO", "data", "no new applications this month, so no drift reading")
    labels = {r["loan_id"]: label_120(r, run, due, paid) for r in live}
    known = [r for r in live if labels[r["loan_id"]] is not None]
    out["labelled"] = len(known)
    if len(known) >= MIN_LABELLED:
        p = performance(card, known, labels)
        out.update(auc=p["auc"], lo=p["lo"], hi=p["hi"], bench=p["bench"], z=p["z"])
        if p["hi"] < AUC_FLOOR:
            add("RED", "performance", f"AUC {p['auc']:.3f}, interval top {p['hi']:.3f} is under {AUC_FLOOR}")
        if p["auc"] < p["bench"]:
            add("AMBER", "performance", f"AUC {p['auc']:.3f} is below the bureau score alone, {p['bench']:.3f}")
        if abs(p["z"]) > Z_LIMIT:
            add("AMBER", "performance", f"observed {p['bad']} bad against {p['expected']:.1f} expected, z {p['z']:.2f}")
        if AUC_POINT_DROP is not None and REF_AUC - p["auc"] > AUC_POINT_DROP:
            add("AMBER", "performance", f"AUC {p['auc']:.3f} is {REF_AUC - p['auc']:.3f} under the signed {REF_AUC}")
    elif live:
        add("INFO", "performance", f"{len(known)} loans have a 120-day label, under {MIN_LABELLED}: AUC not rated")
    early_labels = {r["loan_id"]: label_early(r, run, due, paid) for r in live}
    early = [r for r in live if early_labels[r["loan_id"]] is not None]
    out["early_n"] = len(early)
    if len(early) >= MIN_LABELLED:
        y = [early_labels[r["loan_id"]] for r in early]
        out["early_rate"] = sum(y) / len(y)
        out["early_auc"] = s.auc(s.log_odds_bad(card, early), y)
        if out["early_auc"] < EARLY_FLOOR:
            add("AMBER", "performance", f"early-indicator AUC {out['early_auc']:.3f} is under {EARLY_FLOOR}")
    return out


def status(alerts):
    levels = [a[0] for a in alerts]
    return "RED" if "RED" in levels else "AMBER" if "AMBER" in levels else "green"


def run_job(card, train, rows, due, paid, path="monitor_log.csv"):
    edges = band_edges(card, train)
    results = [run_once(run, card, train, edges, rows, due, paid) for run in RUNS]
    cols = ["run", "status", "month_loans", "psi_score", "worst_feature", "psi_worst", "labelled", "auc", "lo", "hi",
            "bench", "z", "early_n", "early_auc", "alerts"]
    with open(path, "w", newline="") as f:
        w = csv.writer(f)
        w.writerow(cols)
        for o in results:
            row = [o.get(c, "") for c in cols]
            row[1] = status(o["alerts"])
            row[-1] = " | ".join(f"{lv} {kind}: {text}" for lv, kind, text in o["alerts"] if lv != "INFO")
            w.writerow([f"{v:.4f}" if isinstance(v, float) else v for v in row])
    return results


def show_run(results):
    print(f"{'run':<12}{'status':<7}{'month':>6}{'score PSI':>10}{'worst feature':>22}{'labelled':>9}"
          f"{'AUC':>7}{'early n':>8}{'early AUC':>10}")
    for o in results:
        psi_s = f"{o['psi_score']:.3f}" if "psi_score" in o else "-"
        worst = f"{o['worst_feature']} {o['psi_worst']:.3f}" if "psi_worst" in o else "-"
        auc_s = f"{o['auc']:.3f}" if "auc" in o else "-"
        e_auc = f"{o['early_auc']:.3f}" if "early_auc" in o else "-"
        print(f"{o['run']:<12}{status(o['alerts']):<7}{o['month_loans']:>6}{psi_s:>10}{worst:>22}{o['labelled']:>9}"
              f"{auc_s:>7}{o['early_n']:>8}{e_auc:>10}")
    print()
    for o in results:
        for level, kind, text in o["alerts"]:
            print(f"{o['run']}  {level:<6} {kind:<12} {text}  -> {OWNERS[kind]}")


def main():
    rows, due, paid = load_live()
    train, test = s.split(s.load_sample())
    card = s.build_card(train, NAMES)
    show_run(run_job(card, train, rows, due, paid))


if __name__ == "__main__":
    main()
python3 monitor.py
run         status  month score PSI         worst feature labelled    AUC early n early AUC
2026-04-30  green     633     0.039   wallet_in_60d 0.052        0      -       0         -
2026-05-31  AMBER    1009     0.033   wallet_in_60d 0.132        0      -      73         -
2026-06-30  RED      1460     0.052   wallet_in_60d 0.334        0      -     763     0.667
2026-07-31  green       0         -                     -       41      -    1858     0.650
2026-08-31  green       0         -                     -      711  0.678    3102     0.675
2026-09-30  green       0         -                     -     1734  0.652    3102     0.675
2026-10-28  green       0         -                     -     3102  0.678    3102     0.675

2026-04-30  INFO   performance  0 loans have a 120-day label, under 300: AUC not rated  -> model owner, then the validator
2026-05-31  AMBER  drift        wallet_in_60d PSI 0.132 is 0.1 or more  -> model owner
2026-05-31  INFO   performance  0 loans have a 120-day label, under 300: AUC not rated  -> model owner, then the validator
2026-06-30  RED    drift        wallet_in_60d PSI 0.334 is 0.25 or more  -> model owner
2026-06-30  INFO   performance  0 loans have a 120-day label, under 300: AUC not rated  -> model owner, then the validator
2026-07-31  INFO   data         no new applications this month, so no drift reading  -> data owner
2026-07-31  INFO   performance  41 loans have a 120-day label, under 300: AUC not rated  -> model owner, then the validator
2026-08-31  INFO   data         no new applications this month, so no drift reading  -> data owner
2026-09-30  INFO   data         no new applications this month, so no drift reading  -> data owner
2026-10-28  INFO   data         no new applications this month, so no drift reading  -> data owner

One red and one amber, both on drift, and no performance alert. The early AUC (0.667 on 30 June) is available two months before the slow AUC (31 August). monitor_log.csv holds the same run, one row per date: the file a funder or an auditor can be given. The performance information lines before 31 August say why there is no AUC, not that nothing is wrong.

4. Test a candidate version and check its change record. Save this as change.py. It builds version 1.1 without the wallet feature, compares the two versions on the same test loans, counts the decisions that move, and checks a change record against rules a committee would apply.

"""change.py: evidence and a change record for a candidate version of the chapter 2.2 card.

Standard library only. The roles, tiers and rules in CHECKS are ILLUSTRATIVE. Needs scorecard.py and monitor.py.
"""
import json
import math

import monitor as m
import scorecard as s

CANDIDATE = ["bureau_score", "delinquent_12m", "kyc_tier"]        # v1.1: the card without wallet_in_60d


def evaluate(card, train, test):
    bad = [r["bad"] for r in test]
    risk = [-s.score(card, r) for r in test]
    p = [1 / (1 + math.exp(-x)) for x in s.log_odds_bad(card, test)]
    return dict(names=card["names"], test_loans=len(test), observed=sum(bad), expected=round(sum(p), 1),
                z=round((sum(bad) - sum(p)) / math.sqrt(sum(q * (1 - q) for q in p)), 2),
                auc=round(s.auc(risk, bad), 3), ks=round(s.ks(risk, bad), 3),
                edges=m.band_edges(card, train))


def decisions_moved(old, new, train, test):
    """Test loans in the bottom score band of each card (edge: the first train quintile), and who moves."""
    low_old = {r["loan_id"] for r in test if s.score(old, r) < m.band_edges(old, train)[0]}
    low_new = {r["loan_id"] for r in test if s.score(new, r) < m.band_edges(new, train)[0]}
    bad = {r["loan_id"]: r["bad"] for r in test}
    came_in, went_out = low_new - low_old, low_old - low_new
    return dict(bottom_band_v1_0=len(low_old), bottom_band_v1_1=len(low_new), in_both=len(low_old & low_new),
                moved_in=len(came_in), moved_in_bad=sum(bad[i] for i in came_in),
                moved_out=len(went_out), moved_out_bad=sum(bad[i] for i in went_out))


REQUIRED = ["change_id", "model", "from_version", "to_version", "tier", "trigger", "change", "reason",
            "evidence", "decision_impact", "developer", "owner", "validator", "rollback", "monitoring", "fairness_retest"]


def check_record(rec, go_live=False):
    """Rules a change record must pass before it goes to committee, and one more before it goes live."""
    problems = [f"missing: {k}" for k in REQUIRED if not rec.get(k)]
    if rec.get("validator") and rec["validator"] in (rec.get("developer"), rec.get("owner")):
        problems.append("the validator is also the developer or the owner")
    ev = rec.get("evidence") or {}
    if not ev.get("before") or not ev.get("after") or ev["before"].get("test_loans") != ev["after"].get("test_loans"):
        problems.append("evidence must give before and after on the same loans")
    if ev.get("window_reused") and not rec.get("fresh_window"):
        problems.append("the candidate was chosen on the test months: name a fresh window to confirm it")
    if rec.get("to_version") != rec.get("from_version") and not (rec.get("monitoring") or {}).get("baseline_reset"):
        problems.append("a new version needs new monitoring baselines")
    if go_live:
        approval = rec.get("approval") or {}
        if approval.get("by") != "credit committee" or not approval.get("date"):
            problems.append("a tier 1 change needs the credit committee's approval and its date")
    return problems


def build_record(v10, v11, train, test, fixed=False):
    before, after = evaluate(v10, train, test), evaluate(v11, train, test)
    rec = dict(
        change_id="CHG-0001", model="owoleaf-application-scorecard", from_version="1.0", to_version="1.1", tier=1,
        trigger="monitor run 2026-06-30: wallet_in_60d PSI 0.334 (RED), 0.132 (AMBER) a month before",
        change="remove wallet_in_60d and refit the other three features on the same 543 training loans",
        reason="the feature was partly built on a window that reached before the data began (chapter 3.6)",
        evidence=dict(before=before, after=after, window_reused=True),
        decision_impact=decisions_moved(v10, v11, train, test),
        developer="credit-risk data scientist", owner="head of credit risk",
        validator="credit-risk data scientist",
        fairness_retest="repeat the fairness tests on v1.1: the kyc_tier weight rises from 0.55 to 0.65 once wallet_in_60d is gone",
        rollback="keep v1.0 deployed in shadow for 90 days; switch back on any RED alert on v1.1",
        monitoring=dict(baseline_reset=True, new_band_edges=after["edges"]))
    if fixed:
        rec["validator"] = "validation analyst, outside the credit-risk team"
        rec["fresh_window"] = "shadow both versions on live applications for one quarter, then compare outcomes"
        rec["approval"] = dict(by="credit committee", date="2026-11-24")
    return rec


def main():
    train, test = s.split(s.load_sample())
    v10, v11 = s.build_card(train, m.NAMES), s.build_card(train, CANDIDATE)
    draft = build_record(v10, v11, train, test)
    print("evidence, v1.0 then v1.1, on the same", len(test), "test loans:")
    for e in (draft["evidence"]["before"], draft["evidence"]["after"]):
        print("  ", {k: e[k] for k in ("names", "auc", "ks", "observed", "expected", "z", "edges")})
    print("decisions moved:", draft["decision_impact"])
    print("\ndraft record:")
    for p in check_record(draft, go_live=True) or ["none"]:
        print("  -", p)
    final = build_record(v10, v11, train, test, fixed=True)
    print("\ncorrected record:", check_record(final, go_live=True) or "passes")
    with open("change_record.json", "w") as f:
        json.dump(final, f, indent=2)
    print("written: change_record.json")


if __name__ == "__main__":
    main()
python3 change.py
evidence, v1.0 then v1.1, on the same 3102 test loans:
   {'names': ['bureau_score', 'delinquent_12m', 'kyc_tier', 'wallet_in_60d'], 'auc': 0.678, 'ks': 0.292, 'observed': 278, 'expected': 270.8, 'z': 0.47, 'edges': [557, 576, 591, 617]}
   {'names': ['bureau_score', 'delinquent_12m', 'kyc_tier'], 'auc': 0.678, 'ks': 0.289, 'observed': 278, 'expected': 290.2, 'z': -0.77, 'edges': [562, 577, 591, 617]}
decisions moved: {'bottom_band_v1_0': 405, 'bottom_band_v1_1': 467, 'in_both': 395, 'moved_in': 72, 'moved_in_bad': 10, 'moved_out': 10, 'moved_out_bad': 2}

draft record:
  - the validator is also the developer or the owner
  - the candidate was chosen on the test months: name a fresh window to confirm it
  - a tier 1 change needs the credit committee's approval and its date

corrected record: passes
written: change_record.json

Same AUC, a little less calibration (270.8 against 290.2 expected, with 278 observed), and 72 loans move into the bottom band while 10 move out. The first draft fails three checks. The validator is also the developer, the candidate was chosen on the test months so a fresh window is required, and a tier 1 change has no approval. The corrected record passes and is written to change_record.json. The committee date in it is an input you can change.

5. Replay a decision under each version. Save this as replay.py. It writes the decision record for two applications under both versions.

import json

import change
import monitor as m
import scorecard as s

train, test = s.split(s.load_sample())
v10, v11 = s.build_card(train, m.NAMES), s.build_card(train, change.CANDIDATE)
by_app = {r["application_id"]: r for r in test}
for app in (584, 10):
    r = by_app.get(app) or next(x for x in test if x["application_id"] == app)
    for version, card in (("1.0", v10), ("1.1", v11)):
        record = dict(application_id=app, model_version=version, points=s.score(card, r),
                      inputs={k: s.FEATURES[k][0](r) for k in card["names"]},
                      reasons=[(n, lost) for n, lost in s.reason_codes(card, r)])
        print(json.dumps(record, ensure_ascii=False))
python3 replay.py
{"application_id": 584, "model_version": "1.0", "points": 544, "inputs": {"bureau_score": "thin file", "delinquent_12m": null, "kyc_tier": "tier 1", "wallet_in_60d": "1: under ₦25,000"}, "reasons": [["bureau_score", 58], ["kyc_tier", 24]]}
{"application_id": 584, "model_version": "1.1", "points": 550, "inputs": {"bureau_score": "thin file", "delinquent_12m": null, "kyc_tier": "tier 1"}, "reasons": [["bureau_score", 58], ["kyc_tier", 28]]}
{"application_id": 10, "model_version": "1.0", "points": 555, "inputs": {"bureau_score": "thin file", "delinquent_12m": null, "kyc_tier": "tier 1", "wallet_in_60d": "2: ₦25,000-199,999"}, "reasons": [["bureau_score", 58], ["kyc_tier", 24]]}
{"application_id": 10, "model_version": "1.1", "points": 550, "inputs": {"bureau_score": "thin file", "delinquent_12m": null, "kyc_tier": "tier 1"}, "reasons": [["bureau_score", 58], ["kyc_tier", 28]]}

Application 584 scores 544 under 1.0 (the figure in chapter 2.2’s reasons) and 550 under 1.1, with the tier’s shortfall at 24 and then 28. Application 10 scores 555 under 1.0, as in chapter 2.2’s reuse.py, and 550 under 1.1. Each line holds everything needed to explain the score later: version, inputs as bins, points and reasons.

Alert on the point AUC. Save this as brk.py and run it.

import monitor as m

m.AUC_POINT_DROP = 0.02
m.main()
python3 brk.py | tail -4

The 30 September run turns amber, because 0.652 is 0.026 under the signed 0.678, and 28 October clears it with the same card at 0.678. A false alarm costs a meeting, and three of them cost the team’s attention. Now restore it and set AUC_FLOOR = 0.70: the interval rule turns the 30 September run red (interval top 0.688), so a floor placed above what the interval allows alarms on noise too. Restore that and set EARLY_DAYS = 60: the first early AUC moves from 30 June to 31 July (791 loans, 0.651), a month later, which is the price of waiting for a surer label.

ARTEFACT Write a model inventory entry and approval record ~45 MIN
YOU PRODUCEA model inventory entry and approval record

Template

# Model inventory entry: <model name and version>
Entry written by <name, role, team>, <date>. Approved by <body or person>, <date>.
Decision needed: <what the approver is asked to approve, and by when>.
Scope: <versions, products and customers this entry covers>.

## 1. Identity
- Owner: <name and role>. Developer: <name>. Validator: <name, not the developer or owner>
- Purpose: <the decision it drives, for which product and customers>
- Inputs and where they come from: <list>. Vendor or in-house: <which>
- Live since: <date>. Version history: <link to change records>

## 2. Risk tier
<tier> because <volume, money at stake, how much the decision relies on it>.

## 3. Validation status
- Tested on: <loans, window, label>. Result: <AUC, KS, calibration>
- Not yet tested: <fairness, fresh window, anything else>

## 4. Monitoring
| Measure | Rule and level | Owner | Latest reading and date |

## 5. Open alerts and changes
| Item | Raised | Owner | Next step and date |

## 6. Approvals
| Version or change | Approved by | Date | Conditions |

## 7. Review date and limits
Next review: <date>, or earlier if <trigger>. Out of scope: <what this entry does not cover>.
How this entry could be wrong: <one way, and what would show it>.
WORKED EXAMPLE

Abasi, who leads model governance in Owoleaf’s credit-risk team, writes this entry. At a real lender the governance lead or model owner writes it and the committee that owns the tier signs it; here that is the credit committee, and Ekanem at Northmere receives a copy. It is dated at the lab’s 28 October 2026 cut-off.

Decision needed. Approve scorecard 1.0 for continued use with one red alert open, and agree that CHG-0001 goes to a quarter of shadow running. Scope: version 1.0 only; 1.1 is a candidate.

Identity. Owner: the head of credit risk. Developer: the credit-risk data scientist. Validator: a validation analyst outside the credit-risk team (assumption: the lab names this role for 1.1, not for 1.0). In-house. It scores applications on bureau score, 12-month delinquency, KYC tier and wallet inflow in 60 days, for the whole lab book (assumption: every product). Live for applications from 1 April 2026, beside the old cut-offs.

Tier. Tier 1 (illustrative): it shapes every credit decision, and 3,102 live loans have been scored.

Validation. Signed on the test loans: AUC 0.678, KS 0.292, 270.8 bad loans expected against 278 observed (z 0.47). Not yet tested: fairness on 1.1, and a fresh window for it.

Monitoring. Drift: PSI 0.10 amber, 0.25 red; owner, the model owner. Performance: AUC rated from 300 labelled loans, amber below the bureau score alone; owner, the model owner, then the validator. Latest AUC 0.678 on 28 October (0.678 on 31 August, 0.652 on 30 September), against the bureau score’s 0.648 (0.617, 0.621).

Open. Red on wallet_in_60d, PSI 0.334 on 30 June; owner, the model owner. CHG-0001 awaits an independent validator, a fairness re-test and committee approval. Next step: committee, 24 November 2026 (the lab’s example date).

Approval and review. The committee signs for 1.0 only, on condition that CHG-0001 is answered. Next review 30 November 2026 (assumption: monthly runs), or on any red alert. Out of scope: overrides, which the lab does not log.

Could be wrong. The entry rests on one 120-day label window. An early-indicator AUC below 0.60 would show it.

Now you

You work for a payday lender in Abuja that has no scorecard. Every salary advance is decided on one number, the credit bureau’s score, with a cut-off set two years ago. Its funder, a bank, has sent a questionnaire like Ekanem’s and wants an inventory entry for each model that decides anything. The only one is the bureau score, a vendor model you cannot open. Write the entry and approval record for it.

Treat the lab’s benchmark readings as your lender’s own, and say so as an assumption: the score alone ranks the same loans at 0.617 on 31 August, 0.621 on 30 September and 0.648 on 28 October, with thin files treated as the lowest. Its PSI for bureau_score is 0.009, 0.002 and 0.009 for April, May and June. Name an owner on your side, say what you need from the vendor by contract, and state any date you assume. The head of credit signs it, and the credit committee reads it. It supports one decision: whether the score stays the only input to advances while monitoring is set up.

Self-check

DECIDE

Owoleaf at 200 people. The 30 June red alert on wallet inflow has been open since 30 June. Candidate 1.1 matches 1.0 on AUC (0.678) and loses a little calibration (290.2 expected against 278 observed), and moves 72 loans into the bottom band and 10 out. Its KYC tier weight rises from 0.55 to 0.65. Abasi must decide what goes to the credit committee, and Ekanem at Northmere has asked what changed since go-live.

READING
  1. DOC
    SR 26-2: Revised Guidance on Model Risk Management Board of Governors of the Federal Reserve System, 2026

    The US supervisory letter, dated 17 April 2026, that the Fed's page says supersedes SR 11-7. Read its sections on validation, ongoing monitoring and governance; skip anything tied to US bank size. This chapter did not read the full text.

  2. DOC
    AI Act Article 26: obligations of deployers of high-risk AI systems European Commission, AI Act Service Desk

    The European Commission's page on what a deployer must do: oversight, monitoring and logs. Read it for the duties a lender using a vendor's high-risk model would carry, and check the dates against the amended Act.

  3. DOC
    AI Act Article 72: post-market monitoring by providers European Commission, AI Act Service Desk

    The Commission's page on the monitoring plan a provider must keep. Read it as the vendor's half of the job this chapter builds, and compare it with the consolidated official text.

  4. DOC
    Regulation (EU) 2024/1689, the AI Act European Parliament and Council, 2024

    The official text. Read Annex III on creditworthiness and the articles on risk management, logging and oversight, and check the application dates against the amending act.

  5. POST
    EU AI Omnibus enters into force, amending the AI Act White & Case

    A law firm's alert on Regulation (EU) 2026/1744 and the postponed high-risk dates. It is commentary, not law: read it for what moved, then confirm the dates in the consolidated text.

  6. DOC
    Nigeria Data Protection Act 2023 Federal Republic of Nigeria (copy hosted by KPMG Nigeria), 2023

    A consultancy's copy of the Act. Read section 37 on automated decision-making and compare its wording with this chapter's note, then check it against the official text before you cite a subsection; skip the commission's administration.

  7. POST
    AI Watch: global regulatory tracker, Nigeria White & Case

    A law firm's tracker that says, in the summaries this chapter saw, that Nigeria has no AI-specific statute and that the Data Protection Act is the main law reaching AI use. Read it for orientation; it is commentary and not a source of rules.

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 launch plan for a lending business →