Kyc aml screener

From tinh2/skills-hub-registry · View interactive version

Kyc aml screener is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Generate a production-grade KYC / AML / sanctions screening pipeline for customer onboarding, transaction monitoring, and ongoing review. Triggers: \"KYC\", \"AML\", \"OFAC\", \"sanctions screening\", \"PEP\".

How to use this skill

Skill file

KYC / AML / Sanctions Screening Pipeline

You generate a complete screening pipeline for customer onboarding and continuous monitoring. The 2026 regulatory floor: customer identification (CIP), customer due diligence (CDD), enhanced due diligence (EDD) for high-risk, sanctions screening against multiple lists, PEP screening, and transaction monitoring. The dominant cost driver is false positives — sloppy matching buries compliance teams in noise and slows real-money revenue.

============================================================

=== PRE-FLIGHT ===

============================================================

Verify:

Recovery:

============================================================

=== PHASE 1: LIST INGESTION + REFRESH ===

============================================================

Source the watchlists. Frequency: nightly refresh for sanctions (lists update daily), weekly for PEP.

| List | Source | Format | Frequency |

| -------------------------------- | ---------------------------------------------------- | ----------------- | --------- |

| OFAC SDN | sanctionssearch.ofac.treas.gov + Treasury data files | XML/CSV/JSON | Daily |

| OFAC Consolidated (non-SDN) | OFAC | XML/CSV | Daily |

| EU Consolidated Sanctions | data.europa.eu | XML | Daily |

| UK HMT Sanctions | gov.uk OFSI | CSV | Daily |

| UN Security Council Consolidated | scsanctions.un.org | XML | Daily |

| Australian DFAT | dfat.gov.au | XLS | Weekly |

| Canada (OSFI) | osfi-bsif.gc.ca | XML | Daily |

| OpenSanctions (aggregator) | opensanctions.org | JSON / Statements | Daily |

| PEP | Dow Jones Risk & Compliance or OpenSanctions PEP | Various | Weekly |

Generate list_refresh.py that pulls each list, normalizes to a common schema, and diffs against the previous version. Newly listed entities trigger an alert against your customer base.

VALIDATION: After refresh, list count is plausible (SDN ~16k entries in 2026). Diff produces both additions and removals.

============================================================

=== PHASE 2: CANONICAL ENTITY SCHEMA ===

============================================================

Normalize every list entry into:

{
  "list_id": "OFAC-SDN-12345",
  "source_list": "OFAC_SDN",
  "first_listed_date": "2024-03-15",
  "last_updated": "2026-02-08",
  "entity_type": "individual" | "vessel" | "aircraft" | "entity",
  "primary_name": "Smith, John",
  "alt_names": ["Johnny Smith", "Иван Смит", "...transliterations..."],
  "dob": ["1965-06-12"],
  "place_of_birth": "Damascus, Syria",
  "nationalities": ["SY", "LB"],
  "addresses": [...],
  "identifications": [{"type": "passport", "country": "SY", "number": "..."}],
  "linked_entities": [...],
  "programs": ["SDGT", "SYRIA"],
  "remarks": "..."
}

Same schema applies to PEP entries (with positions, parties, etc.) and adverse media (with article references).

VALIDATION: Schema validates with strict types. Cross-list dedup catches the same entity present on multiple lists.

============================================================

=== PHASE 3: NAME MATCHING ENGINE ===

============================================================

This is the highest-leverage component. Match quality = (recall) × (1 / false positives).

Layered approach:

  1. Exact + alias (deterministic): full match against primary_name and any alt_name.
  2. Phonetic (Soundex, Metaphone, BMPM): handles transliteration variants (Mohammed/Muhammad/Mohamed).
  3. Edit distance (Damerau-Levenshtein): handles typos. Threshold: ≥ 0.85 similarity.
  4. Token-based (Jaccard, Jaro-Winkler): handles word reorderings ("John Smith" vs "Smith, John"). JW threshold ≥ 0.92.
  5. Substring + n-gram: catches partial matches in long entity names.
  6. Cross-script: transliterate Cyrillic/Arabic/Greek/Chinese to Latin before comparing.

For each candidate match, compute a match score:

match_score = w_name * name_sim
            + w_dob * dob_match
            + w_country * country_match
            + w_id * id_match
            - w_disambig * disambiguation_signal

Default weights: name 0.5, dob 0.2, country 0.15, id 0.15. Tune per false-positive rate.

Filter cascade:

VALIDATION: Benchmark against the FuzzyWuzzy test corpus (sanction-name pairs with known matches/non-matches). Precision ≥ 95% and recall ≥ 90%.

============================================================

=== PHASE 4: ONBOARDING SCREENING API ===

============================================================

Generate screen.py exposing:

def screen_customer(customer: CustomerProfile) -> ScreeningResult:
    """
    Returns ScreeningResult with:
      - status: CLEAR | HOLD | ESCALATE | BLOCK
      - matches: list of MatchCandidate with scores + list_id refs
      - pep_matches, sanctions_matches, adverse_media_matches
      - risk_score: 0-100
      - explainer: human-readable reasoning
    """

Key behavior:

Auditability: every screening decision persists who, when, what, why in tamper-evident storage (append-only, S3 Object Lock or equivalent).

VALIDATION: Round-trip an onboarding with a known-OFAC-listed test name; system blocks and records the decision.

============================================================

=== PHASE 5: ONGOING MONITORING + WATCHLIST DIFF ===

============================================================

After a customer is onboarded, screening doesn't stop. Generate:

  1. Nightly rescreen of every active customer against the latest lists.
  2. Watchlist diff alert: when a name is newly added that fuzzy-matches an existing customer, raise a HIGH priority case.
  3. Address / occupation / nationality change triggers re-screen.
  4. Transaction-trigger rescreen: any tx ≥ threshold (e.g., $10k cash, $3k wire) auto-screens counterparty.

Generate monitor_cron.py + alert dispatcher (Slack, PagerDuty, Jira).

VALIDATION: Test by adding a sanctioned name to the diff list and confirming alert fires for any pre-onboarded customer matching that name.

============================================================

=== PHASE 6: CASE MANAGEMENT UI SCAFFOLD ===

============================================================

Compliance analysts need to disposition cases. Generate a minimal UI (Next.js app router or Streamlit) with:

VALIDATION: Audit trail captures every state change with user, timestamp, IP.

============================================================

=== PHASE 7: SAR (FORM 111) HELPER ===

============================================================

When a case escalates to SAR, generate a draft of FinCEN Form 111 (CTR is Form 112):

Compliance officer reviews + files via BSA E-Filing System. Skill does NOT auto-file — narrative drafting only.

VALIDATION: Narrative covers all 5W+H. Suspicious activity codes correctly selected from FinCEN's controlled vocabulary.

============================================================

=== SELF-REVIEW ===

============================================================

Score 1–5:

Common gap: blocking PEPs by default instead of EDD-ing them. PEP ≠ sanctioned; flag for review, don't auto-block.

============================================================

=== LEARNINGS CAPTURE ===

============================================================

Append to ~/.claude/skills/kyc-aml-screener/LEARNINGS.md:

<YYYY-MM-DD> — <regime, volume, customer type>

============================================================

=== STRICT RULES ===

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.