Email deliverability for AI agents

Agent email lands when it comes from a domain with SPF, DKIM and DMARC, goes to addresses that exist and expect it, leaves at a steady and modest pace and draws few spam reports. Agents add risks of their own: guessed addresses, reply loops and retried sends. Your code should stop all three.

Updated

What decides whether an agent's email lands?

  • Authentication. Can the receiver tell the mail came from your domain?
  • Reputation. How your domain and sending addresses behaved before.
  • Spam reports. How often recipients press the button.
  • Bounces. How often you write to addresses that do not exist.
  • The message. An honest sender and subject, and content the recipient expects.

The receiver makes the final call. You control what it has to judge.

Which DNS records does an agent's domain need?

SPF lists who may send for the domain, DKIM signs each message, and DMARC ties both to the From address. SPF, DKIM and DMARC has sample records. Check what is published:

shell
dig +short TXT agents.trotta.io          # SPF: a line that starts v=spf1
dig +short TXT _dmarc.agents.trotta.io   # DMARC: starts v=DMARC1

The DKIM key sits at selector._domainkey under your domain, and your mail service names the selector. A subdomain for agents keeps their mail easy to tell apart and to switch off.

What do Gmail and Outlook.com require from senders?

RuleGmail, every senderGmail, over 5,000 a dayOutlook.com, 5,000 or more
AuthenticationSPF or DKIMSPF, DKIM and DMARCSPF and DKIM both pass, with DMARC
From alignmentNot listedSPF or DKIM domain matches FromSPF or DKIM domain matches From
Reverse DNS and TLSRequiredRequiredNot on the page cited
Spam rate in Postmaster ToolsBelow 0.3%Below 0.3%Not on the page cited
One-click unsubscribeNot listedMarketing and subscribed mailNot on the page cited

Gmail's rules cover mail to personal Gmail accounts. Microsoft's cover high volume senders to its consumer mail services, which refuse failing mail with 550 5.7.515. Google also advises a consistent rate without bursts, and raising volume slowly.

What goes wrong with AI agents in particular?

RiskWhat happensControl in code
Guessed addressesBounces pile upWrite to addresses you were given or that wrote to you
Reply loopsTwo autoresponders answer each other all nightDo not auto-answer automated mail, and cap replies per thread
RetriesA timeout and a retry send twiceOne idempotency key per task and recipient
BurstsA quiet domain suddenly sends a floodA daily cap well under the provider's
Fake repliesRe: on a new message misleadsNever add it. Gmail's guidelines say so
Ignored opt-outsSpam reportsStore each one and check it before every send

RFC 3834 says automatic responses should not answer a message whose Auto-Submitted header has any value other than no. On Trotta Mail, check extracted.is_automated before an agent replies.

How should an agent send so a retry is harmless?

Derive the key from the task, not from the wording. A model rarely writes the same text twice, and the server answers 409 idempotency_key_reused instead of sending a second version.

send_once.py, with pip install trottamail
import hashlib

from trottamail import TrottaMail, TrottaMailError

mail = TrottaMail()  # reads TROTTA_MAIL_API_KEY


def send_once(inbox_id, task_id, to, subject, text):
    key = hashlib.sha256(f"{task_id}:{to}".encode()).hexdigest()  # same task, same key
    try:
        msg = mail.messages.send(inbox_id, to=to, subject=subject, text=text, idempotency_key=key)
    except TrottaMailError as err:
        if err.code == "idempotency_key_reused":
            return "already sent for this task"  # a retry with different wording
        if err.code == "recipient_suppressed":
            return "do not write to this address"
        raise
    if msg["status"] == "pending_approval":
        return "waiting for a human"
    return msg["delivery"]["state"] if msg["delivery"] else msg["status"]

Run locally, a repeat returned the original message, a reworded repeat was refused, and a first contact under approval waited for a human.

What should happen when mail bounces or is reported?

Stop writing to that address, and find out where it came from. A rising bounce rate usually means a bad source of addresses. A spam report means the recipient did not expect you. Slow down before you try anything else.

What does Trotta Mail do about deliverability?

These rules for mail to outside addresses come from the API reference. Mail between Trotta Mail inboxes is not subject to the warm-up or own domain limits.

AreaWhat happens
Your own domainUntil its sending records are published and seen, outside sends answer 409 own_domain_outside_not_open
Unclaimed agentsReplies only
New Free organizations3 new outside addresses to start conversations with in the first 24 hours
Warm-upDaily caps on outside recipients while the sending service warms up: 429 sending_warming_up
Daily caps50 unclaimed, 100 Free, 1,000 Developer, 10,000 Startup, counted by recipient
Dead addresses and complaintsThey join your suppression list, and later sends answer 409 recipient_suppressed
Too many complaintsOutside sending pauses: 403 outside_sending_paused
Outcomesdelivery.state per message, and message.bounced and message.complained events
Outbound screeningMail is checked before it leaves, and held mail waits for a human

The send call has no field for custom headers such as List-Unsubscribe, so it is not the tool for bulk marketing mail. Consent, content and list quality stay with you. Your own domain needs a paid plan: see custom domain email for agents.

Questions

Why do my AI agent's emails go to spam?

Check authentication first, then who you are writing to. Unaligned mail, recipients who never asked and sudden bursts are common causes.

How many emails can an agent send in a day?

As many as your provider's cap and your reputation allow. On Trotta Mail the daily caps are 100 on Free, 1,000 on Developer and 10,000 on Startup.

Does a new domain need warming up?

Yes, in the sense that volume should grow slowly. Google warns that sudden spikes from a sender without that history can lead to rate limits or reputation drops.

Can an agent send cold outreach?

Rules differ by country, so check the law that applies to you. Gmail asks senders to write only to recipients who want the mail.

Sources

Give your agent an inbox of its own. Free for three agent inboxes and you. No card.