financial-compliance-ai
Provides patterns for building AI agents that handle financial compliance, KYC, and AML screening.
Install
mkdir -p .claude/skills/financial-compliance-ai && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11505" && unzip -o skill.zip -d .claude/skills/financial-compliance-ai && rm skill.zipInstalls to .claude/skills/financial-compliance-ai
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: financial-compliance-ai description: Financial compliance AI patterns for KYC/AML, Basel III, Solvency II, and regulatory reporting. Use when building AI agents that assist with anti-money laundering, know-your-cKey capabilities
- →Build AI-assisted KYC/AML screening and investigation workflows
- →Implement sanctions list screening with entity resolution
- →Automate Suspicious Activity Report (SAR) narrative generation
- →Create fraud detection agents with explainable decisioning
- →Assist with regulatory reporting (Basel III, Solvency II, IFRS 17)
- →Extract and verify KYC document data using vision AI
How it works
This skill provides AI patterns for financial compliance, including KYC document verification using vision AI, sanctions screening with fuzzy matching, SAR narrative generation, and regulatory reporting. It emphasizes human-in-the-loop, audit trails, and model explainability.
Inputs & outputs
When to use financial-compliance-ai
- →KYC/AML verification
- →Fraud detection
- →Sanctions screening
- →Regulatory reporting
About this skill
name: financial-compliance-ai description: Financial compliance AI patterns for KYC/AML, Basel III, Solvency II, and regulatory reporting. Use when building AI agents that assist with anti-money laundering, know-your-customer, sanctions screening, fraud detection, or regulatory compliance workflows.
Financial Compliance AI
Build AI agents that assist with KYC/AML, sanctions screening, fraud detection, and regulatory compliance (Basel III, Solvency II, IFRS 17) while maintaining full auditability.
When to Use
- Building AI-assisted KYC/AML screening and investigation workflows
- Implementing sanctions list screening with entity resolution
- Automating Suspicious Activity Report (SAR) narrative generation
- Creating fraud detection agents with explainable decisioning
- Assisting with regulatory reporting (Basel III, Solvency II, IFRS 17)
Compliance Domain Map
| Domain | Regulations | AI Use Cases |
|---|---|---|
| KYC | CDD, EDD, UBO identification | Document verification, risk scoring, entity resolution |
| AML | BSA, 4AMLD/5AMLD/6AMLD, FATF | Transaction monitoring, SAR generation, network analysis |
| Sanctions | OFAC SDN, EU sanctions, UN | Name screening, fuzzy matching, PEP identification |
| Fraud | PSD2 SCA, Reg E | Real-time scoring, anomaly detection, case summarization |
| Regulatory | Basel III/IV, Solvency II, IFRS 17 | Data aggregation, report generation, gap analysis |
Patterns
1. KYC Document Verification Agent
import anthropic
import base64
def verify_kyc_document(document_image_b64: str, document_type: str) -> dict:
"""Extract and verify KYC document data using vision AI.
Args:
document_image_b64: Base64-encoded document image
document_type: Type of document (passport, drivers_license, national_id)
"""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{
"type": "image",
"source": {"type": "base64", "media_type": "image/jpeg", "data": document_image_b64},
},
{
"type": "text",
"text": f"""Extract structured data from this {document_type}. Return JSON with:
- full_name, date_of_birth, document_number, expiry_date, issuing_country
- is_expired: boolean
- confidence: high/medium/low for each field
Do NOT return any data you cannot clearly read from the document.""",
},
],
}],
)
# IMPORTANT: AI extraction must be reviewed by compliance officer
# before being used for KYC decisions
return {"extraction": response.content[0].text, "requires_human_review": True}
2. Sanctions Screening with Fuzzy Matching
from rapidfuzz import fuzz, process
class SanctionsScreener:
def __init__(self, sanctions_lists: list[dict]):
"""Initialize with loaded sanctions entries.
Each entry: {"name": "...", "aliases": [...], "list": "OFAC_SDN", "id": "..."}
"""
self.entries = sanctions_lists
self.all_names = []
self.name_to_entry = {}
for entry in sanctions_lists:
names = [entry["name"]] + entry.get("aliases", [])
for name in names:
self.all_names.append(name)
self.name_to_entry[name] = entry
def screen(self, query_name: str, threshold: int = 85) -> list[dict]:
"""Screen a name against sanctions lists.
Args:
query_name: Name to screen
threshold: Minimum fuzzy match score (0-100)
"""
matches = process.extract(
query_name,
self.all_names,
scorer=fuzz.token_sort_ratio,
score_cutoff=threshold,
limit=10,
)
results = []
for matched_name, score, _ in matches:
entry = self.name_to_entry[matched_name]
results.append({
"matched_name": matched_name,
"score": score,
"sanctions_list": entry["list"],
"entry_id": entry["id"],
"canonical_name": entry["name"],
})
return results
def screen_customer(customer_name: str) -> str:
"""Screen a customer name against OFAC and EU sanctions lists.
Args:
customer_name: Full name to screen
"""
screener = SanctionsScreener(load_sanctions_lists())
hits = screener.screen(customer_name, threshold=85)
if not hits:
return f"No sanctions hits for '{customer_name}'. Screening passed."
hit_summary = "\n".join(
f"- {h['canonical_name']} ({h['sanctions_list']}, score: {h['score']}%)"
for h in hits
)
return f"ALERT: {len(hits)} potential sanctions hit(s) for '{customer_name}':\n{hit_summary}\nRequires compliance officer review."
3. SAR Narrative Generation
import anthropic
def generate_sar_narrative(alert_data: dict, transaction_data: list[dict], customer_data: dict) -> str:
"""Generate a Suspicious Activity Report narrative draft.
Args:
alert_data: AML alert details (rule triggered, score, etc.)
transaction_data: Related transactions
customer_data: Customer profile (redacted PII)
"""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=2048,
system="""You are a BSA/AML compliance analyst assistant. Generate SAR narrative drafts
following FinCEN guidelines. Include: subject description, suspicious activity description,
transaction patterns, and why activity is suspicious. Use factual, objective language only.
Flag any gaps in evidence. This is a DRAFT requiring human review.""",
messages=[{
"role": "user",
"content": f"""Generate a SAR narrative draft for this alert:
Alert: {alert_data}
Transactions: {transaction_data}
Customer Profile: {customer_data}
Follow FinCEN SAR narrative best practices.""",
}],
)
return response.content[0].text
4. Transaction Monitoring Rules
from dataclasses import dataclass
from datetime import datetime, timedelta
@dataclass
class TransactionAlert:
rule_id: str
severity: str # high, medium, low
description: str
transactions: list[dict]
customer_id: str
def check_structuring(transactions: list[dict], threshold: float = 10000.0, window_days: int = 3) -> TransactionAlert | None:
"""Detect potential structuring (transactions just below reporting threshold).
Args:
transactions: List of customer transactions
threshold: CTR reporting threshold (default $10,000)
window_days: Lookback window in days
"""
cutoff = datetime.now() - timedelta(days=window_days)
recent_cash = [
t for t in transactions
if t["type"] == "cash_deposit"
and datetime.fromisoformat(t["date"]) >= cutoff
and threshold * 0.5 <= t["amount"] < threshold
]
if len(recent_cash) >= 3:
total = sum(t["amount"] for t in recent_cash)
return TransactionAlert(
rule_id="AML-001",
severity="high",
description=f"Potential structuring: {len(recent_cash)} cash deposits totaling ${total:,.2f} in {window_days} days, each below ${threshold:,.0f} threshold",
transactions=recent_cash,
customer_id=recent_cash[0].get("customer_id", ""),
)
return None
5. Regulatory Reporting Helper
def generate_regulatory_summary(report_type: str, data: dict) -> str:
"""Generate a regulatory report summary for review.
Args:
report_type: Type of report (basel_iii_capital, solvency_ii_scr, ifrs17_liability)
data: Pre-computed regulatory data
"""
import anthropic
prompts = {
"basel_iii_capital": "Summarize this Basel III capital adequacy data. Highlight CET1, Tier 1, and Total Capital ratios vs minimums (4.5%, 6%, 8%). Flag any breaches.",
"solvency_ii_scr": "Summarize this Solvency II SCR calculation. Highlight solvency ratio, own funds, and SCR. Flag if ratio is below 100% or approaching warning threshold (120%).",
"ifrs17_liability": "Summarize this IFRS 17 insurance contract liability. Highlight BEL, risk adjustment, and CSM. Flag material changes vs prior period.",
}
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
system="You are a regulatory reporting analyst. Provide factual, precise summaries. Always flag items requiring attention. This is a draft for human review.",
messages=[{"role": "user", "content": f"{prompts.get(report_type, 'Summarize this regulatory data.')}\n\nData: {data}"}],
)
return response.content[0].text
Critical Compliance Requirements
- Human-in-the-loop: AI MUST NOT make final compliance decisions -- always route to compliance officers
- Audit trail: Log all AI inputs, outputs, and decisions with timestamps for regulatory examination
- Data residency: Ensure customer PII stays within required jurisdictions (no cross-border LLM calls without approval)
- Model explainability: Regulators require explanation of AI decisions -- use models with reasoning capabilities
- PII handling: Mask/redact PII before sending to external LLMs; use on-premise models for sensitive data
Anti-Patterns
- Using AI to auto-file SARs without human review -- regulatory violation
- Sending unmasked SSN/DOB/account numbers to cloud LLMs -- data breach risk
- Training on customer data without privacy review -- GDPR/CCPA violation
- Hard-coding sanctions lists instead of using l
Content truncated.
When not to use it
- →When the AI is intended to make final compliance decisions without human review
- →When unmasked PII is to be sent to external LLMs
- →When training on customer data without privacy review
Limitations
- →AI extraction of KYC document data must be reviewed by a compliance officer.
- →Sanctions screening uses fuzzy matching with a configurable threshold.
- →SAR narrative generation is a draft for human review.
How it compares
This skill focuses on building AI agents that assist with compliance tasks while maintaining auditability and human oversight, unlike fully automated systems.
Compared to similar skills
financial-compliance-ai side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| financial-compliance-ai (this skill) | 0 | 5mo | No flags | Advanced |
| agent-security-manager | 3 | 6mo | No flags | Advanced |
| security-auditor | 5 | 4mo | No flags | Advanced |
| pci-compliance | 3 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by frank-luongt
View all by frank-luongt →You might also like
agent-security-manager
ruvnet
Agent skill for security-manager - invoke with $agent-security-manager
security-auditor
sickn33
Expert security auditor specializing in DevSecOps, comprehensive cybersecurity, and compliance frameworks. Masters vulnerability assessment, threat modeling, secure authentication (OAuth2/OIDC), OWASP standards, cloud security, and security automation. Handles DevSecOps integration, compliance (GDPR/HIPAA/SOC2), and incident response. Use PROACTIVELY for security audits, DevSecOps, or compliance implementation.
pci-compliance
wshobson
Implement PCI DSS compliance requirements for secure handling of payment card data and payment systems. Use when securing payment processing, achieving PCI compliance, or implementing payment card security measures.
hunt-blueprint-generation
OTRF
Assemble a complete hunt blueprint by consolidating outputs from prior hunt planning skills into a single, structured plan for execution. Use this skill after system and tradecraft research, hunt focus definition, data source identification, and analytics generation have been completed. This skill is synthesis and packaging only and must not introduce new research, assumptions, or analytics.
cosmos-vulnerability-scanner
trailofbits
Scans Cosmos SDK blockchains for 9 consensus-critical vulnerabilities including non-determinism, incorrect signers, ABCI panics, and rounding errors. Use when auditing Cosmos chains or CosmWasm contracts.
openrouter-data-privacy
jeremylongshore
Implement data privacy controls for OpenRouter requests. Use when handling PII or meeting compliance requirements. Trigger with phrases like 'openrouter privacy', 'openrouter pii', 'openrouter gdpr', 'openrouter data protection'.