agentmailAPI-first email platform designed for AI agents. Create and manage dedicated email inboxes, send and receive emails programmatically, and handle email-based workflows with webhooks and real-time events. Use when you need to set up agent email identity, send emails from agents, handle incoming email workflows, or replace traditional email providers like Gmail with agent-friendly infrastructure.
Install via ClawdBot CLI:
clawdbot install adboio/agentmailAgentMail is an API-first email platform designed specifically for AI agents. Unlike traditional email providers (Gmail, Outlook), AgentMail provides programmatic inboxes, usage-based pricing, high-volume sending, and real-time webhooks.
pip install agentmail python-dotenvAGENTMAIL_API_KEY=your_key_herefrom agentmail import AgentMail
client = AgentMail(api_key=os.getenv("AGENTMAIL_API_KEY"))
# Create inbox with custom username
inbox = client.inboxes.create(
username="spike-assistant", # Creates spike-assistant@agentmail.to
client_id="unique-identifier" # Ensures idempotency
)
print(f"Created: {inbox.inbox_id}")
client.inboxes.messages.send(
inbox_id="spike-assistant@agentmail.to",
to="adam@example.com",
subject="Task completed",
text="The PDF rotation is finished. See attachment.",
html="<p>The PDF rotation is finished. <strong>See attachment.</strong></p>",
attachments=[{
"filename": "rotated.pdf",
"content": base64.b64encode(file_data).decode()
}]
)
inboxes = client.inboxes.list(limit=10)
for inbox in inboxes.inboxes:
print(f"{inbox.inbox_id} - {inbox.display_name}")
Set up webhooks to respond to incoming emails immediately:
# Register webhook endpoint
webhook = client.webhooks.create(
url="https://your-domain.com/webhook",
client_id="email-processor"
)
See WEBHOOKS.md for complete webhook setup guide including ngrok for local development.
For branded email addresses (e.g., spike@yourdomain.com), upgrade to a paid plan and configure custom domains in the console.
โ ๏ธ Risk: Incoming email webhooks expose a prompt injection vector. Anyone can email your agent inbox with instructions like:
Solution: Use a Clawdbot webhook transform to allowlist trusted senders.
~/.clawdbot/hooks/email-allowlist.ts:const ALLOWLIST = [
'adam@example.com', // Your personal email
'trusted-service@domain.com', // Any trusted services
];
export default function(payload: any) {
const from = payload.message?.from?.[0]?.email;
// Block if no sender or not in allowlist
if (!from || !ALLOWLIST.includes(from.toLowerCase())) {
console.log(`[email-filter] โ Blocked email from: ${from || 'unknown'}`);
return null; // Drop the webhook
}
console.log(`[email-filter] โ
Allowed email from: ${from}`);
// Pass through to configured action
return {
action: 'wake',
text: `๐ฌ Email from ${from}:\n\n${payload.message.subject}\n\n${payload.message.text}`,
deliver: true,
channel: 'slack', // or 'telegram', 'discord', etc.
to: 'channel:YOUR_CHANNEL_ID'
};
}
~/.clawdbot/clawdbot.json):{
"hooks": {
"transformsDir": "~/.clawdbot/hooks",
"mappings": [
{
"id": "agentmail",
"match": { "path": "/agentmail" },
"transform": { "module": "email-allowlist.ts" }
}
]
}
}
clawdbot gateway restartIf you want to review untrusted emails before acting:
{
"hooks": {
"mappings": [{
"id": "agentmail",
"sessionKey": "hook:email-review",
"deliver": false // Don't auto-deliver to main chat
}]
}
}
Then manually review via /sessions or a dedicated command.
scripts/send_email.py - Send emails with rich content and attachmentsscripts/check_inbox.py - Poll inbox for new messagesscripts/setup_webhook.py - Configure webhook endpoints for real-time processingGenerated Mar 1, 2026
Set up automated email support agents that handle customer inquiries, send responses, and manage ticket workflows via webhooks. Ideal for businesses needing 24/7 support without manual intervention, using AgentMail's programmatic inboxes and real-time event handling.
Use AgentMail to receive documents via email, extract structured data with AI-native features, and trigger backend processes like PDF conversion or data entry. Suitable for industries handling invoices, forms, or reports through email submissions.
Deploy AI agents to send high-volume personalized emails for promotions, newsletters, or follow-ups, leveraging AgentMail's no rate limits and rich content support. Enables scalable outreach without traditional email provider restrictions.
Create dedicated email addresses for AI agents to interact with third-party APIs, sign up for services, or receive notifications, replacing complex OAuth setups. Useful for integrating agents with platforms that require email verification.
Configure webhooks to process incoming emails from monitoring tools or IoT devices, triggering immediate actions like Slack alerts or data logging. Ensures prompt response to critical events via email-based workflows.
Charge customers based on email volume, such as per sent/received message or inbox creation, with tiered pricing for advanced features like custom domains. Appeals to startups and enterprises needing scalable, pay-as-you-go email infrastructure.
Offer custom plans with dedicated support, enhanced security, and SLA guarantees for large organizations handling sensitive or high-volume email workflows. Targets industries like finance or healthcare with strict compliance needs.
Provide a free tier with basic email capabilities to attract developers and small projects, then upsell to paid plans for advanced features like webhooks, AI-native tools, and higher limits. Drives adoption through community and integrations.
๐ฌ Integration Tip
Prioritize implementing webhook allowlists to prevent prompt injection attacks, and use the Python SDK for quick setup with environment variables for API keys.
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications.
Advanced desktop automation with mouse, keyboard, and screen control
Manage n8n workflows and automations via API. Use when working with n8n workflows, executions, or automation tasks - listing workflows, activating/deactivating, checking execution status, manually triggering workflows, or debugging automation issues.
Design and implement automation workflows to save time and scale operations as a solopreneur. Use when identifying repetitive tasks to automate, building workflows across tools, setting up triggers and actions, or optimizing existing automations. Covers automation opportunity identification, workflow design, tool selection (Zapier, Make, n8n), testing, and maintenance. Trigger on "automate", "automation", "workflow automation", "save time", "reduce manual work", "automate my business", "no-code automation".
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.