CLCreditLens
OverviewUnderwritingPortfolioMonitoringFair lendingGovernanceAI assistance

A portfolio project by Siddharth Hiraou. Every figure is generated from the model artifacts in the repository and reproducible with make train. Trained on synthetic data, not a real lender, and no real applicants.

For the underwriting desk

AI assistance, on a short leash

Two places where a language model genuinely saves time in a lending operation, writing decline letters and answering questions about the book, with hard limits on what it is allowed to say.

The question this page answers

Where can AI actually help here without becoming a liability?

Both of these are real chores. An underwriter drafts the same decline letter hundreds of times a month, and an analyst spends their morning pulling numbers someone could have looked up. Neither task needs judgement, which is exactly why they suit a model, and why the model is given no authority over the decision itself. It writes about decisions already made, from reasons it was handed, and it cannot query the database freely.

No Anthropic credentials are configured in this build. The examples below come from the deterministic offline paths (a template memo and retrieval-only copilot output) rather than from a model. They are labelled as such rather than presented as generated text. With a key set, the same code calls the API and the label disappears.

Memo tier

Haiku 4.5

High volume, templated, low temperature.

Copilot tier

Sonnet 5

Open questions over policy and stats.

Cost per memo

$0.0025

Cost per 1,000 decisions

$1.00

400 memos, only non-approvals get one.

Adverse action memos

The model narrates reason codes it was handed. It cannot introduce one, and it cannot change the decision.

applicant 100003declineoffline-templatememo-v1 · af3bb14b06514360

The application for 616,300 was not approved. The principal reasons recorded were: (1) Proposed monthly payment is high relative to stated income. (2) Record of late or partial payments on prior obligations. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Record of recent declined or withdrawn credit applications.

This decision reflects 4 principal reasons drawn from the information in the application and the credit file. (1) Proposed monthly payment is high relative to stated income. (2) Record of late or partial payments on prior obligations. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Record of recent declined or withdrawn credit applications. Each reason is listed separately because each contributed independently; no single item determined the outcome on its own.

Some of the reasons above can change over time: debt-to-income repayment record delinquency on credit file. An applicant may request a copy of the credit report used and may reapply once circumstances have changed.

cited: affordability · repayment_history · bureau_delinquency · prior_applications

applicant 112670declineoffline-templatememo-v1 · 557e62d00ac3b081

The application for 226,800 was not approved. The principal reasons recorded were: (1) Record of late or partial payments on prior obligations. (2) Credit reporting agency score is below the level required for approval. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Proposed monthly payment is high relative to stated income.

This decision reflects 4 principal reasons drawn from the information in the application and the credit file. (1) Record of late or partial payments on prior obligations. (2) Credit reporting agency score is below the level required for approval. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Proposed monthly payment is high relative to stated income. Each reason is listed separately because each contributed independently; no single item determined the outcome on its own.

Some of the reasons above can change over time: repayment record delinquency on credit file debt-to-income. An applicant may request a copy of the credit report used and may reapply once circumstances have changed.

cited: repayment_history · external_score · bureau_delinquency · affordability

applicant 125324declineoffline-templatememo-v1 · 2650be3fc1a7e1ff

The application for 371,500 was not approved. The principal reasons recorded were: (1) Record of late or partial payments on prior obligations. (2) Length of employment is shorter than required for approval. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Proposed monthly payment is high relative to stated income.

This decision reflects 4 principal reasons drawn from the information in the application and the credit file. (1) Record of late or partial payments on prior obligations. (2) Length of employment is shorter than required for approval. (3) Credit file shows past-due amounts or accounts reported delinquent. (4) Proposed monthly payment is high relative to stated income. Each reason is listed separately because each contributed independently; no single item determined the outcome on its own.

Some of the reasons above can change over time: repayment record delinquency on credit file debt-to-income. An applicant may request a copy of the credit report used and may reapply once circumstances have changed.

cited: repayment_history · employment_stability · bureau_delinquency · affordability

Every memo is validated before it is returned. The output is parsed into a schema that rejects decision language, and a grounding check discards any memo citing a reason family the decision did not carry. A failed memo is thrown away, not repaired.

The prompt receives the decision, the reason codes, the requested amount and a 25k income band. It never receives the applicant's feature vector or date of birth. Every call is logged with the model, prompt hash and cost.

Analyst copilot

Three read-only tools. The model picks a named query and supplies parameters, and it never writes SQL.

What does our policy say about referring applications with thin bureau files?

No Anthropic credentials are configured, so this is retrieval output rather than a synthesised answer. The most relevant passages are:

credit_policy.md · 3.2 Thin bureau file
  **Fewer than three bureau trade lines, or fewer than 24 months of bureau history.**
A thin file is not itself adverse. It means the model has less to work with, and the
score carries wider uncertainty. The underwriter should seek corroborating evidence
of income and residence stability rather than treating thinness as a negative.

fairness_findings.md · Fairness Findings
  Measured on the out-of-time test fold (16,276 applications, 16.81% bad rate) at
a 60% target approval rate. Reproduce with `make audit`.

**What this document claims:** disparity was measured, mitigation options were
tested, and the cost of each was quantified. **What it does not claim:** that
the model is fair, or that bias was removed.

credit_policy.md · 3.3 No external bureau score
  Where all external bureau scores are absent, the application is referred regardless
of band. The model handles the missingness, but a fully unscored applicant warrants
a human look.

offline-retrievalcredit_policy

Can we use group-specific thresholds to fix disparate impact?

No Anthropic credentials are configured, so this is retrieval output rather than a synthesised answer. The most relevant passages are:

fairness_findings.md · Group-specific thresholds: analytical only
  | Constraint | Approval rate | Disparate impact | Equal-opportunity gap | Bad rate among approved |
|---|---|---|---|---|
| Demographic parity | 96.1% | 0.9954 | 0.0150 | 14.88% |
| Equalized odds | 96.0% | 0.9731 | 0.0034 | 14.92% |

**These are not deployable.** Setting a different decision threshold by a
protected class is disparate treatment under US fair lending law, even when the
intent is t

credit_policy.md · 9.3 Prohibited mitigation
  Group-specific decision thresholds may **not** be deployed. Setting a different
cutoff by protected class is disparate treatment, irrespective of intent. Threshold
optimisation may be run analytically to size the tradeoff; its output is evidence
for the Committee, never a configuration.

fairness_findings.md · Gender
  | Group | n | Selection rate | Observed bad rate | Calibration gap |
|---|---|---|---|---|
| F | 10,808 | 0.6045 | 0.1676 | +0.0067 |
| M | 5,468 | 0.5913 | 0.1692 | +0.0083 |

Disparate impact 0.978, comfortably inside the four-fifths threshold. The
1.3-point selection-rate gap tracks a 0.2-point difference in observed bad rate.
Calibration gaps are within a percentage point for both groups: a gi

offline-retrievalcredit_policy

When must we retrain the model?

No Anthropic credentials are configured, so this is retrieval output rather than a synthesised answer. The most relevant passages are:

credit_policy.md · 8.1 Stability
  Population Stability Index on the score is computed daily against the training
baseline. **PSI below 0.10 is stable; 0.10 to 0.25 requires investigation; above
0.25 triggers a retraining candidate and notification to the Model Risk Committee.**

credit_policy.md · 3. Referral rules
  An application is referred to manual underwriting when any of the following holds,
regardless of score:

fairness_findings.md · The tension that cannot be resolved
  Calibration-by-group and equalized odds cannot both hold when base rates differ
across groups. That is a mathematical result, not an implementation gap. This
model prioritises **calibration** (a predicted PD means the same thing for
every band, within about a percentage point) and consequently does not satisfy
equalized odds.

That is a policy choice, and it belongs in the model card as one.

offline-retrievalcredit_policy

Whitelisted portfolio queries

The complete set the copilot may call.

QueryReturns
decision_mixCounts and shares by decision band at the current policy.
bad_rate_by_bandObserved bad rate and mean predicted PD per decision band.
approval_rate_at_cutoffApproval rate, bad rate and expected loss at a given score cutoff.
score_percentilesScore distribution percentiles across the out-of-time fold.
bad_rate_by_vintageObserved bad rate and mean predicted PD by origination cohort.
worst_drifting_featuresFeatures with the highest characteristic stability index.
reason_code_frequencyHow often each reason-code family appears among declines.

The model chooses a name from this list and supplies typed parameters. It cannot compose, extend or inject SQL, because it never emits SQL. Letting a model write queries against a production database, even read-only and even with a careful prompt, makes the prompt the security boundary, and a prompt is not a security boundary.

Guardrails

  • • The LLM never sets, changes or overrides a lending decision. Neither feature has a tool that writes anything.
  • • The memo generator receives a decision already made and writes prose about it.
  • • Reason families cited are checked against the families issued; a mismatch discards the memo.
  • • Prompts receive banded figures, never raw applicant records.
  • • Every call is logged with model, prompt hash, token counts and cost.
  • • Retrieval is over documents in this repository, and every passage cites its source and heading.

Unit economics

Why the tiers are split the way they are.

Memo generatorAnalyst copilot
Modelclaude-haiku-4-5claude-sonnet-5
Input / output per 1M$1.00 / $5.00$2.00 / $10.00
Volume driverDecisionsAnalyst questions
Scales with decisionsyesno

Memos are high volume and templated, so they run on the cheap tier at $0.0025 each, 400 per 1,000 decisions, since only non-approvals get one, for $1.00 per 1,000. The copilot answers open questions and needs real reasoning, so it runs on the mid tier; its usage is analyst-driven and does not scale with decision volume, which is why it is priced separately rather than folded into the per-decision figure. Sonnet 5 pricing shown is introductory, through 2026-08-31.

Step 7 of 7

Back to the start · Overview

What does this thing do?

→