Agent email address: provision a dedicated inbox for an autonomous agent
Agent email address provisioning via API: dedicated inbox with scoped credentials, IMAP/SMTP access, and instant revocation. This guide walks through domain verification, sender identity creation, scoped API key issuance, and the automated provisioning call that returns credentials in one step.
On this page
TL;DR: An autonomous agent needs a dedicated, revocable email identity with scoped credentials, not a shared mailbox or a personal account. Provisioning takes four steps: verify the domain, create a sender identity, issue a scoped API key, and automate the provisioning call. send.io's POST /v0/inboxes endpoint returns IMAP/SMTP credentials in one call, and the password is an API key scoped to that inbox. Separately, the send.io MCP server connects those inboxes to Claude or Cursor. A send-only key can't read replies, while a send-and-receive key can, so use send-only keys for agents that send notifications and send-and-receive keys for agents that read verification codes or replies.
Your agent needs a real inbox, not a workaround through a shared account, so it can receive verification codes, read replies, and respond without a human in the loop. Most teams start with a shared mailbox because provisioning a dedicated inbox feels like manual overhead. That shortcut breaks traceability, makes revocation impossible without collateral damage, and exposes the full account to a compromised agent credential.
This article walks through the alternative: provisioning a dedicated agent email address with scoped credentials via a single API call.
Why your agent requires a dedicated email address
Shared mailboxes fail on traceability, access control, and revocation. The sections below show where they fail and what a unique inbox changes.
Why shared mailboxes break agent flows
A shared mailbox mixes identities. When two agents share an inbox, one agent's reply thread is indistinguishable from another's, so debugging a failed workflow means untangling multiple agents' messages. The same problem applies to transactional email production checklists: without per-agent identity, you cannot isolate which agent triggered a bounce or a complaint.
A shared mailbox also destroys auditability. When an agent sends a message from a shared address, the From field identifies the mailbox, not the agent. When a reply arrives, the webhook routes to the shared inbox, not to the specific agent that needs it. You end up building routing logic in your application layer to reconstruct what the infrastructure should have provided.
Finally, a shared mailbox cannot be revoked for one agent without breaking the others: deleting the mailbox cuts off every agent using it, and changing the shared password forces you to update every agent's credentials. The operational cost of the shortcut compounds with every agent you add, because each new agent widens the blast radius of a single revocation or rotation.
Why unique inboxes ensure traceability
A dedicated inbox gives each agent its own address, its own thread state, and its own credentials. When an agent sends a message, the From address identifies the agent. When a reply arrives, the webhook routes to the right inbox, and the agent's scoped API key, described in the API documentation, can only see that inbox's messages.
This isolation is central to the agent email architecture: each inbox operates as an independent unit with its own IMAP/SMTP login, its own webhook endpoint, and its own permission list. You can monitor, debug, and revoke one agent without touching the others.
Why dedicated inboxes revoke without breaking identity
The API documentation confirms that DELETE /mailboxes/{id} revokes the mailbox's API key and removes any agent inbox tied to it. A shared mailbox cannot be revoked for one agent without breaking the others, but a dedicated inbox can be deleted without affecting any other agent.
A scoped API key works like a keyed entry card: it opens only the inbox it was provisioned for, so a compromised agent credential doesn't expose your full account. An admin-level key opens every inbox and account-level resource, so a compromised admin credential exposes your entire account.
Implementing dedicated email for autonomous agents
Provisioning a dedicated agent inbox takes four steps: verify the domain, create a sender identity, issue a scoped API key, and automate the provisioning call. Steps 1, 2, and 4 show the request and the response.
1. Verify your sending domain
Before you provision an agent email address, you need a verified domain. Add three DNS records: DKIM, SPF, and DMARC. RFC 6376 defines DKIM as a cryptographic signature that receiving servers verify against a public key in DNS. RFC 7208 defines SPF as a TXT record that lists which mail servers can send for your domain. RFC 7489 defines DMARC as a policy that ties SPF and DKIM together and tells receivers what to do when authentication fails.
Add these three DNS records before you provision an inbox:
- DKIM: Add the public key TXT record to your DNS. send.io generates the key pair and provides the record value.
- SPF: Add a TXT record that includes send.io's sending infrastructure. send.io provides the exact record value with the rest of your domain's DNS records.
- DMARC: Add a TXT record at
_dmarc.yourdomain.comwith a policy ofp=quarantineorp=rejectonce you confirm DKIM and SPF are passing.
The SMTP commands reference covers the response codes you'll see if DNS records are missing or misconfigured. A 550 response means the mailbox doesn't exist or the server refused the message for policy reasons, and the enhanced status code identifies the cause: 550 5.1.1 means you should remove the address, while 550 5.7.1 means the server refused delivery for policy reasons, so fix your sender authentication or the policy block first.
2. Create a sender identity for the agent
Create a mailbox on the verified domain. The API documentation shows the POST /mailboxes call:
curl -X POST https://api.send.io/mailboxes \
-H "Authorization: Bearer $SENDIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"address": "agent-001@yourdomain.com"
}'
The response returns the inbox address and IMAP/SMTP credentials. The IMAP/SMTP password doubles as an API key scoped to sending from that mailbox's domain. If the address already exists, the API returns a 409 status code.
The password is returned once at creation, so store it in your secrets manager right away. If you lose it, call POST /mailboxes/{id}/password with the ID of the mailbox you want to rotate. The call issues a new password and immediately revokes the old one.
3. Issue a scoped API key
Attach a permission list to the key. Scoped keys carry permission lists and cannot grant permissions they do not hold. Only admin-level keys can create, change, or delete other keys. This step has no separate request example, because step 4 shows the provisioning call that carries the key.
Each key type carries a different scope and set of permissions:
Key type | Scope | What it permits |
|---|---|---|
Inbox-scoped key | Single inbox | Carries a permission list that limits what it can access, and it cannot grant permissions it does not hold |
Admin-level key | Other keys | Create, change, or delete other keys |
The MCP server documentation uses the same bearer-token auth and scoped keys. An agent connected via MCP can only access the inboxes its key permits, so a compromised MCP session cannot escalate privileges.
4. Automate unique inbox provisioning
Provision a dedicated agent inbox via POST /v0/inboxes. The agent mailbox endpoint accepts two optional parameters: username and domain. Omit the username for a random address. Omitting the domain creates a free mailbox on your workspace's sendiomail.com address, which has no IMAP/SMTP credentials. To get IMAP/SMTP credentials, pass your verified domain, or pass the shared agent domain (agents.send.io) or a subdomain of it explicitly.
curl -X POST https://api.send.io/v0/inboxes \
-H "Authorization: Bearer $SENDIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "agent-001",
"domain": "yourdomain.com"
}'
The response returns a credentials object once: an IMAP/SMTP login whose password is itself an API key scoped to this inbox. The example below is illustrative, so check the API documentation for the exact field names:
{
"id": "inbox_abc123",
"address": "agent-001@yourdomain.com",
"credentials": {
"username": "agent-001@yourdomain.com",
"password": "<inbox_scoped_api_key>",
"imap": {
"host": "imap.send.io",
"port": 993
},
"smtp": {
"host": "smtp.send.io",
"port": 587
}
}
}
The IMAP/SMTP password is returned once. The provisioning response includes the exact host and port to use, and the illustrative example above shows the standard secure values (993 for IMAP, 587 for SMTP submission). The password is itself an API key scoped to that inbox, so it cannot access other inboxes or account-level resources. Both endpoints return a password that doubles as an API key, but the scope differs: POST /mailboxes returns a password scoped to sending from the mailbox's domain, while POST /v0/inboxes returns a password scoped to the new inbox.
Configuring isolated email identities at scale
Once the first inbox works, the same API calls cover many agents. This section covers the DNS checks to run before provisioning, how to generate unique addresses, and which parameters control isolation between inboxes.
DNS record validation for mailbox setup
Check DNS configuration before provisioning inboxes. If records are not verified, the mailbox cannot send or receive. The SMTP server guide explains how to query DNS records using dig or nslookup.
If IMAP/SMTP setup is delayed, the mailbox status shows pending or retrying until the records propagate. Propagation time depends on your DNS provider and TTL settings, so confirm verification before you provision agents in bulk. The domain verification FAQ below gives typical timings.
Provisioning unique agent email addresses
Generate random addresses by omitting the username parameter, or use a specific domain by including the domain parameter. Inbox pods group inboxes for isolation: a pod's API key can only see that pod's inboxes, and a pod cannot be deleted while it still holds inboxes.
This isolation model works like dedicated phone lines vs. a shared switchboard: each agent gets its own line with its own credentials. Pods extend that isolation to groups of inboxes. To create an inbox inside a pod, pass the pod_id parameter, which is required for pod-scoped creation.
API parameters for inbox isolation
Three parameters control inbox isolation:
Parameter | Required | Description |
|---|---|---|
username | No | The local part of the email address. Omit for a random address. |
domain | No | The verified domain. Omit for a free mailbox on your workspace's sendiomail.com address, which has no IMAP/SMTP credentials. To use the shared agent domain (agents.send.io) or a subdomain of it, pass it explicitly. |
pod_id | Yes for pod-scoped creation | The inbox pod ID for isolation. Required when creating an inbox inside a pod. |
Provisioning an isolated agent inbox
Provision an inbox inside a pod by passing pod_id and a permission list: in the create-inbox body:
curl -X POST https://api.send.io/v0/inboxes \
-H "Authorization: Bearer $SENDIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "agent-001",
"domain": "yourdomain.com",
"pod_id": "pod_customer_123"
}'
The response includes the inbox ID, the address, and the IMAP/SMTP credentials, whose password is the scoped API key. The key can only access inboxes in the specified pod.
The create-inbox body doesn't accept a permissions parameter. It accepts username, domain, display_name, client_id, pod_id, and metadata. Permission lists belong to API keys, so you set them through the inbox API-keys endpoint as a map of documented permission names to true:
{
"message_read": true,
"message_send": true
}
Documented permission names include message_read, message_send, message_reply, message_update, message_delete, draft_create, draft_send, webhook_*, and inbox_*. "send" and "receive" are not permission names. A restricted key can only create keys with permissions it holds itself. See the API documentation for the full list and request format.
Implementing scoped permission policies
Scoped keys limit what each agent can do and which inboxes it can see. This section covers how to set send-only and send-and-receive scopes, keep agents from reading each other's mail, and apply the same limits over MCP.
Send-only vs. send-and-receive scopes
A send-only key can send email from one address but cannot read incoming messages, while a send-and-receive key can both send and read. You set the scope through the permission list on the inbox's API key, not in the create-inbox body. A send-only key holds message_send without message_read, while a send-and-receive key holds both.
Use send-only keys for agents that only need to send notifications or alerts. Use send-and-receive keys for agents that need to read replies, process verification codes, or handle two-way conversations.
Preventing cross-agent email access
Put agents that must not see each other's mail in separate pods, so one agent cannot read another agent's messages.
If a pod key leaks, the exposure is limited to the inboxes in that pod.
Securing MCP email with scoped keys
The MCP server uses the same bearer-token auth and scoped keys as the REST API. An agent connected via MCP can only access the inboxes its key permits. The MCP specification defines tools as executable functions that AI applications can invoke, and send.io's MCP server exposes 160 tools through that interface for assistants like Claude and Cursor.
When you connect an agent to the MCP server, the agent's scoped key determines which tools it can invoke and which inboxes it can access. A send-only key cannot invoke read tools.
Configuring MCP workflows for agent mailboxes
The hosted MCP server exposes the same inboxes and scoped keys to assistants like Claude and Cursor. This section covers tool access, inbound webhook payloads, and conversation threading.
Configuring MCP email tool access
Connect the hosted MCP server to Claude or Cursor. The MCP documentation shows the connection flow: POST to /mcp with JSON-RPC 2.0 over Streamable HTTP, using the same bearer-token auth as the REST API.
The tool set for agent inboxes includes:
- Email: Send messages and list email for the inboxes the key can access
- Inboxes: Provision and manage agent inboxes
- Domains: Manage sending domains and scoped API keys
- Webhooks: Configure inbound delivery endpoints
The CLI documentation covers a local stdio MCP mode for free-inbox testing, which exposes a narrower 5-tool set for Claude Code and Cursor without requiring sign-in. The tools are free_inbox_create, free_inbox_list, free_inbox_wait_for_email, free_inbox_read, and free_inbox_connect.
Handling inbound webhook payloads
send.io delivers the email body, headers, and attachments to your webhook endpoint, not just metadata. Received-mail events (email.received, message.received) are capped at 256 KB. For larger mail, the body fields are omitted and listed in bodies_omitted. Attachments arrive as inline Base64 up to 2 MB each, or as a download_url that expires. The email.* events use a {type, created_at, data} envelope with text and html body fields, while agent-inbox message.* events use a {type: "event", event_type, event_id, message, thread} envelope. The example below is illustrative and shows the email.received envelope, so check the webhook documentation for the exact field names:
{
"type": "email.received",
"created_at": "2026-11-20T14:02:11Z",
"data": {
"from": "sender@example.com",
"to": "agent-001@yourdomain.com",
"subject": "Re: Verification code",
"text": "Your code is 123456",
"html": "<p>Your code is 123456</p>",
"headers": {
"Message-ID": "<abc123@example.com>",
"In-Reply-To": "<def456@yourdomain.com>"
},
"attachments": [
{
"filename": "document.pdf",
"content": "base64_encoded_content"
}
]
}
}
Resend's inbound webhook is metadata-only: it carries the sender, recipient, and subject, but not the email body, headers, or attachment contents. SendGrid's Inbound Parse Webhook posts multipart/form-data. Mailgun's inbound routes deliver UTF-8 JSON. Postmark's inbound email processing also delivers the full email content, including body, headers, and Base64-encoded attachments, with a 35 MB message size limit.
Tracking agent email conversation flow
Sending or forwarding a message starts a new thread, and a reply carries the threading headers that tie it to the earlier messages. RFC 5322 defines how threading works: the In-Reply-To and References headers link messages into a conversation.
When an agent sends a reply, send.io sets the appropriate threading headers so the recipient's mail client groups the messages into a conversation. When a reply arrives, the webhook payload includes the In-Reply-To header, which the agent can use to route the message to the correct thread.
Resolving lifecycle errors in agent mailboxes
Agent mailboxes fail in predictable ways: DNS records that haven't verified, credentials that rotate mid-session, and identities that need to be shut down. This section covers the recovery steps for each case.
Troubleshooting domain verification timeouts
If DNS records are not verified, the mailbox cannot send or receive. Check DNS configuration using the domain management endpoint in the API documentation. The response shows which records are missing or misconfigured.
The table below lists common error codes and how to resolve each one:
Error code | Meaning | Resolution |
|---|---|---|
409 | Address already exists | Use a different username or check if the mailbox already exists |
429 | Rate limit exceeded | Implement exponential backoff with jitter |
403 | Request forbidden, for example when sending is suspended ( | Check the error body for the reason, and contact support if sending is suspended |
5xx | Server error | Retry with exponential backoff, contact support if persistent |
Managing key expiry during live sessions
Rotate a mailbox password by calling POST /mailboxes/{id}/password with the ID of the mailbox you want to rotate. Each call issues a new password and immediately revokes the old one. See the API documentation for the full request format. Handle this in a live agent session by:
- Detect the rotation trigger: Monitor for 401 Unauthorized responses, which mean the request lacks valid credentials: the key may be revoked, expired, or malformed.
- Retrieve the new password: Call POST /mailboxes/{id}/password and store the new password in your secrets manager.
- Update the agent's credentials: Restart the agent or reload the credentials without dropping the session.
Handling agent identity termination
Delete a mailbox using DELETE /mailboxes/{id}. The API documentation confirms that this revokes the API key and removes any agent inbox tied to it. The offboarding workflow:
- Stop the agent: Halt the agent loop to prevent new send attempts.
- Delete the mailbox: Call DELETE /mailboxes/{id}.
- Verify revocation: Attempt to use the old API key and confirm it returns 401 Unauthorized.
Provision an agent inbox and connect it to your MCP-compatible assistant with the quickstart guide.
FAQs
Can multiple agents share one email address?
No. Each agent needs its own inbox with its own scoped API key. A shared address mixes identities and makes revocation impossible without breaking other agents.
How do you revoke an agent's email access without affecting others?
Delete the agent's mailbox. This revokes its API key and removes any agent inbox tied to it, without affecting other mailboxes or inboxes.
What happens if the agent hits a rate limit?
The API returns a 429 with a rate_limit_exceeded code when you send more than 10 requests per second per team, or with daily_quota_exceeded when you hit the sending quota. The API reference documents both without a Retry-After header, so don't build your retry logic around one. Retry after a moment, implement exponential backoff with jitter, and set a turn budget so the agent does not retry indefinitely.
Do you need a separate domain for each agent?
No. You can provision multiple inboxes on one verified domain, or pass the shared agent domain (agents.send.io) or a subdomain of it explicitly. Omitting the domain parameter creates a free mailbox on your workspace's sendiomail.com address instead, and that mailbox has no IMAP/SMTP credentials.
How long does domain verification take?
Your DNS provider's TTL settings control how quickly records update. Low TTL values can make records visible within minutes to a few hours, but a full global update usually takes 24 to 48 hours and can run to 72 hours.
Key terms glossary
Agent inbox: A dedicated email address and mailbox provisioned for an autonomous agent, with its own scoped API key and thread state.
Scoped API key: A credential with a permission list that limits what it can access. It cannot grant permissions it does not hold.
Inbox pod: A grouping of inboxes for isolation. A pod's API key can only see that pod's inboxes.
MCP (Model Context Protocol): A standard protocol for connecting AI assistants to external tools, including email.
Webhook payload: The data delivered to an endpoint when an event occurs, such as an inbound email.
DKIM, SPF, DMARC: DNS records that authenticate email senders and protect against spoofing.