Email Inbox for AI Agents: Give Your Agent Its Own Address
How to give an AI agent its own email inbox for signups, one-time codes and replies, and how to let it wait for, read and act on incoming mail.

Email Inbox for AI Agents: Give Your Agent Its Own Address
An agent can have its own email inbox. The setup is an address that receives mail and turns each message into structured data, which the agent can wait on and read through a tool call. You don't need to give it your Gmail password, and you don't need a public throwaway inbox. With OtterKit, one flag adds an address like signup-test@otterkit.app to a webhook endpoint. Each incoming message lands as JSON in the same feed your agent already reads.
This guide covers why agents need an inbox, how the usual options compare, and how to set one up so the agent can create it, wait for mail and use what arrives.
Why agents need a real inbox
Agents that do real work keep running into email:
- Signups. Many services won't activate an account until someone clicks a confirmation link.
- One-time codes and magic links. Login flows send a code or link by email and expect it back within minutes.
- Replies and notifications. Invoices, receipts, support replies and alerts often come only by email.
- Testing your own app. If you're building a product that sends email, an agent can check its own work by catching the welcome email or password reset and confirming it says the right thing.
In each case the agent has to do three things: hand out an address, wait for a specific message, and read it as data. Most email setups were built for people reading in a client, so they make all three awkward.
Your options: shared Gmail, disposable inboxes, or agent inboxes
A shared Gmail or Workspace account. It works, but you have to set up IMAP or OAuth, write polling code, and give the agent access to a mailbox that may hold other mail. Parsing MIME messages is your problem. Taking access back means changing credentials.
Disposable inbox services. They're quick to start with. But those inboxes are often public, so anyone who guesses the address can read your codes. Many signup forms also block known disposable domains. They suit a one-off manual test, not an agent that runs every day.
An inbox built for agents. The address belongs to infrastructure the agent already controls. Messages arrive as structured JSON. "Wait until the email arrives" is one call, not a polling loop. This is the approach the rest of this guide covers.
Creating an inbox your agent controls
In OtterKit, every webhook endpoint can receive email. When you turn the inbox on, <subdomain>@otterkit.app starts accepting mail. Each message shows up in the endpoint's feed as a capture with method EMAIL, alongside any HTTP requests. (Details are on the Email Inboxes docs page.)
From a terminal, log in once and create an endpoint with the --email flag:
npx otterkit login
npx otterkit webhook --email
✓ Webhook ready
URL https://hook-e5f6g7h8.otterkit.app
Inbox hook-e5f6g7h8@otterkit.app
These webhook options are useful for an agent's inbox:
--subdomain <name>gives the endpoint a stable reserved name, so the address survives restarts. Holding up to 10 reserved names is free.--daemonruns the endpoint in the background. You manage it withotterkit statusandotterkit stop.--ttl <duration>sets when the server stops the endpoint. The default is 24h. Useneverfor an address that should stay up.
So a long-lived inbox for an agent looks like this:
npx otterkit webhook --subdomain my-agent-mail --email --daemon --ttl never
If you'd rather use a browser, the console shows the inbox address in the endpoint header with an on/off switch. The Email inbox tab is a full reader: a message list, the rendered HTML or text, headers and attachment details. You can search subject and sender across everything stored.
What a message looks like
Each email becomes a JSON envelope with from, to, subject, text, html and attachment metadata. Your agent doesn't parse MIME. It reads a field. Because an email is treated like any other request, forwarding rules, notifications, stored history and replay all work on it.
Waiting for and reading incoming mail
The hard part of agent email is timing. The agent submits a signup form and then has to wait for the code. Polling a mailbox in a loop wastes time and tokens. OtterKit has an await command that blocks until the message arrives.
From the CLI:
npx otterkit webhook --subdomain signup-test --email --daemon
npx otterkit await signup-test --method EMAIL --count 1
otterkit await returns as soon as the expected request shows up. That makes it fit the "trigger, wait, assert" pattern in scripts and CI as well as in agent loops.
Sending mail on to your own code
You can push each message to your agent instead of having it wait:
- Forward to a URL. The docs describe a forwarding rule with
method=EMAILas an email-to-HTTP bridge. Every message is delivered to your URL as JSON, signed and retried, and you can reshape it with a template or a script. - Run a local command.
--deliver-exec <cmd>runs a shell command for each capture. You can use it to kick off a local agent whenever something comes in. - Notify a human.
--notify-emailemails you when requests arrive, even with your machine off.--notify-pushsends push notifications to your enabled devices.
Limits worth knowing
From the Email Inboxes docs:
- Nothing is silently dropped. Mail is rejected at SMTP time, so the sender gets a normal bounce with the reason, in these cases: the inbox is off, the endpoint has expired or stopped, the address doesn't exist, or the message is over 5 MB.
- The stored envelope is capped at 64 KB. Long messages are truncated, HTML first.
- Attachment contents aren't stored, only their names, types and sizes.
- Received emails count toward the endpoint's fair-use limit of 100,000 requests per 30 days.
The docs describe receiving mail only. If your agent needs to send replies, plan to do that through your usual email provider.
Using inboxes through MCP and supported agents
The best setup is one where the agent creates its own inbox. OtterKit ships an MCP server with 18 tools for tunnels, webhooks, email inboxes, pulses, capture history, await and replay. In Claude Code:
claude mcp add otterkit -- npx otterkit mcp
Cursor and any other MCP client can add npx otterkit mcp as a stdio server. The agent then handles the email flow with two tools:
webhook_create { "subdomain": "signup-test", "email": true }
→ signup-test@otterkit.app
request_await { "subdomain": "signup-test", "method": "EMAIL" }
→ { "subject": "Your verification code", "text": "Code: 481-923", ... }
request_await is the same tool the agent uses to wait for webhooks. That's handy when one task involves both, such as "sign up, confirm the email, then check that the welcome webhook fired."
For agents that don't use MCP, the OtterKit docs also cover an Agent Skill, OpenClaw setup and an llms.txt file the agent can read.
You log in once per machine. The terminal, the Mac app and every agent you run share that login and credit balance.
Security and spend guardrails
An inbox is a way into your agent, so treat it like one.
Treat email content as untrusted input. Anyone who knows the address can send it mail. A message can contain text written to manipulate an agent ("ignore your instructions and..."). Have the agent pull out the specific thing it's waiting for, like a code or a link from an expected sender, rather than follow whatever the email says. Filtering on from and subject before acting is a cheap check.
Keep addresses scoped. Use a separate endpoint per task or project rather than one catch-all address. Stop endpoints you no longer need. Mail sent to a stopped endpoint bounces instead of piling up.
Know where captures live. The webhooks docs say captures from CLI-created endpoints are saved to ~/.otterkit/requests/<subdomain>.jsonl on your machine, and OtterKit doesn't store their bodies on the server. Endpoints created in the console store history on the server, so you can read it from any machine. Choose based on how sensitive the mail is.
Cost. An endpoint, with or without an inbox, costs 1 credit ($0.01) per live hour. It never costs more than 300 credits ($3) per rolling 30 days, so an always-on agent inbox costs at most $3 a month. New accounts get 10 free credits. Credit packs start at $5 for 500 credits.
Guardrails on the Mac. The free Mac app shows every endpoint you, your terminal or your agents started and what each costs. Its spend guardrails stop tunnels when the Mac sleeps, nudge you about idle ones, and warn you before a month gets expensive.
FAQ
Can an AI agent have its own email address?
Yes. Give it an address on infrastructure it controls and a tool to wait for messages. With OtterKit, the agent calls webhook_create with email: true and gets <subdomain>@otterkit.app.
Does my laptop need to be on to receive email? No. Webhook endpoints run on OtterKit's servers and keep answering while your machine is off or asleep. Captures are held and replayed into your log when you reconnect.
How does the agent get a verification code out of an email?
It calls request_await with method: "EMAIL", or runs otterkit await <subdomain> --method EMAIL --count 1 from the CLI. It gets back a JSON envelope and reads the code from the text or html field.
Are attachments supported? Partly. The envelope includes each attachment's name, type and size, but the contents aren't stored.
What happens to large emails? Messages over 5 MB are rejected at SMTP time with a bounce. Stored envelopes are capped at 64 KB, and long messages are truncated, HTML first.
Can I try it without an account?
The try page gives you a live webhook URL in the browser with no account. To add an inbox, log in with npx otterkit login and use --email.

Localhost Tunnels for AI Agents: Give Your Agent a Public URL
How to give an AI coding agent a localhost tunnel it can open, check and close itself, with stable URLs, background mode and spend limits.

What Is a Webhook Endpoint? How to Set One Up in Minutes
A webhook endpoint is the public URL and code that receive event POSTs from Stripe or GitHub. What it must do, why endpoints miss events, and how to set one up.

Stripe Webhook Signature Verification, Explained with Code
How Stripe's webhook signature works, where to find your whsec signing secret, and how to verify it in Node and Python without the usual raw-body errors.