Every serious agent infrastructure stack has the same missing layer: email. LLMs, browser automation, code execution, vector search — all covered. But the ability to create an inbox in milliseconds, use it for a single task, and delete it when done? That primitive has been absent from the standard agent toolkit until now.

Email as Identity Infrastructure

The web uses email as its primary identity layer. Not because it is the best possible mechanism, but because it is universal. Every person, every company, every service has an email address. When a web service wants to verify that a new account belongs to a real entity, it sends a message to the provided address and waits for a response. If the response arrives, the entity is considered verified.

This pattern is so deeply embedded in the web's infrastructure that it cannot be bypassed. Approximately 80% of services require email verification before granting meaningful access. For an AI agent to participate in the web as an actor — not just a reader — it needs email identity. It needs an inbox.

What Programmatic Inboxes Enable

  • Dynamic identity: create a new email address for each task, on demand, in milliseconds
  • Isolation: no two agents share an inbox, eliminating OTP routing collisions
  • Scale: thousands of parallel inboxes with no connection limits or rate constraints
  • Custom domains: agents can represent your brand with support@yourcompany.com
  • Full email capability: receive, send, reply, forward — complete email participation
  • Clean lifecycle: create at task start, delete at completion, no lingering state

The API Surface That Matters for Agents

A purpose-built agent email API has a small, focused surface. Five endpoints cover virtually every use case:

  • POST /inboxes — create a new inbox, returns address and ID
  • GET /inboxes/:id/otp — long-poll until OTP arrives, returns extracted code
  • GET /inboxes/:id/wait — long-poll until any email arrives, returns full parsed message
  • POST /inboxes/:id/send — send from the inbox to any address
  • DELETE /inboxes/:id — delete the inbox and all its messages

This is simple HTTP with an API key. No OAuth flows. No IMAP clients. No SMTP configuration. No email parsing libraries. The infrastructure handles all of that. Your agent code stays clean.

import AgentMailr from "agentmailr";

const client = new AgentMailr({
  apiKey: process.env.AGENTMAILR_API_KEY,
});

// 1. Create inbox
const inbox = await client.inboxes.create({ username: "signup-task" });
// inbox.address = "signup-task@agentmailr.com"

// 2. Use inbox address in your automation
await page.fill('#email', inbox.address);
await page.click('#submit');

// 3. Wait for OTP (blocks until it arrives, no polling)
const { otp } = await client.messages.waitForOTP({
  inboxId: inbox.id,
  timeout: 30_000,
});

// 4. Complete verification
await page.fill('#verification-code', otp);
await page.click('#verify');

// 5. Delete inbox (clean up)
await client.inboxes.delete(inbox.id);

This is the programmatic inbox primitive in its complete form. Five steps, one inbox, one task, clean deletion. The pattern composes cleanly into any agent framework — LangChain, CrewAI, AutoGen, or raw orchestration code.

Start Free

AgentMailr provides the programmatic inbox primitive as a hosted service. Free to start with no credit card required. Your first inbox is ready in under 60 seconds.