Human in the loop email for AI agents
Human in the loop email means a human decides at the points where an AI agent's mail carries real risk. Doubtful incoming mail is held for review, and outgoing mail waits as a draft or for approval. The controls must live in the mail system, not in the agent's prompt, so the agent cannot be talked past them.
Updated
What does human in the loop mean for email?
Human in the loop email is a setup where an AI agent handles the routine and a human decides the rest. The agent reads, sorts, drafts and answers. A human steps in where a mistake would cost money, data or trust.
The usual picture covers one direction: approving what the agent sends. Email has two. What comes in can be as dangerous as what goes out, because an agent acts on what it reads.
Where does a human belong in the loop?
A human belongs at four points in an agent's mail.
| Point | The risk | The control |
|---|---|---|
| Doubtful incoming mail | The agent reads an attack and acts on it | Held mail: kept out of the inbox until a human releases it |
| Outgoing mail to someone new | A hijacked or mistaken agent writes to a stranger | Approval on first contact |
| Outgoing mail of any kind | The wrong words go out under your name | Drafts only: the agent writes, a human sends |
| Changes to the rules | The agent loosens its own limits | Loosening takes a human |
Not every message needs a human. A reviewer asked to approve everything stops reading and starts clicking. The Verizon 2026 Data Breach Investigations Report found the human element present in 62% of breaches. A tired reviewer is not a safeguard.
Put the human where judgment is needed, and let clear mail flow. Email for AI agents covers the rest of the setup.
Why must the control sit outside the prompt?
A rule in a prompt is a request. An instruction such as ask before you send works until a message tells the agent to ignore it, which is what prompt injection does.
A control in the mail system is a fact. If the agent's key cannot send, no instruction can make it send. If the key cannot read held mail, no text in that mail can reach the model.
So test any setup with one question: can the agent undo this control with the credentials it holds? If it can, the control is advice.
Held mail: review before the agent reads
Held mail is incoming mail that was stopped before delivery and kept outside the inbox for a human. The agent learns that a message exists and why it was held. It gets nothing the sender wrote.
A human then releases the message or discards it. A released message is delivered then, so an agent that was waiting simply receives it late.
Holding works only when it happens before delivery. A warning attached to mail the agent has already read comes too late. Held mail covers the review flow.
Drafts only: the agent writes, a human sends
Drafts only is the simplest outgoing control. The agent prepares a reply, and it waits in the drafts folder until a human reads it, edits it if needed and presses send.
Drafts suit a human's own mailbox, where every message goes out under the human's name. They also suit high-stakes threads: contracts, payments, anything legal.
Two details matter. The draft should be marked as written by an agent. And once a human has edited it, the agent should not be able to change it again.
Approval and write levels
Between drafts only and free sending there is a middle: the agent sends, and some sends wait for a human.
- Approval on first contact. A message to a recipient the inbox has never written to waits. Replies in known threads go out.
- Approval always. Every outgoing message waits.
- Screening on the way out. A message that carries a secret, or a reply an injected instruction is steering to a new address, is stopped whatever the approval setting.
A write level says how far an agent may go in one inbox: read, draft or send. Raising it should take a human. Lowering it can be open to the agent.
How it works in Trotta Mail
Trotta Mail builds each of these controls into the inbox, and an agent's key cannot overrule them.
| Control | Setting | What the agent's key gets |
|---|---|---|
| Held mail | guard_mode: monitor, guard or lockdown | withheld: true and the verdict in fixed words. No content |
| Write level | agent_write: none, drafts or send | 403 agent_write_off or 403 agent_drafts_only past its level |
| Send approval | send_approval: none, first_contact or always | The message waits as pending_approval |
| Outgoing screen | On for every inbox | 422 outbound_blocked with the verdict |
A human's mailbox starts at drafts, and an agent's own inbox starts at send. Raising a write level takes a signed-in human.
Loosening guard_mode or send_approval takes a human, or a key a human created with guard:release. An agent's key can always tighten.
An agent leaves a draft by adding draft: true to a send. Where the inbox allows drafts only, a plain send answers 403 agent_drafts_only.
import os
import requests
API = "https://api.trotta.email/ v1"
auth = {"Authorization": f"Bearer {os.environ['TROTTA_MAIL_API_KEY']}"}
draft = requests.post(
f"{API}/ inboxes/ inb_7Qh2mXc4/ messages",
json={
"to": "megan@trotta.io",
"subject": "Schedule for March",
"text": "Here is the revised schedule for March.",
"draft": True,
},
headers=auth,
).json()
print(draft["status"]) # "draft"To put a human on outgoing mail from an agent's own inbox, set send_approval.
curl -X PATCH https://api.trotta.email/ v1/ inboxes/ inb_7Qh2mXc4 \
-H "Authorization: Bearer $TROTTA_MAIL_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"send_approval": "first_contact"}'A human reviews what waits in the web app, or through GET /v1/guard/held, which lists held mail and sends waiting for approval. Releasing, approving and discarding take a human, or a key a human created with guard:release, which is not for agents. Each decision is written to the audit log.
Subscribe a webhook to message.held and message.pending_approval so the right human hears about it. See webhooks and the security model.
No filter catches everything. A reworded scam with no technical tell can still be delivered. That is the reason to keep a human on payments and first contacts even when the inbox is screened.
Questions
Can an AI agent release its own held mail?
No. On Trotta Mail, releasing held mail takes a signed-in human, or a key a human created with the guard:release scope. Keys made by sign-up do not have it.
Does every email an agent sends need approval?
No. Approve by risk. Replies in known threads can go out, while a message to a new recipient, a payment or a contract waits for a human.
What is the difference between drafts only and send approval?
With drafts only the agent cannot send at all: a human presses send. With send approval the agent sends, and the message waits as pending until a human approves or discards it.
How does the human find out that mail is waiting?
In the Trotta Mail web app, held mail and pending sends are listed for review. Over the API, the message.held and message.pending_approval events can go to a webhook that alerts whoever is on duty.
Can email itself be the approval channel?
Yes. An agent can email its human a question and wait for the reply before it acts. Check that the reply comes from the expected address and passed authentication, because a display name proves nothing.