DEV Community

Vedhavyas Singareddi
Vedhavyas Singareddi

Posted on

The rules an email agent should never be allowed to break

Two weeks ago I wrote what an email MCP server should never be allowed to do: the argument that the boundary has to live somewhere the model cannot reach. The post drew more than forty comments, and the comments were better than the post. People who build agent tooling and release gates took the rules apart and put them back with the bolts visible. This is the rulebook that came out of it.

The rules are in my words, from the thread's shapes. One person, @eliashivemind, said yes to being quoted, so the release-gate comparisons in rules 1, 2, 8, 9 and 10 are theirs and I have named them here rather than in every line; everyone else stays unnamed, which is what I asked for.

1. A confirmation flag asks the model to remember to be careful

If a tool schema says confirm: true, what you have built is a reminder. The model can skip it, be talked out of it, or pass every check while the thing that matters goes wrong. A boundary that lives in the model's memory is not a boundary.

2. Approval has to be a different door, and the door has to show what the search missed

The queue is the right door: a token can write, and a signed-in session approves, so the token that wrote the message cannot approve it. But a door only works if the person at it can see what the agent saw. If the agent drafted a send from a search that covered only the locally synced window, the approval queue must carry that: which accounts were skipped, how far back the search ran. A human who approves the recipients, subject and body without being told the search was partial has approved a draft whose missing context they never saw was missing.

3. "I did not look there" has to beat confident absence

A search result that renders zero hits as "no such mail" is lying once the mailbox has been reindexed. IMAP makes this concrete: a recreated mailbox gets a new UIDVALIDITY, every cached UID is meaningless, and a search over the old range returns nothing with full confidence. Store the (mailbox, UIDVALIDITY, UIDNEXT) triple next to the results, and answer "unknown" rather than "absent" when the triple no longer matches. Returning explicit coverage and truncation metadata in the result is the cheapest half of rule 2, and it needs no change to the queue at all.

4. A queued send must read as queued, not sent

If the tool result looks like success, the agent will tell the user the mail went out while the draft still waits in the queue. That is the same honesty problem as rule 2, one surface over. A queued send should return something a model cannot read as a send: queued: true, sent: false, status: "awaiting_approval", a pending id and an expiry. Later the token can ask again and see pending, approved (with a sent timestamp once it goes out), rejected, expired, or draft_gone, so it can say "still waiting" rather than guess.

5. Approval binds to the exact draft, and the diff is the unit

Bind the approval to a hash of what was approved: recipients, subject, body, attachments. If the agent edits the draft after it is queued, the approval should be void, not carried over, or the queue protects the first version while the agent sends the second. Show a diff when a queued draft changes. Reply-all and forward are where the usual shape lies: "To: Sarah" reads fine at thirty drafts a day while the quoted thread underneath carries a forwarded attachment or a CC to an outside domain. The diff that matters is new recipients, new domains, and attachments leaving.

6. Push what you can into the schema, and keep the rest on the human door

Some rules belong in the input schema, because a check there runs before anything is queued and does not rely on the model: an attachment count and size cap, a recipient pattern that refuses any address outside a domain. The useful test: if a call can pass every schema check and still cause a change the person cannot see, the check belongs on the human door. A pattern narrows where a call can reach; it cannot decide whether the call should happen.

7. A filter is a standing instruction, not a tool call

A rule that every future message obeys has no single visible, undoable effect. That is a different shape from a tool call, and it should not be reachable as one. If an agent can create a filter, it can change the mailbox's behaviour for every message after the one that was approved.

8. Batch approval turns the queue back into a flag

At fifty drafts a day the human is the bottleneck, and that is the intended failure. The alternative is a boundary that disappears under volume. The answer is better triage, not batch approval: grouping drafts by what they answer turns a review pass into minutes. An approve-all button turns the approval back into a confirmation flag, which is rule 1 again.

9. A risk flag sits above the groups and blocks itself, not the queue

Grouping is a reading aid. A flag that rides inside a familiar group inherits the group's familiarity, which is the summary leading the details. A draft from an unfamiliar recipient should sit in its own bucket above the groups, read first, and no approve-all may sweep it up. It blocks itself, not the queue: freezing the whole queue for one flag teaches people to clear the blocker blind, which is worse than the risk it was guarding.

10. Escalate with numbers; do not invent a block

When a pattern trips, for example an account that drafted to N new recipients in M days, escalate rather than block. A block needs a rule for what unblocks it, and that rule would be a guess wearing a threshold's clothes. An escalation that carries the count in front of the draft tells the person what they are looking at and leaves the decision where it already is. A bare warning trains people to click through it the way they click through every other banner.

11. A wrong archive can be undone; a sent message cannot

That one sentence sorts the rest. Archive, pin, move, filter suggestions: reversible, so an agent can do them directly and a mistake costs a restore. Send: irreversible, so it goes through the queue. Every rule above is an application of that ordering.

The stronger form of the same rule: leave the irreversible action out of the tool list entirely. An agent cannot choose by mistake what it was never given, and marking done or archiving keeps it inside what a restore can undo. A write that lands where the person already looks (a plain file, the file system itself) needs no separate approval window, because visibility is the store; mail has no equivalent, so the approval queue stands in for it.

What I have not built

Some of this is built in Busymail: the scoped tokens, the separate approval door, the queued-not-sent result and the caps on attachment and body size. Five rules are not fully built, and the thread spent the most words on the first: the queue does not carry the search coverage behind a draft. The search result tells the agent what it covered; the queue shows the draft. Until the provenance arrives at the queue from the tool that ran the search, a person can approve a draft whose missing context they never saw. Rule 3's triple is not carried beside results either: deep-search hits are ephemeral and carry a folder and a UID only; no UIDVALIDITY or UIDNEXT is stored beside them, and the action paths check a UID against a vouch instead, which is a different mechanism, so a result cannot tell the agent whether the mailbox was recreated. The queue does not hash or freeze a draft either: it re-reads the message at render and again immediately before sending, so an edit made in another mail client does not void the approval, it is what gets approved. Its unfamiliar-recipient warning is a yes or no, with no count and no window. And rule 9's flag sits on each card, because the queue has no groups. The rules above are still the standard I would hold any email agent to, built or not, and I would rather say what is missing than leave the rulebook looking finished.

One page, if you want it beside your own tooling: the eleven rules as a checklist.

If you build agent tools, treat this as a checklist rather than a badge. If you want to see the queue from the inside, the setup is at busymail.app/mcp-setup and the trial starts at busymail.app/signup. The first post and its thread are here.

Top comments (0)