Pattern Automation
← Blog

How to give your AI coding agent its own email inbox

Provision one Agent Inbox per coding agent via MCP or SDK, so OTP and vendor mail stay isolated and sends wait on Ask.

Discuss this post in AI

Send a pre-filled prompt to ChatGPT, Claude, Gemini, or Perplexity — get a summary, ask follow-ups, or compare ideas from this guide.

A coding agent that can only edit files is half a coworker. Cloud consoles mail one-time codes, package registries send license keys, CI systems dump failure logs, and design partners reply to questions in threads nobody is watching. The missing surface is email that belongs to the role, not to a person’s personal mailbox.

Agent Inbox is an API mailbox for agents. Create one inbox per coding agent, attach it through MCP or the SDK, and keep outbound mail on Ask so a human confirms before anything leaves. Forwarding into Neuro OS is how a person sees a thread when the agent cannot finish the job.

One inbox per agent

Do not share a developer mailbox across Claude Code, Cursor, Codex, and a Hermes subagent. Shared inboxes mix OTP traffic with customer replies and make audit trails unusable. Provision a dedicated address at role bootstrap:

from agentinbox import AgentInbox
client = AgentInbox()
inbox = client.inboxes.create(username="coder-alpha", domain="agentinbox.space")

Name the username after the role and environment: coder-staging, docs-bot, release-notes. If the same person runs several agents, each agent still gets its own inbox. Isolation is the product, not a nice-to-have.

Attach through MCP first

If the coding agent supports MCP, add the Agent Inbox MCP server at session start. The useful tools are small: resolve or create an inbox, list threads, read a message, search, and draft a send that waits for approval. Cursor and Claude Code can load MCP from project config. Codex and other CLI agents can do the same when they speak MCP. Hermes can mount tools per subagent so a research fork does not inherit the release bot’s mailbox.

When MCP is unavailable, fall back to the Python or TypeScript SDK inside a skill or script the agent is allowed to run. Keep credentials server-side. The sandbox should never print API keys into logs, chat transcripts, or commits. See introducing Agent Inbox for the mailbox model.

What the agent is allowed to receive

Legitimate vendor verification is the common case. A cloud console, package registry, or SaaS trial that the company owns sends a one-time code to the address the agent used at signup. The agent reads the thread, extracts the code, and continues the owned workflow. The same pattern covers license keys, invoice PDFs, and CI failure digests forwarded from a shared ops alias.

Isolation still matters. A session working on tenant A must not read tenant B’s verification mail. Create inboxes per tenant or per run when the work is customer-specific. Do not treat a personal Gmail as a shared secret store.

Ask before send

Drafts are cheap; sends are not. Configure outbound mail as Ask. The agent prepares a reply, a status update, or a question to a vendor. Neuro OS (or the local approval UI) shows the draft, recipients, and thread. A person clicks send or edits the text. If the agent also proposes a CRM note or a ticket comment, that write follows the same gate.

Never put SMTP passwords in a skill file. Agent Inbox owns delivery. Threading stays intact so a later reply lands on the same conversation — see email threading for AI agents.

A minimal operating loop

  1. Create the inbox at role bootstrap and store the inbox id in the role config.
  2. Subscribe to inbound mail, or poll with backoff if a webhook is not yet available.
  3. Classify each message: verification, vendor, human question, or noise.
  4. For owned vendor mail, extract the needed field and continue the task.
  5. For human questions, draft a reply and wait on Ask.
  6. Escalate by forwarding the thread into Neuro OS when judgment is required.

Start with one agent and one vendor flow. Measure missed messages and time-to-continue before expanding. The coding agent should not become a second helpdesk; it should own the mail that unblocks its own work.

Agent Inbox gives each role a mailbox people can reply to, with forwarding into Neuro OS when a human must see the thread. Outbound mail defaults to Ask. Run the role on Neuro OS. To scope the first inbox, get started.

Explore Neuro OS →

More from Blog