Build an automated compliance report generator that scans transactions against regulatory rules for Singapore (MAS), Malaysia (BNM), and Indonesia (OJK).
20 minutes
What You'll Build
A compliance scanning engine that checks transactions against regulatory thresholds
Multi-market rules: Singapore (MAS), Malaysia (BNM), Indonesia (OJK)
An audit-ready HTML report with findings, risk ratings, and remediation recommendations
Summary statistics and trend analysis
Step
Duration
Description
Set Up Rules & Data
5 min
Create regulatory rules and transaction data
Build the Scanner
10 min
Compliance checking engine with multi-market rules
Generate Audit Report
5 min
Professional HTML report with findings
Step 1: Set Up Regulatory Rules & Data
In the Kiro chat panel, start a New Session in Vibe mode and paste:
PROMPT โ Copy & paste into Kiro
Create a folder called "compliance-report" in the current workspace.
Inside it, create:
1. "regulatory_rules.json" โ Compliance rules for 3 markets:
Singapore (MAS):
- Cash Transaction Report (CTR): transactions >= $20,000 SGD must be reported
- Suspicious Transaction Report (STR): multiple transactions just below $20,000 from same customer (structuring)
- Cross-border transfers > $5,000 require enhanced due diligence
- PEP (Politically Exposed Person) screening required for accounts > $50,000 total volume
Malaysia (BNM):
- CTR threshold: RM 25,000
- Wire transfers > RM 10,000 require source of funds documentation
- Dormant account reactivation requires re-KYC
Indonesia (OJK):
- CTR threshold: IDR 100,000,000
- E-wallet top-up limit: IDR 10,000,000/month for unverified accounts
- Cross-border remittance reporting for all amounts
2. "compliance_transactions.csv" โ 500 transactions across all 3 markets:
Columns: txn_id, date, customer_id, customer_name, customer_type (individual/corporate), market, amount, currency, txn_type (payment/transfer/top-up/withdrawal), destination_country, is_cross_border, customer_total_volume_ytd, account_status, kyc_status, pep_flag
Embed ~40 compliance findings:
- 5 transactions above CTR thresholds
- 3 structuring patterns (multiple transactions just below threshold)
- 4 cross-border transfers missing enhanced due diligence
- 2 PEP-flagged customers with high volume
- 3 dormant account reactivations without re-KYC
- 2 e-wallet top-ups exceeding monthly limits
Make all data synthetic but realistic for Southeast Asian fintech operations.
โ Checkpoint: Regulatory rules for SG, MY, ID markets ยท 500 transactions with embedded compliance findings
Step 2: Build the Compliance Scanner
PROMPT โ Copy & paste into Kiro
You are a Regulatory Compliance Officer responsible for ensuring AnyCompany's payment operations comply with MAS (Singapore), BNM (Malaysia), and OJK (Indonesia) regulations. You understand CTR thresholds, structuring detection, and PEP screening requirements.
Build a Python script called compliance_scanner.py in the compliance-report folder that:
1. Loads regulatory_rules.json and compliance_transactions.csv
2. For each transaction, checks all applicable rules for that market:
- CTR threshold check
- Structuring detection (3+ transactions within 20% below threshold from same customer in 7 days)
- Cross-border enhanced due diligence check
- PEP screening check
- Market-specific rules (dormant accounts for MY, e-wallet limits for ID)
3. Assigns a finding severity: CRITICAL, HIGH, MEDIUM, LOW
4. For each finding, generates:
- Rule reference (e.g., "MAS-CTR-001")
- Description of the violation
- Recommended action
- Regulatory deadline for reporting (if applicable)
5. Prints a summary:
- Total transactions scanned per market
- Findings by severity and market
- Top 5 most critical findings
- Compliance score per market (% of transactions with no findings)
Use pandas. Install automatically. Run the script.
Add an HTML report generator that creates compliance_report.html in the compliance-report folder:
1. Header: "AnyCompany Financial Group โ Regulatory Compliance Report" with report period, generation date, and "CONFIDENTIAL" watermark
2. Executive Summary:
- Overall compliance score (% clean transactions)
- Total transactions scanned by market
- Findings breakdown: CRITICAL (red), HIGH (orange), MEDIUM (yellow), LOW (blue)
- Comparison bar chart: findings by market
3. Market-by-Market Sections (one for each: Singapore, Malaysia, Indonesia):
- Market compliance score
- Applicable regulations checked
- Findings table: txn_id, date, customer, amount, rule_violated, severity, recommended_action
- Highlight CRITICAL findings with red left border
4. Structuring Analysis Section:
- Customers flagged for potential structuring
- Transaction pattern visualization (timeline of amounts)
5. Remediation Tracker:
- Table of all findings with columns: finding_id, severity, rule, status (Open), assigned_to (blank for manual assignment), due_date
6. Footer: "This report is generated for internal compliance purposes. Report ID: [auto-generated]"
Professional theme: dark navy header, white content, green accents for passing indicators.
Open in browser after generating.
Step 4 (Optional): Export for Regulators
OPTIONAL PROMPT
Create three separate CSV files for regulatory submission:
1. sg_ctr_report.csv โ All Singapore CTR-reportable transactions in MAS format
2. my_compliance_findings.csv โ All Malaysia findings in BNM format
3. id_ojk_report.csv โ All Indonesia findings in OJK format
Also create a compliance_summary.csv with all findings across markets for the internal compliance team.
What You Accomplished
๐ Defined multi-market regulatory rules (MAS, BNM, OJK)
๐ Built automated compliance scanning across 500 transactions
โ ๏ธ Detected structuring patterns, CTR breaches, and KYC gaps
๐ Generated an audit-ready HTML compliance report