Build a support inbox agent
An inbox agent is an address that answers its
own mail. Point support@ at one and every inbound message is read,
answered in-thread, and — when it's over the agent's head — handed to a human.
No webhook to host, no loop to run.
1. Turn an address into an agent
It's one route with action: "agent". The agentPrompt
is the whole program — what it answers, how it sounds, and when to escalate:
// One route turns support@ into an agent. The prompt is the program.
mailkite_create_route({
match: "support@yourdomain.com",
action: "agent",
agentPrompt:
"You are the support agent for yourdomain.com. Answer billing and account " +
"questions from our docs. Reply in-thread, warmly and briefly. If you can't " +
"resolve it, or the sender is upset, escalate to humans@yourdomain.com.",
agentForwardTo: ["humans@yourdomain.com"]
}) Same thing from the dashboard, if you'd rather not write code:
Dashboard → Routes → [ + Add route ]
Match support@yourdomain.com
Receiver Agent
Prompt Answer billing & account questions for yourdomain.com.
Reply in-thread. Escalate anything you can't resolve
to humans@yourdomain.com.
Click [ Add route ] 2. What happens on each email
When mail hits support@yourdomain.com, MailKite runs the agent
against it: it reads the full message, drafts a reply from your prompt, and
sends it in-thread so the conversation stays intact. Anything
it can't resolve — or that trips your escalation rule — is forwarded to the
address in agentForwardTo, with the original attached.
3. Test it
Send it a real email, fire a signed test event, or ask the agent directly to see how it answers before you point traffic at it:
// Send a signed test event, or just email support@ and watch it reply
mailkite_test_webhook({ domain: "yourdomain.com" })
// Ask the agent directly, without waiting for mail
mailkite_agent({ address: "support@yourdomain.com",
message: "Hi, how do I change the card on my account?" })
Tune the prompt until the replies read right, add routes for other addresses
(sales@, billing@), and let humans handle only what's
escalated.
A little about MailKite
MailKite is programmable email for developers and AI agents. An inbox agent is the whole receive-reason-reply loop collapsed into one route — no server to run, no model to host — and it shares the same verified domain your app already sends from. Manage it over MCP, the SDKs, or the dashboard. Inbox agents are on the free tier.
Next: Inbox agents for prompts, escalation, and multi-address setups, or Send & receive from your agent.