OFAC screening best practices for developers

Reliable sanctions screening comes down to placement, testing, error handling, and keeping the check fast enough to run everywhere.

TL;DR

TL;DR: Screen directly before payment, fail closed on errors, test every response path, and keep the call under 100 ms so it never gets skipped for performance reasons.

Integration patterns

Place the screening call immediately before any payment or transfer, not in a batch job that runs later. Use a dedicated tool such as sanctions_check for the lookup and risk_score when you need a broader view. The decision is binary: clean means allow, flagged means block.

Error handling and testing

Fail closed. If the screening service cannot be reached, block the transaction and alert someone instead of proceeding on an empty result. Write tests for clean, flagged, and network-error cases so a failure can never silently become an allow.

Performance and maintenance

Keep the check under 100 ms so it fits into interactive flows, and re-verify coverage when you change payment code paths. SanctionsAI screens 947 OFAC-listed wallets and 19,218 SDN names across 16 jurisdictions, synced hourly, and is MIT-licensed and self-hostable if you need to run it yourself.

Screen your agent’s next payment

Free OFAC sanctions screening — 5 checks/day, no signup.

Check a wallet →