Skip to content
Claim your free business email
AI and agents

AI agent email address: give your agent one that sends and receives

The short answer

An AI agent has its own email address when it has a mailbox on a domain you control that both sends and receives. Verify the domain, turn receiving on, add a shared address such as assistant@yourdomain, then let your code hear about each message from a webhook and answer through the API inside the same thread.

By Rasket TeamLast updated 9 min read

Written for AI automation builders and developers

What does an agent's own email address mean?

It means an address the agent answers for, like assistant@ai.acme.example, that does both halves of email: it sends from that address, and mail written to that address reaches the agent. A send-only API covers the first half. The second half needs a server that accepts mail for your domain, keeps it, and tells your code when something arrives.

Email also has a third part that is easy to miss: the thread. A person who answers expects the reply to land under their message, not as a new one. Mail clients join messages with two headers, In-Reply-To and References, which carry the identifiers of the messages being answered.[1] An agent that replies without them starts a new conversation every time.

On Rasket the agent's address is a shared channel in the Inbox. Mail to it is stored as conversations, threaded on those headers and never on the subject line. Your code hears about each message from a signed webhook, reads the conversation over the Inbox API, and replies from the channel's own address. Sending, receiving and the inbox are one API and one key.

What you need before you start

  • A domain you control. A subdomain kept for agents, such as ai.acme.example, is the easy choice: its mail records do not touch the mailboxes your company already runs on acme.example.
  • A team admin. Channels are created by an admin in Settings, and so is an API key's Inbox access. There is no API call that creates an address.
  • An API key with Full access, and Inbox access set to Read and reply. Every key starts with no Inbox access at all, whatever else it may do.
  • A public HTTPS endpoint for the webhook, and the rasket package (npm install rasket). Every step below also works as a plain HTTPS request.
The client every sample below uses
import { Rasket } from "rasket";

// A key with Full access and Inbox access "Read and reply" (set by an admin under API keys).
export const rasket = new Rasket({ apiKey: process.env.RASKET_API_KEY ?? "" });

Set up the address in five steps

  1. Create a domain that sends and receives

    Call POST /domains with sending and receiving both enabled, in a region that receives. A subdomain kept for agents leaves your other mailboxes alone.

  2. Publish the records and verify

    Add the signing, sending and MX records the response lists at your DNS host, then call POST /domains/{domain_id}/verify until it passes.

  3. Add a shared channel for the agent

    A team admin creates the address, such as assistant@ai.acme.example, in Settings and leaves it open to the whole team.

  4. Give a key Inbox access and subscribe a webhook

    An admin sets the key's Inbox access to Read and reply, and the key subscribes a webhook endpoint to inbox.message.received.

  5. Read each conversation and reply from the channel

    On each event, read the conversation it names, hand the thread to your model, and answer with POST /inbox/conversations/{conversation_id}/reply.

Steps one and two are code. Step three is a click in Settings, because a channel is an address your whole team owns and an admin decides who reads it. Receiving works in two regions, United States (East) and Ireland, so create the domain in one of them.

Create a domain that sends and receives
// One domain that sends and receives. A subdomain kept for agents leaves your
// company's own mailboxes on acme.example exactly where they are.
const { body: domain } = await rasket.domains.create({
  name: "ai.acme.example",
  region: "us-east-1",
  capabilities: { sending: "enabled", receiving: "enabled" },
});

console.log(domain.records); // publish these at your DNS host, then:
await rasket.domains.verify(domain.id);
The same request without the SDK
curl -X POST https://api.rasket.com/domains \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"ai.acme.example","region":"us-east-1",
       "capabilities":{"sending":"enabled","receiving":"enabled"}}'

The response lists the DNS records to publish: the signing and sending records, and one MX record for receiving. Verification checks them, and it can be called again until it passes. Once the domain is verified, an admin adds the channel in Settings at assistant@ai.acme.example and leaves it open to the whole team. A channel narrowed to named people fires no webhook and is out of the MCP tools, and only a key limited to it can read it.

Receive: hear about each message

Do not poll. Subscribe a webhook to inbox.message.received and Rasket calls your endpoint each time a message lands in a conversation, the first message of a new one included. Mail filed in Spam sends nothing.

Subscribe a webhook to new Inbox messages
// Tell Rasket where to report new mail. The secret is shown in full once: store it.
const { body: hook } = await rasket.webhooks.create({
  endpoint: "https://agent.acme.example.com/hooks/rasket",
  events: ["inbox.message.received"],
});

console.log(hook.signing_secret); // save as RASKET_WEBHOOK_SECRET

The event names the conversation, the message, the channel and the sender, and carries no message text. That is on purpose: a webhook is retried until your endpoint accepts it, and a body in every retry is the content of someone's email travelling more often than it needs to. Check the signature on the raw body before you trust anything in it, then hand the work to a queue and answer quickly.

The webhook handler: verify, filter, queue
import { rasket } from "./rasket";
import { enqueue } from "./queue"; // your job queue

/** The part of an inbox.* event this handler reads. The payload never carries the message text. */
interface InboxEvent {
  readonly type: string;
  readonly data: {
    readonly conversation_id: string;
    readonly message_id: string;
    readonly channel: { readonly address: string };
  };
}

export async function POST(request: Request): Promise<Response> {
  let event: InboxEvent;
  try {
    // The raw body, exactly as it arrived: a parsed and re-serialised body fails the check.
    event = rasket.webhooks.verify(
      await request.text(),
      request.headers,
      process.env.RASKET_WEBHOOK_SECRET ?? "",
    ) as InboxEvent;
  } catch {
    return new Response("invalid signature", { status: 400 });
  }

  if (event.type !== "inbox.message.received") return new Response(null, { status: 204 });
  if (event.data.channel.address !== "assistant@ai.acme.example") return new Response(null, { status: 204 });

  // Answer outside the request: a model can take longer than a webhook waits.
  await enqueue({ conversationId: event.data.conversation_id, messageId: event.data.message_id });
  return new Response(null, { status: 200 });
}

Reply inside the thread

The worker reads the conversation, which holds its newest messages and the customer, finds the message the event named, and gives the thread to your model. The reply goes out from the channel's own address and keeps the thread on the customer's side as well.

The worker: read the thread, check it, answer it
import { rasket } from "./rasket";
import { draftAnswer } from "./model"; // your model call: messages in, text out

export async function answer(conversationId: string, messageId: string): Promise<void> {
  const { body: thread } = await rasket.inbox.conversations.get(conversationId);
  const incoming = thread.messages.find((message) => message.id === messageId);
  if (incoming === undefined || incoming.direction !== "inbound") return;

  // RFC 3834: never answer a message another program sent on its own.
  if (incoming.received_email_id !== null) {
    const { body: original } = await rasket.emails.receiving.get(incoming.received_email_id);
    const autoSubmitted = Object.entries(original.headers ?? {}).find(
      ([name]) => name.toLowerCase() === "auto-submitted",
    )?.[1];
    if (autoSubmitted !== undefined && String(autoSubmitted).toLowerCase() !== "no") return;
  }

  const text = await draftAnswer(thread.messages);

  await rasket.inbox.conversations.reply(
    thread.id,
    { text, status: "pending", latest_message_id: messageId },
    { idempotencyKey: `reply-${messageId}` },
  );
}

Three details in that call do real work. latest_message_id refuses the reply with a 409 if a newer message arrived while the model was writing, so the agent never answers a question the customer has already changed. The idempotency key makes a retried job send once. And status: "pending" marks the conversation as waiting on the customer, so a person looking at the Inbox sees what the agent has handled.

The same reply without the SDK
curl -X POST https://api.rasket.com/inbox/conversations/$CONVERSATION_ID/reply \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "Idempotency-Key: reply-$MESSAGE_ID" \
  -H "Content-Type: application/json" \
  -d '{"text":"Thanks, the refund is on its way.","status":"pending",
       "latest_message_id":"'"$MESSAGE_ID"'"}'
What an agent's reply counts against
LimitHow it applies
Your plan's monthly email allowanceOne reply is one email
Replies from one API key60 an hour
Your suppression listA suppressed address is not written to
The verified-domain ruleThe channel must be on a verified sending domain

Let the agent write first

An agent that only answers is half an assistant. To start a conversation, send from the channel's address and name the channel in inbox: the email goes out with the channel as its reply address, and the customer's answer opens a conversation linked to the email it answers, which fires the same webhook.

Send the first message from the agent's address
// The agent writes first. Naming the channel in `inbox` makes the answer a conversation.
await rasket.emails.send(
  {
    from: "Acme Assistant <assistant@ai.acme.example>",
    to: ["ronald.williams@example.com"],
    subject: "Your order 1042 has shipped",
    text: "It left our warehouse this morning. Reply here with any question.",
    inbox: "assistant@ai.acme.example",
  },
  { idempotencyKey: "order-1042-shipped" },
);

Read the email back later and its inbox.conversation_id names that conversation once the customer has replied, and is null until then.

Guardrails an email agent needs

Anyone on the internet can write to an address. That is the point of email, and it is what makes an email agent harder to run safely than a chat bot.

  • Never answer a machine. Out-of-office replies, bounces and mailing lists write back on their own. RFC 3834 says automatic responses should not be sent to a message that carries an Auto-Submitted header, and that header is how one program marks mail it sent by itself.[2] The worker above checks it. Two agents that skip the check can answer each other until a limit stops them.
  • Treat the message as data. Text in an email can be written to steer your model. OWASP calls this indirect prompt injection: a model taking input from an outside source, such as a website or a file.[3] Keep the instructions in your system prompt, put the email in a clearly marked block, and do not give the agent tools it does not need while it reads untrusted mail.
  • Keep a person on the risky sends. OWASP's mitigations include giving the model the least access it needs and human approval for privileged actions.[3] On Rasket, an assistant connected over MCP can leave its answer in a person's drafts with save_reply_draft, and its own send shows a preview before anything leaves.
  • Let the limits stand. Sixty replies an hour per key, your daily send cap and your suppression list all apply to the agent exactly as they apply to your own code. A stuck loop hits a ceiling instead of a customer's inbox.

Before you have a domain

Every team is given a managed receiving address on our domain the day it is created, and any name before the at sign reaches you. An agent can read mail sent there with GET /emails/receiving, or hear about it from an email.received webhook, on the first day.

It cannot send from it. The domain and its reputation are ours, so the managed address receives and never sends, and the agent's replies need a domain you have verified. Treat the managed address as a way to start building, and move the agent to its own channel before anyone outside your team writes to it.

When MCP is the better fit

Everything above is your code calling the API, with a key it holds. If the agent is an assistant such as Claude, ChatGPT or Cursor rather than a program you run, connect it to Rasket's MCP server instead. It signs in with OAuth, holds no key, and gets tools that send, read received mail and work the Inbox, limited to the scopes you approve. Connecting an assistant to email with MCP covers each client, and letting an agent send email with MCP builds an agent loop with a person approving each send.

Choosing a provider for this? How Rasket compares with a dedicated agent-email service sets the two side by side, row by row, including the rows the other service wins.

Frequently asked questions

Can an AI agent have its own email address?

Yes. On Rasket it is a shared channel, such as assistant@ai.acme.example, on a domain you have verified for sending and receiving. The agent sends from it, hears about every message to it from a signed webhook, and replies inside the thread over the Inbox API.

Can I create the agent's address with an API call?

No. A team admin creates a channel in Settings, because a channel is an address the whole team owns and the admin decides who reads it. Everything after that, from the webhook to the replies, is done through the API with a key.

Does the agent need a domain of my own?

To send, yes. Every team also has a managed receiving address on our domain where any name before the at sign reaches you, so an agent can read mail on the first day, but that address never sends because the domain and its reputation are ours.

How does the agent know a new email arrived?

A webhook subscribed to inbox.message.received is called each time a message lands in a conversation, including the first message of a new one. The event names the conversation and the message and carries no text, so the agent reads the conversation over the API.

How do I stop the agent replying to out-of-office messages?

Read the message's headers with GET /emails/receiving/{email_id} and skip any message whose Auto-Submitted header is present and not no. RFC 3834 asks automatic responders to do exactly that, and it is what stops two agents answering each other in a loop.

Can a person approve the agent's replies before they go out?

Yes. An assistant connected over MCP can save each answer with save_reply_draft, where it waits in a person's drafts in Rasket Mail to be read and sent. Your own code can do the same by leaving conversations pending for a person instead of replying itself.

What does an agent's reply cost?

A reply is an email. It counts as one message on your plan's monthly allowance and your daily send cap, like a send from your own code, and one API key can send up to 60 replies an hour. Mail the agent receives costs nothing extra.

Sources

3 primary sources, each read on the date shown.

See all sources
  1. 1.RFC 5322: Internet Message Format, section 3.6.4 — IETF,
  2. 2.RFC 3834: Recommendations for Automatic Responses to Electronic Mail — IETF,
  3. 3.LLM01:2025 Prompt Injection — OWASP Gen AI Security Project,

Keep reading

Written by the Rasket Team. First published ; last checked against its sources . See something out of date? How we correct guides.

Send email that earns its place

Authenticated mail, one-click unsubscribe, and campaigns measured apart from your transactional mail, set up in minutes.