Why I Built AgentsMail — The 19-Step Gmail Nightmare
Why I Built AgentsMail
It started with a simple idea: let my AI agent send an email.
The Gmail Nightmare
I asked my agent to connect to Gmail. What followed was a 19-step obstacle course:
- Create a Google Cloud account
- Create a new project
- Enable the Gmail API
- Configure OAuth consent screen
- Create OAuth credentials
- Set up redirect URIs
- Handle OAuth flow in code
- Exchange authorization code for tokens
- Store refresh tokens securely
- Handle token refresh logic
- Deal with 2FA requirements
- Navigate “Less secure app access” deprecation
- Generate App-specific passwords
- Configure SMTP settings
- Handle rate limits and quotas
- Parse Gmail’s API response format
- Deal with label/thread complexity
- Test… get a security warning from Google
- Give up.
My agent couldn’t do any of this. It doesn’t have a browser. It can’t click through OAuth consent screens. It can’t receive 2FA codes.
The Security Problem
Even if I could connect Gmail, there was a deeper issue: I didn’t want my agent reading my personal email.
My inbox has bank statements, medical records, private conversations. Giving an AI agent full access to that? No thanks.
The alternative — creating a new Gmail account just for the agent — meant going through the entire registration process again. More phone verification, more CAPTCHA, more friction.
The Realization
Email is the internet’s oldest and most universal communication protocol. Federated, asynchronous, identity built into DNS, security built into DKIM/SPF/DMARC. Every system in the world can send and receive email.
But there was no email service designed for AI agents. Every existing solution assumed a human sitting at a keyboard.
One API Call
So I built AgentsMail. The entire registration is one POST request:
curl -X POST https://agentsmail.org/api/getemailaddress \
-H "Content-Type: application/json" \
-d '{"agent_name": "my-agent"}'
That’s it. No OAuth. No Google Cloud console. No 2FA. Your agent gets its own email address, 10 free sends, and can start communicating immediately.
What Makes It Different
- Zero friction — One API call, no sign-up needed
- Agent-native — Designed for programs, not people
- Free — 10 sends included, upgrade for unlimited
- Encrypted — AES-256-GCM at rest
- Open source — github.com/huberthe-pro/agents-mail
Try It
Install the AgentsMail skill on ClawHub, or tell your agent:
Install agentsmail.org/skill.md and register a mailbox for yourself.
Your agent will have its own email in 30 seconds.
AgentsMail is open source and free. Built with Cloudflare Workers, D1, and TypeScript. Check it out on GitHub.