Integration · Vercel AI SDK

OFAC Screens Before AI SDK Agents Pay

Integrate OFAC sanctions screening into your Vercel AI SDK agent. One tool call blocks payments to sanctioned wallets.

The problem

Agents built with the Vercel AI SDK can use tool calling to initiate payments. Without a sanctions tool in the loop, the agent has no way to know if a wallet address is on the OFAC SDN list. The deployment operator bears strict liability.

Code example

import { generateText } from "ai";
import { sanctionsCheck } from "@agentmail/mcp-sdk";
import { openai } from "@ai-sdk/openai";

const result = await generateText({
  model: openai("gpt-4o"),
  tools: {
  sanctionsCheck,
  sendPayment: {
    description: "Send USDC to wallet",
    parameters: ...,
    execute: async ({ wallet }) => {
    // Always screen before payment
    const screen = await sanctionsCheck({ wallet });
    if (screen.flagged) throw new Error("Blocked by OFAC");
    return executePayment(wallet);
    }
  }
  },
  prompt: "Pay the invoice from wallet 0x..."
});

Setup steps

Install agentmail SDKnpm install @agentmail/mcp-sdk
Add tool to AI SDKImport sanctionsCheck tool into your generateText or streamText call
Wire pre-payment checkScreen counterparty wallet before the payment tool is called
Deploy to VercelOne-click deploy. Free tier works in production.

Pricing

From $19/mo (600 checks) · Free tier: 5 checks/day, no API key

Add OFAC screening to Vercel AI SDK

Free tier: 5 checks/day, no API key. Scale from $19/mo.

See pricing