OFAC Langchain Compliance Guide Part 1
How OFAC screening plugs into LangChain chains and agents that may trigger payments through tools.
TL;DR
TL;DR: LangChain agents can call tools that move money, but the framework does not screen counterparties. Insert a sanctions check before the payment tool so clean parties ALLOW and flagged parties BLOCK.
Why LangChain agents need screening
A LangChain agent can chain tool calls, including payment or transfer functions. The framework executes the call but performs no OFAC screening, so a listed wallet or SDN name can be paid unless a check is added. Strict liability means intent is not required, and penalties start at $356,000 per violation.
Adding the check
Add sanctions_check as a step before the payment tool in the chain. The call returns a decision in under 100 ms, drawing on 947 OFAC-listed crypto wallets and 19,218 SDN names, synced hourly. The 4-Gate protocol, SCREEN, SCORE, STOP, STAMP, keeps the sequence auditable.
Practical steps
- Insert sanctions_check before the transfer tool.
- STAMP clean payments for the audit log.
- Use risk_score for counterparties needing review.