AI Email Agent: Give One a Real Inbox It Can Send and Receive From
The infrastructure an AI email agent actually needs — its own inbox, replies as events, and a firewall on both directions.
An agent that only sends is half an agent
The moment an AI email agent does anything real — confirms a booking, chases an invoice, answers a support thread — it has to read the reply. That is where a plain send API runs out: you end up writing an IMAP loop, an OAuth refresh, a MIME parser and your own threading, none of which belongs in an agent runtime.
Give the agent an identity instead. It gets a sending address and a receiving address, and inbound arrives as an event shaped like every other event your code already consumes:
import { createClient } from "@mailsai/sdk" ;
const mails = createClient();
// Sending: no agent to pre-create, no domain to verify, no DNS.
await mails. send({
from: "hello",
to: "customer@example.com" ,
subject: "Your invoice #221 is ready",
body: "Invoice #221 for March is attached, due the 30th.",
});
// Receiving: replies arrive as typed events, already threaded and scanned.
mails. agent( "hello"). onReply(( event) => {
// Hold for a person: quarantined, not scanned (no score), or 0.5 and up
if ( event. quarantined || typeof event. injection_score !== "number" || event. injection_score >= 0.5) {
return flagForReview( event);
}
if ( event. source_message_id) {
mails. messages. reply( event. source_message_id, { body: answer( event) });
}
});Two boundaries, both enforced by the API
An agent with email is exposed in both directions, and a prompt is not a control. Inbound, anything it reads is untrusted input that may be trying to redirect it — so every message carries an injection_score and its flagged categories, and scores of 0.95 or above arrive flagged quarantined. Outbound, an agent that is talked into prospecting would spend a sending reputation it did not build — so cold and bulk mail is refused in the send call, with a reason the agent can read and a second review if the verdict looks wrong.
Reputation is scored per agent, not per account. One misbehaving agent auto-suspends at a 0.3% complaint rate, before the upstream provider’s 0.5% threshold ever sees it, and your other agents keep sending unless the workspace’s mail as a whole crosses the line too.
What it costs to run one
Free covers 3,000 emails and 3,000 inbound replies a month with one agent and no card. Beyond that, Pro is $20 a month for 50,000 emails and 50,000 inbound replies across five agents, and Scale is $99 for 250,000 emails and 500,000 inbound replies with unlimited agents. Parsing and the injection scan come with every inbound, and intent/entity classification of first-contact mail is opt-in on paid plans at no extra charge when you want routing decided before the model runs. For the operational layer above individual agents — routing, classification, reputation monitoring — see AI email management.
Frequently asked questions
Why can’t I just use a normal email API for my agent?
What stops the agent from being manipulated by an email it reads?
Can the agent reply in the same thread?
What if my agent tries to send cold outreach?
cold_email_prohibited and nothing is transmitted. That is deliberate and it is not configurable, because a shared sending estate only stays deliverable if nobody on it can send cold mail. Transactional mail — confirmations, receipts, codes, notifications, genuine replies — passes.How do I test it without emailing anyone?
Explore the product
Give your first agent an inbox
Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.
Get your API key