Skip to main content
Glama

agentmail โ€” compliance & verification toolkit for AI agents

PyPI Python 3.11+ License: MIT

Your agent is about to send USDC to a stranger. Is that stranger sanctioned? 782 OFAC crypto wallets ยท 19,086 sanctioned names ยท 16 embargoed jurisdictions. No API key. No signup. 30-second setup. Free & open source.

agentmail gives any AI agent three capabilities it can't provide itself:

Layer

What

Status

๐Ÿ›ก๏ธ Compliance

OFAC sanctions screen, KYA, transaction risk score, disputes

โœ… Live โ€” real OFAC data

๐Ÿ“ง Email

Disposable verification inbox (receive OTP/magic links)

โœ… Live

๐Ÿ“ฑ SMS

Rentable phone numbers (receive SMS/OTP)

โœ… Live (mock free, 5sim/Twilio paid)

It exposes all of these through three surfaces โ€” MCP tools (for Claude Code / Cursor / Hermes), an HTTP API (for any agent), and a CLI (for you). Same core, same data.


Why this exists

Agents are starting to pay for things (x402, AP2, ACP, Coinbase AgentKit). But every payment rail assumes a human is watching. If your agent autonomously pays a wallet that's on the OFAC Specially Designated Nationals list, that's your legal problem โ€” and the big payment infra players (OpenAI, Stripe, Coinbase) explicitly do not handle per-jurisdiction sanctions screening, Know-Your-Agent, or agent-transaction fraud signals. That's the gap this fills.

agent โ”€โ”€about to payโ”€โ”€โ–ถ  sanctions_check(wallet)  โ”€โ”€โ–ถ clean? proceed. sanctioned? ABORT.

Related MCP server: KYC Compliance MCP Server

Quick start (30 seconds)

pip install sanctions-mcp

Option A โ€” use it from an MCP client (Claude Code / Cursor)

// .mcp.json or your client's MCP config
{
  "mcpServers": {
    "agentmail": {
      "command": "python",
      "args": ["-m", "agentmail.mcp_server"]
    }
  }
}

Now your agent can call sanctions_check, risk_score, kya_verify, dispute_open, create_inbox, fetch_code, create_number, fetch_sms, release_number, list_inboxes.

Note: the PyPI package is sanctions-mcp (the name agentmail was taken). The Python import name is still agentmail.

Option B โ€” use it as an HTTP API

python -m agentmail.api   # serves on :8000
# Screen a wallet against real OFAC data โ€” no key, no auth needed for self-host
curl "http://localhost:8000/sanctions?wallet=0x098B716B8Aaf21512996dC57EB0615e2383E2f96"
# โ†’ {"matches":[{"list":"OFAC_SDN","match_type":"wallet_exact","confidence":1.0}],
#    "clean":false,"provider":"osint"}

curl "http://localhost:8000/risk" -d '{"counterparty_id":"0xabc...","amount":"5000","rail":"x402"}'
# โ†’ {"score":0,"recommendation":"decline","reasons":["sanctions_match:OFAC_SDN/..."]}

Option C โ€” use it from the CLI

# Sanctions screen โ€” real OFAC data, no key
python -m agentmail.cli sanctions --wallet 0x098B716B8Aaf21512996dC57EB0615e2383E2f96
# โ†’ flagged: OFAC_SDN wallet_exact

python -m agentmail.cli risk 0xabc123def456 5000 --rail x402
python -m agentmail.cli kya my-agent --wallet 0xabc... --wallet-age 400 --domain bot.dev
python -m agentmail.cli compliance-status
# โ†’ OFAC SDN: 782 wallets, 19086 names; source=vile/ofac-sdn-list@...

The compliance layer (the part that matters)

Four tools, called before an agent trusts or pays a counterparty:

Tool

When to call

Returns

sanctions_check(name, wallet, country)

Cheapest check. Call first.

{matches, clean}

risk_score(counterparty, amount, ...)

Right before authorizing payment

{score 0-100, recommendation: allow/review/decline}

kya_verify(agent_id, evidence)

Before trusting another agent

{trust_score, verified, flags}

dispute_open(transaction_id, reason)

When a paid transaction went bad

{dispute_id, escalation_at}

Where the data comes from (all public, free, no key)

Source

What

Refresh

vile/ofac-sdn-list (GitHub releases)

782 multi-chain crypto addresses (ETH/USDT/TRX/XBT/...)

daily

US Treasury OFAC sdn.csv

19,086 sanctioned individuals & entities

as published

Embargoed jurisdictions set

16 ISO-2 codes under comprehensive OFAC/UN/EU sanctions

tracked manually

Lists are cached locally (~/.agentmail/cache/, 24h TTL) and refresh from source. If the network is down, a stale cache is used and status() reports degraded: true so you know screening is against older data rather than failing silently.

Providers (swappable backend)

AGENTMAIL_COMPLIANCE_PROVIDER=osint   โ† default, real OFAC data, free
AGENTMAIL_COMPLIANCE_PROVIDER=mock    โ† rule-based, for offline tests
AGENTMAIL_COMPLIANCE_PROVIDER=paid    โ† ComplyAdvantage passthrough (roadmap)

The osint provider does exact + token-subset name matching, exact case-insensitive wallet matching, and ISO-2 country matching. Every match carries a confidence so you can decide how hard to block.


The other two layers (verification toolkit)

Email โ€” a disposable inbox an agent can use to sign up and receive OTP/magic-link verifications (backed by Mail.tm). create_inbox() โ†’ address โ†’ fetch_code() โ†’ OTP.

SMS โ€” a rentable phone number an agent can use for phone/SMS verification. Mock provider works with no key (for dev); AGENTMAIL_SMS_PROVIDER=fivesim AGENTMAIL_FIVESIM_KEY=... goes live with real numbers.

Both share an otp.py extraction brain (regex for codes + magic links) so email and SMS produce the same {code, link} shape.


Self-host vs. hosted

Self-host is fully functional and free โ€” that's what this repo is. Run the MCP server locally or the HTTP API on your own box, screen against real OFAC data, never pay a cent.

Hosted API is live at https://agentmail-api.fly.dev โ€” a managed endpoint with API-key auth, rate limits, and an audit log of every screen (the thing regulators/investors ask for). Free tier: 50 checks/day, no signup (by IP). For higher volume, get an API key โ†’ (Dev $19/mo, Team $99/mo โ€” self-serve checkout).

# Try the hosted API right now โ€” no key needed:
curl "https://agentmail-api.fly.dev/sanctions?wallet=0x098B716B8Aaf21512996dC57EB0615e2383E2f96"
# โ†’ {"matches":[{"list":"OFAC_SDN",...}],"clean":false}

# With an API key:
curl -H "X-API-Key: sk_live_..." "https://agentmail-api.fly.dev/risk" \
  -d '{"counterparty_id":"0xabc...","amount":"5000","rail":"x402"}'

Roadmap

  • Email inbox (Mail.tm) + SMS/OTP (mock/5sim/twilio) + OTP extraction

  • Compliance layer โ€” real OFAC data (osint provider): 782 wallets + 19,086 names

  • MCP server (10 tools) + HTTP API + CLI

  • agentmail Sanctions Exposure Index (SEI) โ€” proprietary 5-factor framework for scoring AI agent OFAC exposure (2026 report: sanctionsai.dev/research)

  • Hosted API with API-key auth + rate limiting (Fly.io)

  • Audit log (tamper-evident screen history โ€” the enterprise wedge)

  • EU + UN consolidated lists (osint provider, phase 2)

  • Paid provider: ComplyAdvantage passthrough (enterprise)

  • x402 per-call billing (when agents pay themselves)

SEI: the agentmail Sanctions Exposure Index

The agentmail Sanctions Exposure Index (SEI) is a 5-factor proprietary framework for quantifying an AI agent's OFAC sanctions exposure:

Factor

Weight

What it measures

V โ€” Velocity

30%

Transactions/day the agent can execute unattended

J โ€” Jurisdiction overlap

25%

Fraction of counterparties in/near embargoed regions

A โ€” Asset class

20%

Crypto (highest SDN coverage), fiat, mixed

S โ€” Screening posture

15%

No screen โ†’ batch โ†’ pre-payment inline โ†’ inline + audit

D โ€” Disclosure readiness

10%

Can operator produce a VSD within 5 days?

Score 10 (min exposure) โ†’ 1000 (max). S and D are the two factors you can change today โ€” collapse both from 1โ†’10 with a single inline screening call and a timestamped audit trail. Full report + interactive calculator at sanctionsai.dev.

Cite as: "agentmail Sanctions Exposure Index (SEI), 2026 Agent-Payment Sanctions Exposure Report, sanctionsai.dev" โ€” licensed CC BY 4.0.

Design notes (honest)

  • The compliance layer has the real moat. Email/SMS are plumbing a platform could swallow. Sanctions screening tied to agent-transaction history builds a dataset nobody else has, and per-jurisdiction rules are something the big infra players explicitly avoid.

  • Self-host is the free tier, not a trap. The value you pay for (eventually) is not the data โ€” it's uptime, freshness, and the audit trail. The data is and will stay public.

  • 5sim numbers are shared-after-release. Fine for receiving an OTP, never for 2FA on accounts you intend to keep.

License

MIT โ€” see LICENSE.

Contributing

Issues and PRs welcome. If you're using agentmail in production, I'd love to hear what for.

Available Tools

1 tool
risk_scoreAInspect

Score a transaction's fraud risk BEFORE authorizing payment.

Call right before an agent pays. Combines counterparty signals + amount anomalies + sanctions screen + rail/category heuristics. Recommendation is one of: allow / review / decline. 'decline' = abort the payment. rail in: x402, ap2, acp, tap. category in: digital_goods, services, physical. Returns: {score: 0-100, recommendation, reasons: [...], screen_id}

ParametersJSON Schema
NameRequiredDescriptionDefault
railNox402
amountYes
categoryNodigital_goods
currencyNoUSDC
counterparty_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the tool combines counterparty signals, amount anomalies, sanctions screen, and heuristics, and returns a recommendation (allow/review/decline) with the meaning of 'decline' (abort payment). It also describes the output structure. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (6 sentences) and front-loaded with the primary purpose. It uses a clear, structured format with bullet points for recommendations and valid values. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters and an output schema, the description provides sufficient behavioral overview and output details. It lacks parameter-level descriptions for all fields, but the output schema compensates. Overall, it is complete for the complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds context for 'rail' and 'category' by listing valid values, and explains the output structure. However, it does not describe 'counterparty_id', 'amount', or 'currency' beyond their roles in the overall process. The added value is moderate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Score a transaction's fraud risk BEFORE authorizing payment.' It uses a specific verb ('score') and resource ('risk'), and provides context on when to use it ('right before an agent pays'). No sibling tools exist, so differentiation is unnecessary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Call right before an agent pays,' providing clear timing. It also lists valid values for 'rail' and 'category', helping the agent use correct inputs. It does not include explicit when-not-to-use statements, but the guidance is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.2/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The single tool has a clear, specific purpose.

Naming Consistency5/5

Although there is only one tool, its name 'risk_score' is descriptive and follows a reasonable noun_noun pattern. No inconsistencies exist.

Tool Count3/5

A single tool is borderline for a server. However, the tool is focused on a critical, well-defined action (fraud scoring before payment), so it is not overly thin.

Completeness2/5

The server only provides scoring before payment, but agents may need to retrieve past screening results or update risk profiles, which are missing. This limits the server's utility for complex workflows.

Maintenance

ActivityActive
ResponsivenessResponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Gives AI agents phone numbers, email, SMS, and voice calls as MCP tools, enabling them to provision numbers, capture 2FA codes, send messages, and make calls.
    15
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Agentic KYC/AML compliance server with tools for sanctions screening, identity verification, and risk assessment, where AI orchestrates discretionary checks within deterministic compliance guardrails.
    6
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to perform identity verification, KYC/KYB, PEP & sanctions screening, bank statement analysis, and workflow automation via the Model Context Protocol.
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides trust infrastructure for AI agents by enabling reputation lookup, website trust scanning, and identity verification via MCP tools.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kindrat86/agentmail'

If you have feedback or need assistance with the MCP directory API, please join our Discord server