Summary
Add a ForensicReport.to_regulatory_narrative() method that uses an LLM to generate a plain-English regulatory narrative from the structured forensic report data, suitable for SAR (Suspicious Activity Report) filings.
Motivation
Forensic reports contain SHAP values, causal attribution chains, and propagation paths that are inaccessible to non-technical compliance teams and regulators. An LLM-generated narrative translates these into precise, citation-grounded language.
Proposed Design
# detection/narrative_generator.py
class RegulatoryNarrativeGenerator:
def __init__(self, model='claude-sonnet-4-6'): ...
def generate(self, report: ForensicReport) -> str:
prompt = self._build_prompt(report)
return self._call_llm(prompt)
Narrative requirements:
- Reference specific feature values (e.g. counterparty_concentration_ratio of 0.92 indicates...)
- Cite causal chain hops by wallet address
- Include propagated risk contributors if present
- Output <= 500 words in regulatory English
Narrative cached to avoid redundant API calls for the same report.
Acceptance Criteria
References
Summary
Add a
ForensicReport.to_regulatory_narrative()method that uses an LLM to generate a plain-English regulatory narrative from the structured forensic report data, suitable for SAR (Suspicious Activity Report) filings.Motivation
Forensic reports contain SHAP values, causal attribution chains, and propagation paths that are inaccessible to non-technical compliance teams and regulators. An LLM-generated narrative translates these into precise, citation-grounded language.
Proposed Design
Narrative requirements:
Narrative cached to avoid redundant API calls for the same report.
Acceptance Criteria
References
detection/forensic_report.py