Skip to content

Add financial services compliance guardrails notebook (FCA / MiFID II / GLiNER PII) - #2216

Open
priyanka25aug wants to merge 1 commit into
NVIDIA-NeMo:developfrom
priyanka25aug:feat/financial-services-compliance-notebook
Open

Add financial services compliance guardrails notebook (FCA / MiFID II / GLiNER PII)#2216
priyanka25aug wants to merge 1 commit into
NVIDIA-NeMo:developfrom
priyanka25aug:feat/financial-services-compliance-notebook

Conversation

@priyanka25aug

Copy link
Copy Markdown

Closes #2193

What this adds

A runnable notebook (examples/notebooks/financial_services_compliance/financial_services_compliance_guardrails.ipynb) demonstrating how to build a financial services compliance guardrail stack using NeMo Guardrails, targeting FCA, MiFID II, and Consumer Duty regulated environments.

Guardrail layers

Layer Implementation
PII detection GLiNER entities: iban, sort_code, account_number, credit_card_number, national_insurance_number
Topic control NIM nvidia/llama-3.1-nemoguard-8b-topic-control — blocks non-financial advice topics
Content safety NIM nvidia/llama-3.1-nemotron-safety-guard-8b-v3 — harmful content filter
Disclaimer enforcement FCA COBS 4 / MiFID II Art. 24 — auto-appends risk warning on investment topics
Audit trail Consumer Duty / SR 11-7 — structured log per interaction

Scenarios covered

  1. Safe investment query — passes all guardrails, disclaimer appended
  2. IBAN in user message — PII blocked before reaching the model
  3. Off-topic (medical advice) — topic control blocks
  4. Harmful content — content safety blocks
  5. Account number in model response — output PII scan blocks

Key design decisions

  • No API key required for pattern tests — GLiNER PII and regex patterns run locally; NIM endpoints are clearly marked and swappable for ChatOpenAI / ChatAnthropic
  • RailsConfig.from_content() — config is inline in the notebook, no external YAML files needed to run
  • Colang 2.0 flows for FCA disclaimer and topic control
  • All 5 scenarios have assert statements for CI-friendliness

Related issue

Addresses #2193 — financial services compliance notebook for NeMo Guardrails examples.

Checklist

  • Notebook runs end-to-end with deterministic mock where NIM endpoints are absent
  • GLiNER PII layer tested with IBAN, sort code, account number, NI number
  • FCA COBS 4 disclaimer enforced on investment topics
  • Audit trail captured per interaction
  • Placed under examples/notebooks/financial_services_compliance/

This contribution was developed with AI assistance.

@github-actions github-actions Bot added status: needs triage New issues that have not yet been reviewed or categorized. size: L needs: signing labels Jul 23, 2026
@priyanka25aug

Copy link
Copy Markdown
Author

@drazvan — hi, this PR adds the financial services compliance notebook discussed in issue #2193. it covers GLiNER PII detection, MiFID II topic control via NIM, FCA COBS 4 disclaimer enforcement, and a Consumer Duty / SR 11-7 audit trail — all in a single self-contained notebook with 5 runnable scenarios. happy to make any adjustments to placement, style, or scope based on your feedback. would appreciate a review when you get a chance!

@priyanka25aug
priyanka25aug force-pushed the feat/financial-services-compliance-notebook branch from 5f22c0a to 6fd2bc8 Compare July 23, 2026 23:22
…LiNER PII)

Addresses NVIDIA-NeMo#2193

- GLiNER-based PII detection: IBAN, sort code, account number, NI number
- MiFID II Art. 25 topic control via NIM nemoguard-8b-topic-control
- FCA COBS 4 disclaimer enforcement
- Consumer Duty / SR 11-7 audit trail
- 5 test scenarios with assertions
- No external API keys required for pattern tests; NIM endpoints swappable
@priyanka25aug
priyanka25aug force-pushed the feat/financial-services-compliance-notebook branch from 6fd2bc8 to 622a75a Compare July 23, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L status: needs triage New issues that have not yet been reviewed or categorized.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notebook] Financial Services Compliance Guardrails — FCA/MiFID II regulated chatbot example

1 participant