Skip to content
Blog / Engineering

7 Requirements for the Email Layer Under an AI Employee Product

Binoy Perera

Seven things the email layer under an AI employee product has to do: owned inboxes, threads, customer domains, tenant isolation, inbound safety and a full record.

  • engineering
  • ai-employees
  • multi-tenant
  • ai-agents
  • python

TL;DR

An AI employee product sells an agent that customers hire like a coworker, and that coworker needs an email address people can write to. This article lists seven things the email layer has to do for that product to work. You will see why a sending service falls short and what two teams who shipped AI employees ran into.

One team building an AI employee product had a plan. Each AI employee they sold would get a real address, and customers would email it like a colleague. So they priced out building the email side themselves. The list came back long: mail servers, deliverability, spam filtering, headers, threading, attachments and bounces.

Hosted mailboxes were no shortcut either, since every account wanted its own sign-in and phone check. That list is the real spec. An AI employee is not a feature that sends notifications. It is a coworker that someone hires, emails, argues with and expects to remember last week. The email layer under it decides whether that works.

Below are the seven requirements that list turns into. Each one comes from what teams shipping AI employees ran into, with the cost of skipping it.

An AI employee needs a mailbox, not a send pipeline

The short answer is a mailbox per employee that the product creates, owns and reads. Seven requirements follow from that. Your code creates the address when a customer hires the employee, and replies come back into the same conversation. Mail goes out on the customer's domain, and each customer's employees are walled off from every other customer's. Inbound mail is treated as untrusted input, every message is kept and searchable, and the same inbox later handles calendar invites and sign-up codes.

A sending service covers none of the inbound half. A connected mailbox service covers inbound, but only for a human who already has an account and signs in. That team was Junior, and its CTO put it in one line: every other option they looked at was either send-only or required connecting to an existing human mailbox. An AI employee has no human mailbox to connect.

The address belongs to the employee, created in the signup flow

The inbox has to exist the moment a customer hires the employee, with no person in the loop. That rules out anything with an OAuth screen, a seat purchase or a phone check. Junior gives each employee an address like sales-assistant@junior-mail.com, and creating one takes about 200 milliseconds through the API.

Creation also has to be safe to repeat. Signup handlers retry, and a retry that makes a second inbox leaves an orphan with mail in it. Tag each inbox with your own id and a repeat call returns the one you already have.

Python

# on hire: one pod per customer, one inbox per AI employee, events for that pod only (agentmail 2.0.25)import osfrom agentmail import AgentMailclient = AgentMail(api_key=os.environ["AGENTMAIL_API_KEY"])  # organization-level key, provisioning onlydef hire_employee(customer_id: str, role: str, webhook_url: str):    pod = client.pods.create(client_id=f"customer-{customer_id}")    inbox = client.pods.inboxes.create(        pod.pod_id,        username=role,        display_name=role.replace("-", " ").title(),        client_id=f"{customer_id}-{role}",    )    client.webhooks.create(        url=webhook_url,        event_types=["message.received"],        pod_ids=[pod.pod_id],        client_id=f"customer-{customer_id}",    )    return inbox.inbox_idprint(hire_employee("acme", "sales-assistant", os.environ["EMPLOYEE_WEBHOOK_URL"]))# output: the new employee's email address

Replies arrive as a conversation, so threading is the product

Customers do not send one email. They reply, forward to a colleague and come back three days later with a correction. The employee has to see that as one conversation, or it answers the latest message with no idea what it promised in the first. Cofounder's support, sales and finance agents each needed this. Thread history stays with the agent that owns the conversation, so finance never reads a sales thread.

Most teams that start from a sending service end up rebuilding this by hand. They store message ids, match reply headers and keep their own conversation table. In a mailbox model the provider does it. A reply to a message lands in the same thread, and the employee reads the whole thread before it answers.

Python

# the employee follows up in the same conversation it started (agentmail 2.0.25)import osfrom agentmail import AgentMailclient = AgentMail(api_key=os.environ["AGENTMAIL_API_KEY"])inbox_id = os.environ["AGENTMAIL_INBOX_ID"]first = client.inboxes.messages.send(    inbox_id,    to="buyer@acme-example.com",    subject="Quote for 40 seats",    text="Here is the quote for 40 seats we discussed.",)follow_up = client.inboxes.messages.reply(    inbox_id,    first.message_id,    to="buyer@acme-example.com",    text="One correction: the quote includes onboarding.",)print(first.thread_id == follow_up.thread_id)# output: True

Our post on how email threading works for agents covers the headers underneath.

The customer's domain carries the reputation

Sender reputation attaches to the domain, not to the inbox. Mailbox providers track it per domain, and every inbox on a shared domain shares one reputation. One customer's careless outreach lowers delivery for every other customer on the same domain.

So an AI employee that sends real volume should send from a domain the customer controls, or one you register per customer. A dedicated domain is what isolates reputation. A subdomain registered under a shared parent keeps the parent's signature and reputation, so it does not. Warm a new domain slowly. Replies build reputation faster than cold sends, which suits an employee that mostly answers people.

One customer's employees never see another's

A product that sells AI employees to many companies is a multi-tenant product, and email is the most sensitive data it holds. Put each customer in its own pod. A pod scopes inboxes, domains, threads and drafts, and a key scoped to that pod cannot read outside it. Your support tooling can list every thread for one customer without touching anyone else's.

Pods isolate data and keys. They do not isolate reputation, and they are not a network wall: an inbox in one pod can still email an inbox in another. Data isolation comes from the pod and reputation isolation comes from the domain, and a tenant usually needs both. The pods and multi-tenant setup post goes deeper.

Inbound mail is the attack surface

Anyone on the internet can email your AI employee, and whatever they write lands in its context. That makes inbound mail the easiest way to talk an employee into something its customer never approved. Treat every message as untrusted input.

Three controls do most of the work. Allow and block lists decide who can reach an inbox and who it can write to, and a refused send fails with an error before anything leaves. Mail that fails a list is stored but labeled blocked and fires a separate event, so an employee listening for normal arrivals never acts on it. Webhooks are signed, and your endpoint should verify the signature over the raw body before it trusts the payload. The security checklist for agent email has the rest.

Every send is on the record

When an AI employee emails a customer's client, someone will eventually ask what it said and why. The mailbox model answers that for free. Every sent and received message stays in the employee's inbox, grouped by thread and searchable by keyword. Nothing has to be copied into a separate log first.

The record also changes how buyers feel about hiring. A customer's ops lead can read the full conversation before approving the next step, and your product can keep drafts for review on risky threads. Junior built its gateway on top of this in about 1,200 lines of Python, and duplicate deliveries came out at zero.

Calendar and sign-ups turn up next

A useful coworker gets meeting invites and is asked to sign up for things. Both arrive by email. An employee that can only read and write text mail stalls the first time a prospect sends a calendar invite or a vendor sends a one-time code.

Our MCP server already includes calendar tools for reading an agenda and answering invitations. It also has tools for an agent to sign itself up and verify. Plan for both in the same inbox, so the employee keeps one identity.

What AgentMail does not do

AgentMail does not connect to a person's existing Gmail or Outlook mailbox. If your product acts inside a human's own inbox, a connected-mailbox API is the right tool. Pods do not isolate sending reputation; only a dedicated domain does. And there is no live integration that provisions inboxes from an identity provider such as Okta, so hiring and offboarding run from your own code.

FAQ

Questions, answered.

It can for one employee, but it breaks when a product hires them out by the hundred. Each hosted account needs its own sign-in and phone check, and those providers flag automated use. A programmatic inbox is created by your code in the signup flow with no person involved.

No. Reputation follows the domain, so every inbox on a shared domain shares one reputation. Put an employee or a customer on a dedicated domain when its sending should not affect anyone else.

Yes, for a product that sells AI employees to several companies. A pod keeps one customer's inboxes, threads, drafts and domains apart from everyone else's, and a pod-scoped key cannot read outside it. Pods do not separate reputation, so pair them with per-customer domains when volume matters.

Often, yes. Cofounder kept its transactional provider for system mail like sign-in links and put agent conversations on agent inboxes. The two jobs differ: one sends notifications from your product, the other holds two-way conversations as the employee.

Blog

Suggested reading

View all posts

Customer Stories · June 21, 2026

How Junior gives every AI employee its own inbox with AgentMail

Junior, by Kuse, is an AI employee that lives in Slack, Teams, Lark, and email. Every AI employee needed a real email identity for two-way conversations. Building it in-house was weeks of work; AgentMail made email a first-class channel in under a week.

Prompt

Give yourself access to AgentMail by following the guide at:

https://docs.agentmail.to/agent-onboarding.md

and refer to:

https://docs.agentmail.to/llms.txt

for the documentation index.

Start integrating AgentMail into your AI agents today.