AI for Financial Risk, Compliance and Regulatory Reporting — book cover, Sreedhara Reddy Kotha
Companion Repository

AI for Financial Risk, Compliance and Regulatory Reporting

Built around Avon & Wessex Bank plc—a fictional £40 billion UK bank supervised by the PRA and FCA—this book follows the complete AWB-AI-2026 transformation from business case to production operation. It shows how LLMs, AI agents, RAG and predictive models can be applied across credit, market, liquidity and operational risk, AML/KYC, regulatory reporting and model governance. Readers follow the development of 33 primary AI systems and 11 agentic governance pipelines, including agentic credit decisioning, regulatory intelligence, risk monitoring and an integrated CRO/CFO platform. Every system is supported by working, tested Python in the companion repository rather than simplified pseudocode or isolated demonstrations. Governance is engineered into each solution from the outset through PRA SS1/23 controls, EU AI Act human-oversight checkpoints, audit trails, validation gates and DORA resilience requirements. The book also provides a transparent six-step ROI methodology covering baseline cost, automation benefits, system cost, net savings, build investment and three-year NPV at an 8% hurdle rate. The fictional AWB programme demonstrates how a £3.2 million investment can deliver £12.1 million in documented annual savings across a governed enterprise AI platform. Realistic failure scenarios—including a £12 million RAG near-miss and an £840 runaway agent bill—show what can go wrong and the controls required to prevent recurrence. The result is a practical implementation and architecture guide for professionals who need to move beyond AI experimentation and operate trustworthy systems in regulated banking.

16
Chapters
33
Primary AI Systems
11
Agentic Pipelines
66K+
Lines of Python
16Chapters
33Primary AI systems
11Agentic pipelines
66K+Lines of Python
£12.1MCumulative annual savings
8Regulatory frameworks

Figures reflect the book's full AI Model Registry Index (Appendix D): 33 primary systems plus 11 agentic governance pipelines built on top of them. Per-chapter and jacket-copy figures elsewhere in this repository may cite earlier subsets of this same registry.

Why This Book

Built for production, not for a demo day

Most AI-in-banking material stops at the proof of concept. This book starts where that ends.

Governed from day one

PRA SS1/23's four-gate deployment framework, EU AI Act human-oversight checkpoints, and DORA's 70% LLM-concentration cap are load-bearing design constraints in every chapter — not a compliance appendix bolted on afterward.

Working code, not pseudocode

Every system described — 33 primary AI/ML systems and 11 agentic oversight pipelines — ships as tested Python 3.11+ in this repository, each carrying its own AWB Model Registry (MR) reference.

Failures included, deliberately

A £12M near-miss from an ungrounded RAG query, an £840 overnight agent API bill, and a real PRA s166 skilled-person review are worked through with the same rigor as the wins — because that's what actually changes how you build.

The AWB Case Study

One bank, sixteen chapters, one continuous build

Avon & Wessex Bank's AWB-AI-2026 programme runs end to end through the book — each chapter's system feeds data or governance into the next.

1

Business Case

Three converging pressures, the £3.2M programme case, and the ROI methodology used throughout.

Ch. 1
2

LLMs & Document Intelligence

Transformer foundations and the Credit Document Analyser cutting extraction from 90 to 18 minutes.

Ch. 2
3

Agents & Regulatory RAG

The Credit Decision Agent and a RAG assistant grounded across 847 regulatory documents.

Ch. 3–4
4

Risk & Compliance Systems

Credit, market, operational, liquidity, model risk, regulatory reporting, and AML/KYC in production.

Ch. 6–12
5

Governance & MLOps

The governance platform, model risk committee, enterprise architecture, and CI/CD gates keeping it all trustworthy.

Ch. 5, 10, 13–15
6

Integrated Platform

Every system unified into one CRO/CFO dashboard the bank runs on Monday morning.

Ch. 16
Who It's For

Find your entry point

The book is written to be read cover to cover, but each role tends to start in a different place.

Risk & Compliance Professionals

Start with the regulatory map in Chapter 1, then the governance platform (Ch. 5), model risk framework (Ch. 10), and regulatory reporting automation (Ch. 11) — the chapters that translate PRA SS1/23, the EU AI Act, and DORA into working controls.

Ch. 1, 5, 10, 11PRA SS1/23EU AI ActDORA

Software Developers & ML Engineers

Chapters 2–4 and 14 are the technical core: transformer fundamentals and document extraction, the LangGraph agentic pattern, RAG evaluation with RAGAS, and the CI/CD gates that keep 33 systems reliable in production.

Ch. 2, 3, 4, 14LangGraphRAGMLOps

Enterprise & Solution Architects

Chapters 13, 15, and 16 cover the shared awb_commons library, multi-cloud DORA resilience, the BCBS 239-aligned data platform, and the orchestration layer that integrates fifteen chapters of independent systems into one platform.

Ch. 13, 15, 16MicroservicesKafkaAPI Gateway

Model Risk Managers & Validators

Chapters 1, 5, and 10 walk through the full PRA SS1/23 lifecycle — registration, independent validation, and ongoing monitoring — including the model registry, drift detection, and explainability tooling used to defend every model in the book.

Ch. 1, 5, 10SS1/23 4-gateModel registrySHAP

CROs, CCOs, CTOs & Transformation Leaders

Chapter 1 for the business case and ROI methodology, the risk-domain chapters (6–10) for what each system saves and why, and Chapter 16 for the integrated CRO/CFO dashboard the whole programme builds toward.

Ch. 1, 6–10, 16ROI methodology£12.1M savingsDORA Art.28
Inside the Book

Sixteen chapters, five parts

Each chapter maps to one or more production AI systems in the AWB model registry. Open a chapter for its summary and MR reference, or jump straight to the folder and core file.

Every production AI system rests on three pillars: a compelling business case, a well-governed LLM layer, and a shared technical foundation. Part I builds all three for AWB, ending with four registered models and a reusable awb_commons library used in every chapter that follows.

01AI TransformationSS1/23: N/A

AWB faces three converging pressures — regulatory complexity, cost, and AI-native competitors — that make this the decisive moment for AI adoption in UK banking. This chapter lays the foundation: the £3.2M AWB-AI-2026 programme business case, the six-step ROI methodology used throughout the book, and the UK/EU regulatory map every later system is built against.

02GenAI & LLMsSS1/23: MEDIUM

MR-2026-035 · MR-2026-036

Introduces the transformer architecture and prompt-engineering patterns behind every LLM in the book, then builds the Credit Document Analyser (MR-2026-035) — cutting financial data extraction from up to 90 minutes to 18 minutes per document at 97.3% accuracy, fully PRA SS1/23 and EU AI Act compliant.

03AI AgentsSS1/23: HIGH

MR-2026-037

Extends the Document Analyser into a full agentic workflow — the Credit Decision Agent (MR-2026-037) — orchestrating four sub-agents into a Basel III IRB/CRR3-compliant credit recommendation. A parallel Treasury Operations Agent cuts the morning cash-positioning cycle from 6 hours to 25 minutes, for £2.1M/year combined saving.

04RAG SystemsSS1/23: LOW

MR-2026-038

Builds the Regulatory Knowledge Assistant (MR-2026-038), grounding answers across 847 PRA, FCA, and EBA documents after a near-miss where an ungrounded query nearly caused a £12M capital miscalculation. Introduces the RAGAS evaluation harness and hybrid retrieval that make regulatory RAG auditable.

05AI GovernanceSS1/23: LOW

MR-2026-039

Builds the AI Governance Platform that registers, validates, and monitors every model in the book under PRA SS1/23's three pillars — registration, independent validation, and ongoing monitoring. Cost £48.5K to build against the £2.8M s166 skilled-person review it protects AWB from.

Part II applies the Part I foundations to the five core risk domains every UK bank must manage — credit, market, operational, liquidity, and model risk — each delivered as a production-grade system with a full ROI derivation.

06Credit RiskSS1/23: HIGH

MR-2026-041, 043–046, 055, 066–068, 070

Replaces AWB's fragmented credit monitoring with the Credit Intelligence Monitor — five modules spanning covenant compliance, adverse news, PSI drift, IFRS 9 staging, and CFO narrative — on one Airflow DAG and one governance registration. Its credit API becomes the PD source for Chapter 7's CVA and the staging feed for Chapter 11's regulatory reporting.

07Market RiskSS1/23: HIGH

MR-2026-046–048

Applies the same platform discipline to the trading book — Monte Carlo VaR, expected shortfall, FRTB SA/IMA, and a CVA calculator consuming Chapter 6's PD term structure. Cut FRTB back-test exceptions from ~10/year to 3, avoiding a capital multiplier that would have raised SA-FRTB capital up to 4×.

08Operational RiskSS1/23: MEDIUM

MR-2026-041, 042, 043, 049–051

Builds AWB's payment fraud detector, NLP loss-event classifier, and application fraud scorer inside the same governance frame. The fraud model scores 2.4M daily transactions at P99 54ms, targeting a reduction from £7.2M to under £1.5M/year in fraud losses.

09Liquidity RiskSS1/23: HIGH

MR-2026-044, 045, 052, 054, 073

Moves to the tightest time constraints in the book — a miscalculated intraday position can trigger a CHAPS settlement failure within hours. Builds real-time LCR/NSFR engines and an intraday monitor (BCBS 248) that fixed the architectural gap behind a March 2025 CLAR breach, for £2.75M net annual benefit.

10Model RiskSS1/23: HIGH

MR-2026-056, 058

Builds the enterprise Model Risk Management platform — validation, monitoring, and governance for every AI/ML model built through Chapter 9 — answering not "can we build a better model" but "can we prove it can be trusted." Governs all registered systems under one Model Risk Committee.

Having mastered the five core risk domains, Part III turns to the regulatory and financial crime obligations that sit across every domain — where AI becomes a compliance accelerator, monitoring obligations in real time and generating the machine-readable evidence regulators increasingly require.

11Regulatory ComplianceSS1/23: MIXED

MR-2026-069-REG, 071, 072

Automates what previously took 2.4 FTE per quarter — COREP capital returns, LCR/NSFR calculations, and the CRR3 Art.429 leverage ratio return — cutting the quarterly cycle from 340 analyst-hours to 45 (94% reduction). AWB's Q4 2025 leverage ratio of 4.2% clears the 3.0% Pillar 1 minimum by 120bps.

12AML & KYCSS1/23: HIGH

MR-2026-061–064

Builds AWB's AML, KYC, and financial crime prevention platform — digital identity verification, ML transaction monitoring, and borrower KYC — under POCA 2002, FCA SYSC 6.3, and JMLSG guidance. Cut false-positive alerts 80% (8,400 to 1,680/month) while maintaining 340 SARs/year, saving £1.15M/year.

Building individual AI models is straightforward; running them reliably in a regulated bank is a different engineering challenge. Part IV covers the microservices architecture, MLOps/LLMOps pipeline, and BCBS 239-compliant data platform that make everything else sustainable.

13Enterprise ArchitectureSS1/23: HIGH

Connects everything built in Parts I–III into one enterprise platform — microservices, multi-cloud DORA resilience, and Temenos T24 integration — after three independently designed systems that couldn't integrate cost AWB eleven weeks of unplanned rework and a DORA incident. The shared awb_commons library now underpins every AI service in the registry.

14MLOps & LLMOpsSS1/23: LOW

MR-2026-053, 058

Builds the operational discipline that keeps every AI model reliable in production — CI/CD retraining pipelines, prompt versioning, and drift monitoring — making it structurally impossible to deploy a model that hasn't passed the four-gate pipeline. If Chapter 13 is the motorway network, this is the traffic management system.

15Data InfrastructureSS1/23: MEDIUM

MR-2026-054

Builds the least visible, most load-bearing layer of the platform — a BCBS 239-aligned risk data warehouse, a point-in-time feature store, and GDPR-compliant governance feeding 20+ AI systems. Data quality is scored across 11 BCBS 239 principles at a 9.2/10 target.

The capstone: taking fifteen chapters of individually validated AI systems and integrating them into one coherent, production-ready platform the CRO can rely on at 07:30 on a Monday morning.

16Integrated PlatformSS1/23: HIGH

MR-2026-074-IP

The capstone — unifies Customer 360, the risk data warehouse, the feature store, and all systems built across Chapters 1–15 into one CRO/CFO dashboard with real-time risk position and BCBS 239 compliance views, closing AWB's final data-distribution gap in a single orchestration layer.

Sample the Book

Read before you buy

Real excerpts from the manuscript — the Preface, the Chapter 1 opening, and a live-rendered production architecture diagram straight from the companion code.

Preface

Why I Wrote This Book

"This book exists because I kept having the same conversation with risk and compliance leaders across UK banks: everyone agreed AI would transform financial services risk management, and almost no one could point to a production system that had actually done it — end to end, under real regulatory scrutiny."

The Preface sets out what the book is (a practitioner's build log, grounded in a fictional but realistic AWB case study) and what it deliberately is not (a survey of AI theory, or a vendor pitch). It closes with a note on why Avon & Wessex Bank plc is invented rather than named, and how to read the book if you only have time for one path through it.

Chapter 1 · War Story

The £4.1M Compliance Failure

PRA s166 Skilled Person review, triggered by three model risk deficiencies. Review fees of £680,000, remediation costs of £1.4M, and a £2.0M regulatory capital add-on totalled £4.1M — before AWB had built a single AI governance control. The root-cause analysis behind that failure is what makes Chapter 5's governance platform non-negotiable rather than nice-to-have, and the chapter closes with a "for your project" checklist drawn directly from it.

Chapter 1 opens with the three forces — regulatory, cost, and competitive pressure — that converged on UK banking through 2024–2025. As the manuscript puts it: "This book is the practical response to that convergence."

Production Architecture

Chapter 6 — Credit Intelligence Monitor

Rendered live from the same Mermaid source shipped in chapter-06-credit-risk/README.md — the real architecture diagram, not a mockup.

flowchart TD A["T24 / Core Banking Data"] --> B["Feature Engineer"] C["Credit Bureau + Open Banking"] --> B B --> D["LightGBM Scorer"] D --> E{"Decision"} E -->|APPROVE| F["Origination Outcome"] E -->|REVIEW| G["Human Review Queue"] E -->|DECLINE| H["Decline Letter Generator"] I["Corporate Facility Data"] --> J["Corporate PD Model"] J --> K["CRR3 RWA Calculator"] K --> L["COREP C 07.00"] M["Portfolio Snapshot"] --> N["EWS Rules + LLM Scan"] M --> O["Concentration Monitor"] N --> P["Credit Analyst Review"] O --> P D --> Q["Audit Log"] J --> Q N --> Q
View full source on GitHub →
What You'll Be Able to Build

Practical outcomes, not just theory

By the end, you'll have working reference implementations for:

01
Governed enterprise LLM gatewayA shared, DORA-compliant multi-provider routing layer (Ch. 13).
02
Regulatory RAG with citationsSource-grounded answers across hundreds of regulatory documents (Ch. 4).
03
Human-in-the-loop agent workflowsMulti-agent decisioning with mandatory HITL checkpoints (Ch. 3).
04
PRA SS1/23-aligned model registryRegistration, validation, and monitoring for every model (Ch. 5, 10).
05
Document & financial statement analysersLLM extraction pipelines at 97%+ accuracy (Ch. 2).
06
AI-assisted regulatory reportingCOREP, LCR/NSFR, and leverage ratio automation (Ch. 11).
07
Prompt, model & data drift monitoringPSI-based drift detection and prompt version control (Ch. 14).
08
Auditable risk & compliance systems7-year audit logs and BCBS 239-aligned data quality (Ch. 15).
09
Core-banking integration patternsTemenos T24 integration and event-driven architecture (Ch. 13).
10
Integrated CRO/CFO risk dashboardOne real-time platform unifying every system built (Ch. 16).

Companion documentation

Reference material from the book's appendices, kept current between print editions.

Appendix A — Glossary

~100 AI/ML, regulatory, and AWB-specific terms, reproduced from the book's own glossary.

Appendix B — Regulatory Reference

Article-level summaries: PRA SS1/23, EU AI Act, DORA, CRR3/Basel IV, POCA, FCA Consumer Duty.

Appendix C — Tech Stack

Approved LLM models (Table 1.9), library versions, AWS services, and per-chapter cost estimates.

Appendix D — Model Registry Index

Every MR reference in the book, cross-referenced to its chapter — primary systems and agentic pipelines.

Regulatory framework covered

PRA SS1/234-gate deployment, enterprise model registry
EU AI ActHigh-risk classification, Art.14 human oversight
DORA Art.28LLM concentration cap — no provider > 70%
DORA Art.11RTO ≤ 120 min (P1), PRA notification ≤ 4 hrs
CRR3 Art.72eOutput floor ≥ 55% (SS1/23 Gate 4)
FCA PS22/9Consumer Duty — fairness parity ±5pp
BCBS 239Data quality target ≥ 9.2/10
FCA COBS 97-year audit log retention
POCA 2002 / JMLSGSAR handling, s.333A MLRO-only access
UK GDPR / DPA 2018Data governance across the feature store

These are the regulatory frameworks referenced throughout the book's AWB case study, current as of June 2026. This is educational material, not legal or regulatory advice — verify current requirements with your own legal and compliance function before relying on any of it for a live programme.

The Author

Sreedhara Reddy Kotha

Author, "AI for Financial Risk, Compliance and Regulatory Reporting"

Sreedhara Reddy Kotha ("Sree") is a finance and AI professional with more than two decades of experience across global banking environments in risk management, regulatory reporting, finance technology, data platforms and enterprise transformation.

The views expressed in this book are the author's own and do not represent the views of any current or former employer.

Stop experimenting. Start operating.

Sixteen chapters, 33 primary AI systems, and 11 agentic governance pipelines — every one of them working, tested, and built to survive a real regulator's scrutiny.