Fraud rules

Deterministic policy for the POST /check pipeline. Thresholds apply to every seller in this workspace.

Cross-seller duplicates always STOP

A perceptual hash match from a different seller triggers an immediate fraud alert and cannot be downgraded by a threshold change.

View clusters

Upload safety gate

Applied before a file reaches OCR or storage.

MIME allowlistOnly image/jpeg, image/png, and application/pdf.
5 MB upload capReject larger payloads before reading the body.
Pre-flight header parseDetect spoofed extensions and malformed containers.
Sandboxed PDF parsingRun PDF extraction in an unprivileged Docker container.
Strip EXIF metadataRemove device and location data before fingerprinting.

Verdict thresholds

Scores are 0–100. The bands must not overlap.

Claim, amount, and bank alert must all agree.
Below MATCH and above this value.
Hamming distance on the 64-bit perceptual hash.
Below this, verdict is WAIT even if amounts match.
Only expected_sales rows inside this window can produce MATCH.

Signal weights

Each signal contributes to the confidence score. Cross-seller duplicates bypass scoring.

Deterministic
Signal Source Weight Effect when triggered Status
Amount matches expected sale
Tolerance R0.00
expected_sales +35 Supports MATCH Active
Recipient name matches
Fuzzy match ≥ 90%
expected_sales +20 Supports MATCH Active
Bank alert found
Same amount and reference
Bank webhook +30 Supports MATCH Active
Font inconsistency detected
Edited text overlay
OCR −40 Forces STOP Blocking
Near-duplicate fingerprint
Distance ≤ 5, other seller
fingerprints −100 Immediate STOP + alert Blocking
Amount mismatch
Claim differs from expected
expected_sales −25 Caps verdict at WAIT Review

Containment

What Khusela does after a verdict is issued.

Auto-release on MATCHSend a release instruction to the seller bot.
Hold goods on STOPNever auto-release a STOP, even after a manual review.
Notify seller on WAITSend a WhatsApp message asking for bank confirmation.
Open incident on cross-seller hitCreate a fraud incident and alert the workspace owner.

Danger zone

Relaxing blocking rules is logged in the audit trail and cannot be undone silently.

Allow STOP overrideRequire a written reason from the workspace owner.
Disable duplicate checkNot recommended. Removes the strongest fraud signal.
Checks continue, releases stop.