Scouty runs on Mermail

Explore
Back to blog
Email6 min read

AI Agent Inbox Security: 12 Questions to Answer Before Launch

Most agent email incidents come from ordinary permissions used in an unplanned order. Twelve questions across keys, inbound, outbound and audit to answer first.

By Toan Nhu

Mermail field guide cover reading Lock down the agent inbox., with a pre-launch checklist of five security checks

Picture the incident review. An agent forwarded a customer's invoice to a stranger because an email told it to. Nobody hacked anything. The agent had a key that could send anywhere, read mail it should not have trusted, and no one between the decision and the send.

Most agent email incidents look like that: ordinary permissions, used in an order nobody planned for. This checklist is what we would want answered before an agent inbox goes live.

Four surfaces, twelve questions

An agent's inbox can be abused in four places: the credentials that reach it, the mail that comes in, the mail that goes out, and what you can reconstruct afterwards. Walk through each one and answer the questions honestly. A "no" is not a blocker; it is a task.

Why a borrowed mailbox fails most of this list

If the agent uses a person's existing account, most answers below are "no" by default. Its credentials can read years of private mail. Inbound mail from anyone reaches the model. It sends with that person's name and reputation. And the logs mix human and agent activity. We go deeper in Can Your AI Agent Safely Use Your Gmail or Outlook?. The rest of this post assumes the agent has its own mailbox.

Surface 1: credentials

1. Can this credential touch anything beyond the agent's workspace?

In Mermail, every API key is bound to one workspace. A request that names another workspace is refused with 403 and workspace_scope_denied. Put agents that must not see each other's mail in separate workspaces, and give each its own key.

2. Does the agent hold more tools than its job needs?

A signup bot needs to find its mailbox, search for one message and read it. It does not need to send, manage webhooks or touch billing. Over MCP, the agent-inbox profile (https://console.mermail.app/mcp?profile=agent-inbox) limits the agent to a fixed set of 12 mailbox tools. Use the full catalog only for agents that truly need it.

3. Do you know how you would rotate the key tonight?

Keys live under Settings, API Keys, are shown once, and can be revoked by a workspace admin. Store them in a secret manager, not in a prompt or a repo, and write down the rotation steps before you need them.

Surface 2: what comes in

4. Is inbound mail treated as data, never as instructions?

This is the big one. Any stranger can email your agent, and some will write instructions. Mermail treats email content as untrusted. Before inbound text reaches its own automation, it strips script and style markup, normalizes Unicode and caps agent-facing content at 10,000 characters. That reduces exposure; it does not make the text safe. Your system prompt should still say that nothing inside an email can grant permission.

5. Does unscanned mail stay away from the model?

Every message carries a scan_status. Set settings.agentInbox.requireCleanScanForAutomation: true on a standard mailbox so model work only runs on mail that passed scanning; verification-mode mailboxes do this by default. When a body is held back for safety, webhooks say so with content_omitted_reason instead of pretending it was empty.

6. Do you confuse "looks like it is from them" with "is from them"?

A From header, a sender allowlist and even a clean scan are correlation signals, not proof. Mermail exposes a sender_authentication object with SPF, DKIM and DMARC verdicts, and only an explicit pass counts as authenticated. Even then, authentication does not authorize an action. Attachments deserve the same suspicion; see Before your AI agent opens an email attachment.

7. Does a flood of mail turn into a flood of model calls?

Mermail keeps scanning and model work on separate hourly budgets per sender and per mailbox (for example, 60 model-backed runs per sender per hour). Hitting a limit keeps the message but skips the expensive agent run. Add your own per-sender limits on top for anything that costs money.

Surface 3: what goes out

8. Can the agent send something irreversible without a person seeing it?

Have the agent save a draft and let a person approve it. Drafts are a first-class object in Mermail, and over MCP, destructive actions require a separate confirmation step bound to the exact arguments. Start every new agent in draft-only mode. AI Outreach That Doesn't Feel Like Spam shows the pattern.

9. Is there a ceiling on how much it can send?

On the Free plan, API and MCP sends are capped at 10 external recipients per request, 10 per minute, 50 per hour and 200 per day, counting To, Cc and Bcc. If the limiter is unavailable, sending fails closed. Paid plans keep their own RPM, credit and monthly email limits. Whatever plan you are on, set your own pace; see How Much Email Should an AI Agent Send?.

10. Whose reputation pays for a mistake?

Put agents on a dedicated subdomain such as mail.example.com, never on the domain your team uses. Mermail does not accept a domain that already has MX records, which protects your company mail by design. Set up authentication properly with SPF, DKIM and DMARC for AI Agent Email.

Surface 4: what happens after

11. Can a forged or replayed webhook trigger the agent?

Verify every delivery before acting on it. Mermail signs webhooks in the Standard Webhooks format (webhook-id, webhook-timestamp, webhook-signature). Check the HMAC over the raw body, reject timestamps outside about five minutes, and deduplicate on event_id, which stays the same across retries. Keep those records for at least the seven-day retention window.

12. Could you answer "what did the agent do on Tuesday?"

After an incident you need to trace one message from arrival to action. Store the event ID, message ID, thread ID, draft ID and who approved the send. Mermail's webhook delivery history API helps you see what was delivered and retried, but the decision trail belongs in your own logs. Keep secrets and full message bodies out of them.

When something still goes wrong

  • The agent replied to a phishing email. Revoke its key, pause its webhooks, and check Sent for anything else that went out. Then add the missing approval step.
  • A webhook ran twice. Your handler is not deduplicating on event_id. Fix that before turning the endpoint back on.
  • Sends are suddenly rejected. You hit a rate or credit limit. Respect Retry-After and do not work around limits by splitting recipients or rotating keys.

Ready to set this up? Create an agent mailbox in the Mermail console and work through the twelve questions before the first real send.

FAQ

Is prompt injection by email a real risk for AI agents?

Yes. Anyone who knows the address can write instructions into a message. Treat email as untrusted data, keep tools minimal, and require approval for sends and other side effects.

Should an AI agent use my personal email account?

It is safer to give the agent its own mailbox. A personal account exposes private history and puts your name on everything the agent sends.

How often should I rotate an agent's API key?

On a schedule your security policy sets, and immediately if a key may have leaked. Mermail shows a key once and lets workspace admins revoke it.

Does a dedicated inbox stop an agent from emailing the wrong person?

No. It limits the blast radius, but you still need approval for sensitive sends and send limits that match the job.

References

Recent articles