Architecture Note · Cybersecurity, Identity & Compliance
Deterministic KYB UBO Traversal, Sanctions Screening & MLRO-Gated AML Monitoring
Why prompting general-purpose LLMs fails corporate onboarding and transaction surveillance—and how cycle-safe graph math, deterministic rules, and mandatory MLRO gates fix it.
The Operational Problem: Multi-Layer Opacity and Alert Fatigue
Heads of Compliance, Money Laundering Reporting Officers (MLROs), and Payments Operations teams must verify corporate merchants and monitor cross-border wire streams simultaneously. Holding structures spanning Delaware, UK Companies House, Singapore ACRA, and Germany Handelsregister frequently obscure natural-person Ultimate Beneficial Owners (UBOs) behind nested entities. At the same time, fuzzy watchlist matches across OFAC SDN, EU Consolidated, UK HMT, MAS, and PEP feeds generate repetitive false-positive queues while structuring, pass-through velocity, and dormant-account wire spikes demand rapid, defensible triage.
Why Naive AI Wrappers Fail
Wrapping a public LLM around raw corporate filings and payment ledgers breaks down across four operational boundaries:
- Silent PII and SAR data egress: Transmitting passport metadata, corporate ownership tables, or pre-filing Suspicious Activity Report (SAR/STR) context to external APIs violates data residency and confidentiality controls.
- Nondeterministic equity and threshold math: Prompting a language model to multiply multi-layer shareholdings or apply transaction caps introduces arithmetic drift, fails on cyclic ownership edges, and produces non-reproducible risk scores.
- Unanchored watchlist scoring: Generative models cannot provide consistent token, phonetic, or transliteration similarity metrics when regulators ask why a match was escalated or dismissed.
- Missing human sign-off and audit integrity: Allowing automated workflows to lock regulatory filings or freeze accounts without an enforced MLRO attestation—or without tamper-evident decision logs—fails regulatory examination.
The Deterministic Architecture That Fixes It
Our FastAPI and SQLite (WAL mode) compliance architecture isolates deterministic graph, string, and rule engines from private narrative drafting inside a single-tenant deployment:
- Cycle-safe UBO graph traversal (
POST /api/kyb/evaluate): Upstream ownership graphs across jurisdictions such asUS-DE,UK-CH,SG-ACRA,DE-HRB,VG-FSC, andKY-CIMAare traversed with explicit cycle protection. Direct and indirect equity paths multiply cleanly to flag natural persons exceeding the>25%UBO control threshold and compute repeatable entity risk scores. - Normalized watchlist screening and AML typology rules (
POST /api/aml/screen): Party names undergo Unicode NFKC folding, diacritic and confusable normalization, and transliteration mapping before deterministic scoring via Levenshtein, Jaro-Winkler, Soundex phonetics, and token overlap against OFAC, EU, UK HMT, MAS, and PEP records. Transaction batches run through three deterministic typologies:AML_STRUCTURING_SMURFING(clustered sub-$10,000 wires),AML_HIGH_RISK_CORRIDOR_VELOCITY(rapid cross-border pass-through within 4 hours above baseline multipliers), andAML_DORMANT_SUDDEN_SPIKE(high-value activity after 90+ dormant days). - Private SAR/STR drafting and ephemeral upload hygiene: Initial FinCEN SAR, UK NCA SAR, MAS STR, or BaFin GwG STR narratives are synthesized via
BaseAMLAdapter—defaulting to zero-keyOfflineDeterministicAdapter(offline-deterministic-v1) or an optional private VPC OpenAI-compatible endpoint. Scoped invite tokens enforce sliding-window rate limits, while raw multipart CSV/JSON batch uploads retain SHA-256 digests and auto-wipe after a 1-hour TTL. - Hard MLRO human gate (
POST /api/cases/{id}/disposition): Analysts can dismiss false positives or escalate cases, whilelock_sar_narrativeandrestrict_accountstrictly requiremlro_confirmed=true, reviewer identity, and disposition rationale—returning HTTP409 Conflictif human sign-off is absent. - SHA-256 hash-chained audit exports (
GET /api/cases/audit): Every disposition appends an immutable entry linked by SHA-256 hash to the prior record inaudit_trail. The audit endpoint verifies full chain integrity (chain_valid: true) and exports JSON bundles or RFC 4180 CSVs with spreadsheet formula-injection neutralization (prefixing leading=,+,-,@, tab, and carriage return characters), validated by 13pytesttests across UBO traversal, AML rules, auth, and exports.
Operational Takeaway
Compliance automation only scales when ownership math, fuzzy matching, and typology triggers remain 100% deterministic, raw files expire inside private boundaries, and every SAR lock or account restriction passes through a verified MLRO gate backed by a hash-chained audit trail.