LearnSystem design

Fraud-investigation copilot

Design a copilot for financial-crime analysts that summarises an alert, pulls relevant transactions and customer history, highlights suspicious patterns and drafts a case narrative — without slowing real-time fraud scoring.

Applied LLM8 parts

Contents

What to cover

Sketch your own design first. A complete answer has these parts; the notes say what each should settle.

  1. Requirementsalert volumes and analyst capacity; decision rights (who decides); regulatory reporting needs; data access controls; latency per case; success metric (time per case, quality)
  2. Estimates
  3. API
  4. Data model
  5. Architectureexisting real-time scoring untouched; case service assembling features, transaction timelines and model explanations via tools/SQL; LLM summarisation and narrative drafting grounded in retrieved records with references; pattern highlights from deterministic analytics; analyst UI with accept/edit; audit log and model-risk documentation; evaluation with analysts (time saved, error rate, inter-rater checks); feedback into rules/models
  6. Deep divesthe narrative states a transaction amount that doesn’t exist — prevent it.; How do you show regulators how the copilot influenced decisions?
  7. Trade-offsautomation vs analyst judgement; LLM narrative vs templated text; data minimisation vs context richness; cost per case
  8. EvaluationLLM kept out of the scoring hot path; numbers from deterministic queries; grounded, auditable outputs; analyst-centred evaluation; privacy controls

Reference design

One way to answer it, part by part. Open a part once you have your own version of it.

Requirements

Functional: when an analyst opens an alert, show a brief (why it fired, key facts, transaction timeline, linked entities), highlighted suspicious patterns with evidence, answers to follow-up questions, and a draft case narrative (including SAR-style text) that the analyst edits and owns.

Assumptions to confirm

  • Alert volumes and analyst capacity: ~15k fraud and financial-crime alerts/day; ~300 analysts at ~40 cases/day = 12k — a backlog today. Average 12 minutes per case.
  • Decision rights: analysts decide (release, block, exit, file a SAR); the copilot never recommends a final disposition at launch and never contacts customers.
  • Regulatory reporting: SARs to the NCA, including defence-against-money-laundering requests with statutory timelines; tipping-off rules mean nothing reaches customer-facing channels; five-year record keeping; model risk management expectations (PRA SS1/23 formally applies to banks with internal-model approval and covers AI-based models; others use it as good practice) should be applied to a tool that informs decisions.
  • Data access controls: analysts see only cases they are assigned; least-privilege tools; data minimisation; no customer data used for model training; EU/UK hosting.
  • Latency per case: brief ready when the case is opened (precomputed within 30 s of alert creation); follow-up answers < 5 s.
  • Success metric: time per case down from 12 to ~7 minutes with no drop in decision quality; zero fabricated facts in narratives.
  • Hard constraint: real-time fraud scoring (< 50 ms) is untouched.

Estimates

  • Brief generation: 15k alerts × ~10k input tokens (≈ 200 transactions × 30 tokens + profile + model explanation + prior cases) = 150M input + 12M output tokens/day. At an assumed $3/M in, $15/M out: $450 + $180 ≈ $630/day.
  • Interactive questions: ~3 per case × ~12k tokens → 540M input ≈ $1.6k, plus ~13.5M output ≈ $200 → ~$1.8k/day.
  • Total: ~$2.4k/day ≈ 16 cents per case.
  • Value: saving 5 minutes × 15k cases = 1,250 analyst-hours/day; at ~£35/hour loaded that is ~£44k/day, and the 12k-case capacity becomes ~20k, clearing the backlog.
  • Data access load: ~10 parameterised queries per case → 150k queries/day (~2/s) against a read replica or warehouse — negligible, and never against the scoring path’s stores.
  • Audit storage: evidence snapshots, outputs and edits ≈ 200 KB per case → 3 GB/day, ~5.5 TB over five years.

API

Event in:  alert.created {alert_id, customer_id, rule_or_model, score, reason_codes}  → precompute brief

GET  /v1/cases/{id}/brief
  → {summary, timeline: [{ts, event, ref}], highlights: [{pattern, explanation, evidence_refs[]}],
     open_questions[], refs: {"tx:8812": {...}}, model_version, generated_at}
POST /v1/cases/{id}/ask        {question}  → {answer, refs[], queries_run[]}
POST /v1/cases/{id}/narrative/draft  {template: "internal"|"sar"}  → {sections: [{text, refs[]}]}
PUT  /v1/cases/{id}/narrative  {final_text, accepted_sections[], edits}

Read-only tools the LLM can call (parameterised, scoped to the case’s customer and counterparties):

get_transactions(customer_id, from, to, filters)   get_counterparties(customer_id, window)
get_kyc_profile(customer_id)                       get_model_explanation(alert_id)
get_prior_cases(customer_id)                       run_pattern(name, params)  # deterministic analytics

No tool writes, decides or files anything; dispositions stay in the case-management system.

Data model

  • Alert / Case: owned by the existing case-management system; the copilot stores only references.
  • EvidenceRecord: ref_id (e.g. tx:8812), source table and primary key, query hash, snapshot of the values used, retrieved_at. Everything the LLM may mention must exist here.
  • PatternResult: pattern name (velocity spike, structuring, new payee then drain, round amounts, mule indicators, shared device), parameters, result, evidence refs.
  • Brief / NarrativeDraft: version, model and prompt versions, text with ref placeholders, validator result.
  • AnalystInteraction: questions asked, answers shown, sections accepted, edit diff, time on case.
  • AuditEvent (immutable): who saw what, what the copilot showed, what was accepted, final decision reference and decider.
  • ModelRiskRecord: inventory entry, intended use, limitations, validation results, monitoring thresholds, approvals.

Architecture

Flow · 5 stepsCopilot beside real-time scoring

Copilot beside real-time scoringCard auth feeds real-time scoring, which feeds the decision and also emits alerts to the case-management system. The copilot case service reads CDC copies and assembles evidence, runs deterministic analytics, drafts with the LLM, renders references and validates before showing the analyst UI, with an audit log downstream.Card authauthorisation pathReal-time scoringunchanged, < 50 msDecisionauthorisation decisionCase managementsystemowns alerts and casesRead replica / warehouseCDC copiesEvidence assemblytyped tools / SQL, scopedDeterministic analyticsvelocity, structuring, graph linksLLMbrief and narrativeRendererfills referencesValidatorfail closedAnalyst UIaccept / edit / rejectAudit logmodel-risk · feedbackalertsCDCalert.createdevidence bundle12345ScoringCase dataCopilot case serviceOutputs
  1. Scoring path Card auth feeds unchanged real-time scoring, which feeds the decision and also emits alerts to the case-management system.
  2. Alert to copilot The case-management system streams CDC copies to the read replica and fires alert.created to the copilot case service.
  3. Evidence and patterns Evidence assembly uses typed tools and SQL scoped to the case; deterministic analytics turn it into pattern facts with refs.
  4. Draft and validate The LLM writes the brief and narrative from the evidence bundle only; the renderer fills references and the validator fails closed on unmatched figures.
  5. Analyst and audit The analyst UI shows the brief, timeline and highlights with accept, edit and reject; the audit log records what was shown and accepted.

Real-time scoring stays on the authorisation path while the copilot reads replicated data asynchronously and returns a validated brief to the analyst.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1Scoring pathCard auth feeds unchanged real-time scoring, which feeds the decision and also emits alerts to the case-management system.
2Alert to copilotThe case-management system streams CDC copies to the read replica and fires alert.created to the copilot case service.
3Evidence and patternsEvidence assembly uses typed tools and SQL scoped to the case; deterministic analytics turn it into pattern facts with refs.
4Draft and validateThe LLM writes the brief and narrative from the evidence bundle only; the renderer fills references and the validator fails closed on unmatched figures.
5Analyst and auditThe analyst UI shows the brief, timeline and highlights with accept, edit and reject; the audit log records what was shown and accepted.

Source: This page's text

Boxes
BoxGroupDetail
Card authScoringauthorisation path
Real-time scoringScoringunchanged, < 50 ms
DecisionScoringauthorisation decision
Case management systemCase dataowns alerts and cases
Read replica / warehouseCase dataCDC copies
Evidence assemblyCopilot case servicetyped tools / SQL, scoped
Deterministic analyticsCopilot case servicevelocity, structuring, graph links
LLMCopilot case servicebrief and narrative
RendererCopilot case servicefills references
ValidatorCopilot case servicefail closed
Analyst UIOutputsaccept / edit / reject
Audit logOutputsmodel-risk · feedback

Source: This page's text

Card auth ─► real-time scoring (unchanged, < 50 ms) ─► decision
                   └─► alerts ─► Case management system
                                     │ alert.created
Read replica / warehouse (CDC) ◄─────┤
                                     ▼
Copilot case service
  1. Evidence assembly: typed tools / SQL, scoped to the case
  2. Deterministic analytics: velocity, structuring, graph links, model
     explanations ─► pattern facts with refs
  3. LLM: brief and narrative from the evidence bundle only; numbers,
     dates and names are written as references ({{tx:8812.amount}})
  4. Renderer fills references from EvidenceRecords
  5. Validator: every reference resolves; any literal number, date or
     name in free text must match evidence; otherwise fail closed
  ─► Analyst UI: brief, timeline, highlights, hover-to-source,
     accept / edit / reject, ask a question
  ─► Audit log · model-risk documentation · feedback to rules/model teams

The copilot reads copies of data asynchronously; nothing it does can slow the authorisation path.

Deep dives

Flow · 6 stepsGrounded brief pipeline

Grounded brief pipelineThe alert from real-time scoring enters the case-management system, which emits alert.created to the copilot case service. The read replica / warehouse (CDC) feeds evidence assembly as the data path. Evidence assembly and deterministic analytics build the evidence bundle, the LLM writes references rather than free-text numbers, the renderer fills references from EvidenceRecords, and the validator fails closed on any unmatched literal before the analyst UI shows the brief.Alert from scoring< 50 ms scoring untouchedCase managementsystememits alert.createdRead replica /warehouseCDCEvidence assemblytyped tools / SQL, scoped to thecaseDeterministic analyticsvelocity, structuring, graph linksLLMbrief and narrative from evidencebundleRendererfills references fromEvidenceRecordsValidatorevery reference resolves; failclosedAnalyst UIbrief, timeline, highlights,hover-to-sourcealert.createdCDC123456InputCopilotOutput
  1. Alert enters case management The alert from scoring enters case management; case management emits alert.created to the copilot, and the read replica supplies case-scoped data.
  2. Assemble evidence and patterns Evidence assembly pulls case-scoped records via typed tools / SQL; deterministic analytics computes pattern facts with refs.
  3. LLM writes references The LLM writes the brief and narrative from the evidence bundle only, using references such as {{tx:8812.amount}} rather than free-text numbers.
  4. Renderer fills references The renderer fills references from stored EvidenceRecords.
  5. Validator fails closed The validator extracts every literal number, date, currency and name and checks it against the evidence bundle; unmatched sections are blocked.
  6. Analyst reviews The analyst UI shows the brief, timeline and highlights, with every figure linked to its source record.

An alert from scoring enters case management, which emits alert.created to the copilot while the read replica supplies case-scoped data; figures are filled from evidence and validated before the analyst sees them.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1Alert enters case managementThe alert from scoring enters case management; case management emits alert.created to the copilot, and the read replica supplies case-scoped data.
2Assemble evidence and patternsEvidence assembly pulls case-scoped records via typed tools / SQL; deterministic analytics computes pattern facts with refs.
3LLM writes referencesThe LLM writes the brief and narrative from the evidence bundle only, using references such as {{tx:8812.amount}} rather than free-text numbers.
4Renderer fills referencesThe renderer fills references from stored EvidenceRecords.
5Validator fails closedThe validator extracts every literal number, date, currency and name and checks it against the evidence bundle; unmatched sections are blocked.
6Analyst reviewsThe analyst UI shows the brief, timeline and highlights, with every figure linked to its source record.

Source: This page's text

Boxes
BoxGroupDetail
Alert from scoringInput< 50 ms scoring untouched
Case management systemInputemits alert.created
Read replica / warehouseInputCDC
Evidence assemblyCopilottyped tools / SQL, scoped to the case
Deterministic analyticsCopilotvelocity, structuring, graph links
LLMCopilotbrief and narrative from evidence bundle
RendererCopilotfills references from EvidenceRecords
ValidatorCopilotevery reference resolves; fail closed
Analyst UIOutputbrief, timeline, highlights, hover-to-source

Source: This page's text

The narrative states a transaction amount that doesn’t exist — prevent it. Numbers never come from the model’s free text. Aggregates (totals, counts, date ranges) are computed by SQL tools; the model writes references such as {{agg:outbound_7d.total}} that the renderer fills from stored evidence. A validator then extracts every literal number, date, currency and name from the output and checks it against the evidence bundle; anything unmatched blocks that section and shows it as “needs analyst”. In the UI every figure links to its source record. Offline, a seeded test set checks the validator catches injected wrong figures.

Showing regulators how the copilot influenced decisions. Per case, an immutable trail: the evidence snapshot, prompt and model versions, everything the copilot displayed, what the analyst accepted or changed (diffs), and the final decision with the named analyst. Aggregate reports show acceptance and edit rates, outcomes for assisted vs unassisted cases, and QA findings. The tool sits in the model inventory with documented intended use, limitations, independent validation and ongoing monitoring in line with model risk expectations, and the policy states plainly that decisions are human.

Trade-offs

  • Automation vs analyst judgement: drafting saves time but invites automation bias; start with summaries and evidence, not recommended dispositions, and measure whether assisted analysts miss things the brief omitted.
  • LLM narrative vs templated text: templates are exact and auditable for factual sections (amounts, dates, counterparties); the LLM adds value in explaining why a pattern is suspicious. Combine them: templated facts, LLM connective reasoning, both validated.
  • Data minimisation vs context richness: more history and counterparty data improve briefs but widen exposure; tools return only case-relevant fields, counterparties are pseudonymised unless needed, nothing outside the case scope.
  • Cost per case: ~16 cents of model spend against several pounds of analyst time; a stronger model is justified if it measurably cuts edits, while smaller models can handle classification-like steps.

Evaluation

  • LLM kept out of the scoring hot path: architecture review plus load tests show no dependency from authorisation to the copilot.
  • Numbers from deterministic queries: validator coverage 100%; zero unsupported figures on the offline set; production validator-failure rate monitored.
  • Grounded, auditable outputs: every highlight has evidence refs; audit completeness checked by sampling.
  • Analyst-centred evaluation: a staggered rollout across teams (or alternating cases) comparing time per case, QA rework rate, decision quality (later-confirmed fraud among released cases, SAR quality feedback) and inter-rater agreement between assisted and unassisted analysts on double-reviewed samples; blind ratings of narratives by senior investigators.
  • Privacy controls: access tests (analysts cannot query outside assigned cases), retention and logging reviews.
  • Monitoring: latency to brief, acceptance and edit rates, cost per case, feedback tags routed to rules and model owners.

What a strong design shows

  • Leaves real-time scoring untouched and makes the copilot an asynchronous reader of replicated data.
  • Takes every number from deterministic queries via references and validates the text against evidence, failing closed.
  • Keeps decisions with named analysts and produces an audit trail a regulator can follow.
  • Evaluates with analysts: time per case and decision quality, with controls and inter-rater checks, not just text metrics.
  • Applies data minimisation, scoped access and model-risk governance.

Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.