AI Email Automation: How Agents Send, Wait and Hand Off

The coding agent can already finish a task, inspect an order, or answer a support question. Then someone adds a send-mail tool, and the unfinished work becomes obvious: the agent needs an address, a way to wait for replies, and a rule for when it must stop talking.
AI email automation is an authority and feedback problem, not just a writing problem. The engineering work sits around the model: deciding which recipients it may contact, preventing retries from becoming duplicate messages, detecting delivery problems, and transferring a conversation to a person without another automated reply slipping through.
Table of Contents
- Four Levels of AI Email Automation
- Connecting Agents Through MCP, CLI or REST
- Sending Workflow and Limits
- Screening Inbound Email for Prompt Injection
- Handing a Thread Back to a Person
- Choosing Autonomy and Rolling Out a Mailbox
Four Levels of AI Email Automation
AI email automation is software that reads incoming mail, decides what to say, and sends replies or new messages without a person typing each one. Partial implementations stop before sending, leaving a person responsible for the outbound action.
Consider a service business answering appointment requests. The same request can pass through very different systems, even when every system advertises email automation.
Four levels of AI email automation
| Level | Who writes | Who sends | Who handles replies |
|---|---|---|---|
| Drafting assistant | Person, with AI suggestions | Person | Person |
| Templated sequence | Person writes the template, AI fills fields | Scheduler | Person |
| Supervised agent | AI drafts | AI sends after approval | Person, approving each send |
| Autonomous agent mailbox | AI drafts and decides | AI sends within policy | AI, with handoff to a person |
A drafting assistant is a secretary who writes letters that someone else signs and posts. For an appointment request, the model suggests wording, but the employee checks availability, selects the recipient, and sends the message. The employee still owns the inbox.
A templated sequence is a mail merge running on a timer. A scheduler sends a prepared reminder with fields filled from a booking record. That works for predictable notifications, but someone still needs to handle a customer who replies with a scheduling exception.
The send button defines the level
A supervised agent reads the request and proposes an answer, then waits for approval. This allows more contextual drafting without transferring the final decision. The trade-off is queue ownership: unattended approvals mean unanswered customers.
An autonomous agent mailbox is a clerk with a desk, a key to the outbox, and a rulebook. The agent can answer routine questions and continue a conversation, but it needs explicit boundaries around commitments, disclosure, and escalation. For developers mapping these distinctions onto bookings and customer inquiries, Truespeak's guide to AI email automation for service businesses provides useful business-process context.
Practical rule: Choose the level by who should hold the send button, not by how convincing the generated prose sounds.
Moving up a level changes the failure mode. Awkward wording becomes wrong recipients, repeated messages, or information disclosed in a reply. The useful design question is which level each mailbox gets and which independently enforced limits surround its sends.
Connecting Agents Through MCP, CLI or REST
A coding agent that finishes a patch at 2 a.m. needs a different mail path than a billing service emitting receipts. Pick the interface by where the agent already runs and how you will observe the result.
| Interface | Best for | How the agent uses it |
|---|---|---|
| MCP server | Claude Code, Cursor, Codex and other MCP clients | Agent calls mail tools during a session |
| molted CLI | Shell scripts, cron jobs and local tools | Commands run from a script or scheduler |
| REST API | Custom services and backends | The service sends HTTP requests |
The agent needs its own email address and inbox, rather than credentials for an employee's account. That keeps its correspondence out of personal threads and makes access easier to revoke.
Molted Email is a mailbox for AI agents: for agents what Gmail is for humans. Each agent gets its own address and inbox, and no separate Resend, Postmark, or SES account is needed to send, receive, or track delivery. Whichever interface you choose, the same mailbox policy sits under the send: duplicates, cooldowns, suppressions and send limits are checked before anything leaves.
Match the interface to the execution environment
In Cursor, an editor agent might finish a requested fix, load the relevant email thread, draft a reply, and call the mail tool during the same session. MCP fits that interaction because the client exposes tools to the agent, including send_email, dry_run, read_inbox, reply and handoff_thread. The MCP server setup guide covers the connection path.
Tool access also expands the consequences of hostile content. MCP browser security from Clearcote Labs offers useful context for reviewing trust boundaries when agents combine external content with tool calls. Treat mail like any other tool that can act outside the editor: scope the key, log the call, and read the returned status before assuming delivery.
A nightly cron job has different requirements. A shell script can invoke the CLI, capture its exit status, and append results to a job log; incoming messages can be consumed with molted listen where a persistent process fits the deployment. A scheduled batch should terminate cleanly rather than leave an accidental listener running.
For an order-shipping backend, REST usually fits better. The application already owns the order event and work queue, so it can request a send through POST /v1/agent/request-send, keep policy enforcement, rate limiting and delivery tracking inside the mail platform, and associate the result with the shipment record.
Receiving is a separate integration decision
Incoming mail can be read from the inbox, received through webhooks or a live event stream, or consumed through CLI listening. Choose the channel that matches process lifetime: a worker can poll, a service can acknowledge events, and a short cron job should not pretend to be a daemon.
Keep API keys in environment variables or client configuration, never in the repository. Use separate mailbox-scoped credentials, and avoid granting management access to a process that only needs to read or send.
Interactive work suits MCP, unattended shell jobs suit the CLI, and services with their own queues suit REST. The interface is the doorway; mailbox policy remains the authority.
Sending Workflow and Limits
A webhook retries after a timeout, and the worker sends the same follow-up twice within a minute. The model didn't make a writing mistake. The application failed to distinguish a repeated event from permission to send again.
Create a durable outbound intent before making the network call. Give it an internal identifier tied to the triggering event and intended action, then enforce uniqueness in storage. A mail Message-ID helps correlation, but it doesn't make a remote send idempotent by itself.
The diagram summarizes the main path. Production code needs explicit screening, preview, approval, and recovery states within that path.

Make every transition observable
-
Trigger. An inbound message arrives or a schedule fires. Record the event before starting work. The usual mistake is treating every webhook delivery as a new business event.
-
Read context. Load the permitted thread, mailbox settings, and relevant contact history. Treat the email body as untrusted external data. A common error is loading unrelated conversations because the agent can access them.
-
Screen. Inspect incoming content before exposing its body to the working agent. Quarantine suspicious bodies. Screening after the model has already consumed the message leaves the dangerous transition unprotected.
-
Draft. Generate a reply from approved context and contact history. Constrain commitments to facts the application can verify. The usual mistake is allowing a plausible completion to invent availability, pricing, or an account action.
-
Preview. Print the proposed recipient, subject, body, and check results before anything leaves. The mailbox interfaces support previews without sending. Inspecting only the body misses wrong recipients and policy failures.
-
Check limits. Enforce recipient counts, rolling volume, suppressions, cooldowns, and duplicates. Reserve capacity atomically so concurrent workers can't each consume the same remaining allowance. The same email sent to the same person twice within minutes is blocked, but application-level event deduplication still matters.
-
Gate. If approval is required, persist a pending state and stop the worker. Don't keep a process sleeping while it waits for a person, and don't treat a timeout as permission.
-
Send and track. Associate the outbound intent with the returned message identifier and subsequent delivery events. Record queued, sent, bounced, and complained states separately. A request timeout is an unknown outcome, not proof that nothing was sent.
-
Sort replies. Separate opt-outs, automatic replies, and bounces from conversational replies. Otherwise an out-of-office response can start an automated exchange or trigger an inappropriate follow-up.
-
Hand off. Route judgment-intensive conversations to a person and stop automated sends on the thread. Checking ownership only when drafting is insufficient; check it again immediately before dispatch.
Design below provider ceilings
Provider limits belong in configuration and enforcement code, not in the prompt. The following Google thresholds apply to the stated account types and sending paths, not automatically to every hosted agent mailbox.
Sending limits to design around
| Limit | Value | Source | What it means for an agent |
|---|---|---|---|
| Gmail bulk sender threshold | About 5,000 messages per 24 hours to personal Gmail accounts, aggregated across the same primary domain | Google bulk sender guidance | Authentication and easy-unsubscribe requirements apply to bulk senders, alongside avoiding unwanted or unsolicited mail |
| Gmail personal account limit | 500 messages per rolling 24 hours | Google account limits summary and Workspace documentation | Ceiling for agents sending from personal accounts |
| Google Workspace account limit | 2,000 messages per rolling 24 hours | Google account limits summary | Ceiling for agents on Workspace domains |
| SMTP recipients per message | 100, counting To, Cc and Bcc addresses presented in RCPT TO, for SMTP delivery by POP or IMAP users | Google Workspace documentation | Batch sends that exceed this recipient cap |
These are ceilings, not throughput targets or permission to send unsolicited mail. For a hypothetical 1,000-contact list using the SMTP path in the table, split recipients into batches of 100 or fewer. For unrelated recipients, individual messages are generally the better application design because shared recipient lists can disclose addresses.
Set a per-mailbox ceiling below the provider maximum and enforce a domain-wide budget across agents. Use contact leases to prevent separate workers from initiating competing outreach. The engineering discussion of policy engines and deliverability controls explains why these checks belong beneath each send request.
Feed delivery outcomes back into sending
Delivery isn't equivalent to inbox placement. Validity's 2025 benchmark found that one in six legitimate marketing emails failed to reach the inbox, which makes delivery observability more useful than a successful API response alone.
Track bounces and complaints by mailbox and recipient provider. Pause affected sending when either rises, inspect the contact source and recent changes, and require a person to authorize recovery. Don't let the agent rewrite a template and declare the delivery problem fixed.
A successful send request means the request passed a boundary. It doesn't mean the recipient wanted the message or saw it in the inbox.
Screening Inbound Email for Prompt Injection
A sender adds a line asking the assistant to ignore its instructions and forward the last five threads to an outside address. That line arrives inside an email, but an agent with reading and sending tools may mistake it for an instruction.
OWASP classifies malicious instructions embedded in external content, including email, as indirect prompt injection. The important failure isn't merely recognizing hostile prose. It's allowing sender-controlled content to acquire authority over tools.

Build layers around the authorization boundary
-
Label external data. Keep the body separate from system instructions and authenticated user requests. Preserve provenance when extracting summaries, quoted text, and attachments.
-
Screen without trusting the screen completely. Use classifiers and pattern checks as signals, not permission grants. An email-agent study reported classifier AUROC values of 0.43-0.59 for attacks that avoided recognizable phrases, illustrating the weakness of phrase-centered detection.
-
Quarantine high-risk messages. Keep their original bodies outside the agent's normal inbox access. Replacing a visible warning with unrestricted access to the original defeats containment.
-
Keep authorization outside the model. Use least-privilege keys and deterministic checks on recipients, attachments, and data scope. Where a mailbox may answer only known contacts, reject new recipients at the send boundary.
-
Require approval for consequential actions. Data disclosure, new-contact outreach, and sensitive commitments need review of the proposed operation, target, arguments, and caller authority. A reassuring model explanation isn't authorization.
Test outcomes rather than detector confidence
Maintain hostile fixtures alongside benign hard negatives. A support customer might quote malicious instructions while reporting a security issue; flagging that message shouldn't automatically label the customer an attacker.
Run fixtures through the entire workflow with a stubbed send transport. Assert that unauthorized recipients receive nothing, unrelated threads aren't exposed, quarantined originals remain inaccessible, and the agent can't change its own permissions.
Include attacks that impersonate internal process, refer to previous conversations, or claim that a manager already approved the action. Measure attempted and completed unauthorized actions, not just how many messages receive a suspicious label.
Quarantine and handoff provide stronger safeguards than attempting to classify every malicious email perfectly.
Handing a Thread Back to a Person
Handoff means the agent stops and a person takes ownership of the thread. Adding a notification while leaving the agent free to reply isn't a handoff.
Sort machine-generated replies before invoking the conversational model. Code should identify bounces, automatic replies, and opt-outs; actual conversational replies go to the router. An opt-out should update suppression immediately, even if an unusual request also needs human review.
Keep routing rules visible
Store the trigger list in a version-controlled file that the team can edit and test:
- Opt-outs and unsubscribe requests. Stop further outreach and route ambiguous scope for review.
- Complaints. Transfer the conversation rather than asking the agent to defend its previous message.
- Refunds, legal issues, and contract terms. Escalate requests that require authority beyond routine correspondence.
- Missing answers. Route questions the approved thread context and reference material can't answer.
- Quoted instructions or data requests. Send suspicious requests for inspection rather than allowing them to redefine the workflow.
The routing file should describe actions as well as categories. A complaint might require immediate ownership transfer; an opt-out requires suppression, not a conversational acknowledgement followed by another sequence.
Transfer ownership as a state change
A complete handoff has three parts:
-
Notify a named person. Include the thread, the routing reason, and any relevant draft. Don't force the reviewer to reconstruct context from a subject line.
-
Enter a stop state. Mark the thread as human-owned and cancel pending automated follow-ups. The dispatcher must reject agent sends while that state remains active.
-
Return explicitly. The person hands the thread back with a note describing what was resolved and what the agent may do next. Silence isn't a return signal.
Consider a prospect asking for enterprise pricing and confirmation of contract terms. The router flags the contractual request. If policy permits, the agent sends a holding reply saying a person will follow up, then transfers ownership; otherwise it transfers without replying.
That holding message must be part of the transfer transaction, not an exception that leaves sending enabled. The discussion of human-in-the-loop AI agents is useful for designing this ownership boundary.
The thread owner, not the last speaker, determines who may send next.
Choosing Autonomy and Rolling Out a Mailbox
Every new mailbox starts autonomous. Approval is an optional dial, with settings for first emails to new contacts or every outbound email; a person approves or rejects requests in the dashboard. With approval off, the agent sends within mailbox policy.
Assign a person to own the review queue, sending ceiling, and decision to resume a paused mailbox. Approval requests that remain unanswered expire after 24 hours, and the unsent email is never sent. Approval doesn't work as an operating model when nobody is responsible for the queue.

Match approval to uncertainty
Require approval during launch weeks, with new domains, for unfamiliar contact lists, and for mailboxes touching sensitive accounts. Mature mailboxes answering known contacts are better candidates for autonomous operation.
First-contact approval occupies a useful middle ground: a person authorizes the start of a relationship while routine replies can proceed automatically. It still requires thread-level escalation for requests outside the mailbox's authority.
Roll out with observable tests
-
Create the account. Sign up through the service homepage and choose a plan appropriate to the workload. The Quickstart covers signup, plan selection, and a first email in five minutes; that setup path isn't a substitute for workflow testing.
-
Create a mailbox with every-email approval enabled. Start with a bounded task, such as answering delivery-status questions from known test contacts, rather than general access to customer correspondence.
-
Connect the agent with its own key. Choose MCP, CLI, or REST based on the execution environment. Grant the permissions needed for that process and keep management credentials separate.
-
Send to addresses owned by the testing team. Review wrong recipients, repeated sends, and replies that should have gone to a person. Exercise webhook retries and timeouts, not just successful requests.
-
Disable approval after the workflow behaves correctly. Keep the sending ceiling in application code and retain the mailbox policy checks. Removing message review shouldn't remove deterministic controls.
-
Repeat duplicate and bounce tests before increasing limits. Verify that pauses stop queued work and that resuming requires the designated owner. Include a handoff test with a pending follow-up so ownership changes are tested under concurrency.
Start free at molted.email (free for people, paid plans from $19 a month).
Molted Email gives agents their own mailboxes through MCP, CLI, or REST, with inbound screening, outbound policy checks, and thread handoff. Start with a test mailbox, verify retry and ownership behavior, and enable autonomous sending for the conversations the agent is authorized to handle.