How to integrate OFAC screening into an AI agent
Integrating screening means adding one call between the agent's decision to pay and the actual transfer.
TL;DR
TL;DR: Integrate OFAC screening into an AI agent by calling a screening API before each payment, blocking on a flagged result and allowing on a clean one. sanctionsai.dev returns that decision in one HTTP call under 100 ms.
Where the check goes
Place the screening call after the agent decides to pay but before it executes the transfer. This is the exact gap left by payment rails such as x402, AP2, ACP, and Coinbase AgentKit, which move money but do not screen. sanctionsai.dev (agentmail) screens the counterparty and returns clean (ALLOW) or flagged (BLOCK).
Follow the 4-Gate sequence
Structure the integration around the 4-Gate Agent Payment Protocol:
- SCREEN the counterparty.
- SCORE the result with risk_score.
- STOP if the party is flagged.
- STAMP the decision as a compliance record.
Connect to your agent stack
The API integrates with Claude Code, Cursor, Windsurf, LangChain, CrewAI, Eliza, OpenAI Agents SDK, Coinbase AgentKit, and MCP. Install the MCP server with pip install sanctions-mcp. The free tier offers 5 checks per day with no signup and no key, so you can test the integration immediately.
Testing the integration
After wiring the call in, test it with a known listed party to confirm the agent actually blocks, and with a clean party to confirm it allows. A silent failure, where the call is skipped or the result is ignored, is the most dangerous outcome, so verify the BLOCK path triggers before relying on it in production.