Summary
ComplianceGuard currently maintains AML thresholds, high-risk country lists, and KYC rules internally as hardcoded class attributes. This creates two problems:
-
Maintenance burden — Thresholds and country lists change when FATF updates its grey list or when FinCEN changes BSA thresholds. A verification library should not require updates every time a regulator changes a number.
-
False sense of completeness — The hardcoded lists are simplified subsets (e.g., only 13 high-risk countries when FATF tracks 20+). Users may assume the library provides complete regulatory coverage when it does not.
Current Design
class ComplianceGuard:
def __init__(self):
self.aml_thresholds = {
"USA": 10000,
"EU": 10000,
"UK": 10000,
}
self.high_risk_countries = {"KP", "IR", "SY", ...}
def verify_aml_flag(self, amount, country_code, llm_flagged, jurisdiction="USA"):
threshold = self.aml_thresholds.get(jurisdiction, 10000)
is_high_risk = country_code.upper() in self.high_risk_countries
should_flag = amount >= threshold or is_high_risk
...
Proposed Change
Accept policy as a parameter so the caller provides the current rules:
class ComplianceGuard:
def verify_aml_flag(self, amount, country_code, llm_flagged, policy):
threshold = policy.get_aml_threshold(jurisdiction)
is_high_risk = policy.is_high_risk(country_code)
should_flag = amount >= threshold or is_high_risk
...
Rationale
QWED philosophy: "Rules are inputs. Verification is the product."
ComplianceGuard should verify that an LLM's decision matches a given policy. It should not define the policy itself. This keeps the library free from regulatory maintenance burden and avoids a false sense of completeness.
Migration Path
- Add
policy parameter to all ComplianceGuard methods (with backward-compatible default for existing callers)
- Deprecate hardcoded
aml_thresholds and high_risk_countries
- Remove hardcoded values in next major version
Labels
architecture, P1"
Summary
ComplianceGuard currently maintains AML thresholds, high-risk country lists, and KYC rules internally as hardcoded class attributes. This creates two problems:
Maintenance burden — Thresholds and country lists change when FATF updates its grey list or when FinCEN changes BSA thresholds. A verification library should not require updates every time a regulator changes a number.
False sense of completeness — The hardcoded lists are simplified subsets (e.g., only 13 high-risk countries when FATF tracks 20+). Users may assume the library provides complete regulatory coverage when it does not.
Current Design
Proposed Change
Accept policy as a parameter so the caller provides the current rules:
Rationale
QWED philosophy: "Rules are inputs. Verification is the product."
ComplianceGuard should verify that an LLM's decision matches a given policy. It should not define the policy itself. This keeps the library free from regulatory maintenance burden and avoids a false sense of completeness.
Migration Path
policyparameter to all ComplianceGuard methods (with backward-compatible default for existing callers)aml_thresholdsandhigh_risk_countriesLabels
architecture,P1"