---
title: Fraud-investigation copilot
url: https://gurkanozkan.ai/learn/design/applied-llm-sd-12/
markdown: https://gurkanozkan.ai/learn/design/applied-llm-sd-12.md
kind: design
role: Applied LLM
json: https://gurkanozkan.ai/api/learn/design/applied-llm-sd-12.json
---

# 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.

## What to cover

- **Requirements**: alert volumes and analyst capacity; decision rights (who decides); regulatory reporting needs; data access controls; latency per case; success metric (time per case, quality)
- **Estimates**
- **API**
- **Data model**
- **Architecture**: existing 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
- **Deep dives**: the narrative states a transaction amount that doesn't exist — prevent it.; How do you show regulators how the copilot influenced decisions?
- **Trade-offs**: automation vs analyst judgement; LLM narrative vs templated text; data minimisation vs context richness; cost per case
- **Evaluation**: LLM kept out of the scoring hot path; numbers from deterministic queries; grounded, auditable outputs; analyst-centred evaluation; privacy controls

## Reference design

### 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

```
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

**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.*
