Detect statement anomalies
detect_statement_anomaliesScreen camt.05x statements for duplicate references, unusual fee deductions, and velocity spikes to flag potential anomalies before deeper review.
Instructions
Screen a camt.05x statement for deterministic, rule-based anomalies.
Use this as a fast, explainable first pass over an incoming statement
before deeper review or reversal. It applies three fixed heuristics over
the parsed entry list (see ``list_entries``) and never calls out to a model
or the network, so the same statement always yields the same result:
* **Duplicate references** (severity ``HIGH``) -- two or more entries share
an end-to-end id (or, absent one, an entry reference), a classic
double-payment signal.
* **Unusual fee deductions** (severity ``MEDIUM``) -- a fee/charge debit
whose amount exceeds a fixed fraction (25%) of the largest ordinary
transaction amount on the statement.
* **Velocity spikes** (severity ``LOW``/``MEDIUM``) -- a booking-date window
whose entry count runs far above the statement's median per-window count.
Returns ``{"anomalies": [{"type", "severity", "detail", "entry_refs"}],
"checked_entries": <int>}``; ``anomalies`` is empty for a clean statement.
Returns an ``{"error": ...}`` payload instead if the XML cannot be parsed.
Args:
statement_xml: The raw statement XML as a string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| statement_xml | Yes | The raw camt.05x statement XML document as a string, with its root camt <Document> element. Every booked entry across all its statements is screened; no file path is accepted. |