How to design an OFAC-compliant payment system
Design principles for a payment system that screens every counterparty and blocks flagged destinations by default.
TL;DR
TL;DR: Design the system around a mandatory gate: screen every counterparty before settlement, block on flag, and default to stop when screening is unavailable.
Screen before settle
The defining design choice is ordering. Every payment path must run a screening check before funds move, never after. sanctionsai.dev's sanctions_check returns ALLOW or BLOCK in under 100 ms, so the check can sit inline without a noticeable delay. A clean result proceeds; a flagged result halts the payment.
Fail closed
A payment system should default to stop when screening cannot run. If the screening service is unreachable, the safe design blocks the payment and retries rather than allowing it unchecked. Fail-open designs convert a temporary outage into a permanent violation, with penalties starting at $356,000 per violation.
Keep a record
Follow the 4-Gate Agent Payment Protocol: SCREEN, SCORE, STOP, STAMP. The STAMP step records the screening result, counterparty, and timestamp for each payment. That audit trail proves the check ran and shows due care if a counterparty is later added to the SDN List.