Email-Capable AI Assistants with Superagent

Connect Superagent's managed AI assistants to MultiMail for sending, reading, and managing email — with human oversight for production-deployed agents.


Superagent is a platform for building and deploying AI assistants with tool use, memory, and RAG capabilities. MultiMail provides the email infrastructure layer that gives Superagent assistants the ability to send, receive, and manage email on behalf of users in production environments.

When agents run in production without direct developer supervision, email oversight becomes critical. MultiMail's default gated_send mode ensures every email drafted by a Superagent assistant requires human approval before delivery, providing the safety layer that production-deployed agents need.

Connect Superagent to MultiMail by configuring MultiMail API endpoints as custom tools in your Superagent assistant. The REST API approach works with Superagent's tool registration system, giving your assistant structured email capabilities.

Built for Superagent developers

Production Safety for Managed Agents

Superagent assistants run in production without direct supervision. MultiMail's oversight modes provide the email safety layer that production agents need — from human approval for every send to fully autonomous operation.

Custom Tool Integration

Superagent supports custom tools that call external APIs. Register MultiMail's send_email, check_inbox, and reply_email as tools in your assistant for structured email capabilities.

Graduated Trust via Oversight Modes

Start with gated_send (assistant composes, human approves) and progress to autonomous as your Superagent assistant proves reliable. MultiMail's five oversight modes let you scale agent autonomy safely.

Built-in Observability Pairing

Superagent's built-in observability shows you how your assistant uses tools. Combined with MultiMail's audit logs, you get full visibility into every email action your agent takes.

Multi-LLM Provider Support

Superagent supports multiple LLM providers. Your MultiMail email tools work the same regardless of which model powers your assistant, so you can switch providers without changing the email integration.


Get started in minutes

Register MultiMail Tools in Superagent
python
import requests

SUPERAGENT_API = "https://api.superagent.sh/api/v1"
SA_HEADERS = {"Authorization": "Bearer your_superagent_api_key"}

"cm"># Create a MultiMail send_email tool
requests.post(f"{SUPERAGENT_API}/tools", headers=SA_HEADERS, json={
    "name": "send_email",
    "description": "Send an email through MultiMail. In gated_send mode, "
                   "emails queue for human approval before delivery.",
    "type": "FUNCTION",
    "metadata": {
        "url": "https://api.multimail.dev/v1/send",
        "method": "POST",
        "headers": {"Authorization": "Bearer mm_live_your_api_key"},
        "parameters": {
            "mailbox_id": {"type": "string", "description": "Mailbox to send from"},
            "to": {"type": "string", "description": "Recipient email"},
            "subject": {"type": "string", "description": "Subject line"},
            "body": {"type": "string", "description": "Email body"}
        }
    }
})

"cm"># Create a MultiMail check_inbox tool
requests.post(f"{SUPERAGENT_API}/tools", headers=SA_HEADERS, json={
    "name": "check_inbox",
    "description": "Check inbox for recent messages.",
    "type": "FUNCTION",
    "metadata": {
        "url": "https://api.multimail.dev/v1/mailboxes/{mailbox_id}/inbox",
        "method": "GET",
        "headers": {"Authorization": "Bearer mm_live_your_api_key"},
        "parameters": {
            "mailbox_id": {"type": "string", "description": "Mailbox to check"},
            "limit": {"type": "integer", "description": "Max messages"}
        }
    }
})

Configure MultiMail email endpoints as custom tools in your Superagent assistant using the API.

Create an Email Assistant
python
"cm"># Create an assistant with email capabilities
assistant_resp = requests.post(f"{SUPERAGENT_API}/assistants", headers=SA_HEADERS, json={
    "name": "Email Assistant",
    "description": "An AI assistant that manages email through MultiMail.",
    "llmModel": "GPT_4O",
    "prompt": "You are a professional email assistant. You can send, read, and "
             "reply to emails using the provided tools. Emails are sent in "
             "gated_send mode, which means they queue for human approval "
             "before delivery. Always confirm the recipient and content "
             "before sending. Be concise and professional in email drafts."
})
assistant_id = assistant_resp.json()["data"]["id"]

"cm"># Attach email tools to the assistant
for tool_name in ["send_email", "check_inbox"]:
    tool_id = get_tool_id(tool_name)  "cm"># Retrieve from previous step
    requests.post(
        f"{SUPERAGENT_API}/assistants/{assistant_id}/tools",
        headers=SA_HEADERS,
        json={"toolId": tool_id}
    )

"cm"># Invoke the assistant
response = requests.post(
    f"{SUPERAGENT_API}/assistants/{assistant_id}/invoke",
    headers=SA_HEADERS,
    json={"input": "Check my inbox and summarize any urgent messages"}
)
print(response.json()["data"]["output"])

Set up a Superagent assistant with MultiMail email tools and a system prompt for email handling.

Direct REST API Integration
python
import requests
import json

MULTIMAIL_API = "https://api.multimail.dev/v1"
MM_HEADERS = {"Authorization": "Bearer mm_live_your_api_key"}

def send_email(mailbox_id: str, to: str, subject: str, body: str) -> dict:
    """Send an email via MultiMail. Queues for approval in gated_send mode."""
    resp = requests.post(f"{MULTIMAIL_API}/send", headers=MM_HEADERS, json={
        "mailbox_id": mailbox_id, "to": to, "subject": subject, "body": body
    })
    return resp.json()

def check_inbox(mailbox_id: str, limit: int = 10) -> dict:
    """Check inbox for recent messages."""
    resp = requests.get(
        f"{MULTIMAIL_API}/mailboxes/{mailbox_id}/inbox",
        headers=MM_HEADERS, params={"limit": limit}
    )
    return resp.json()

def reply_email(message_id: str, body: str) -> dict:
    """Reply to an email, maintaining thread context."""
    resp = requests.post(f"{MULTIMAIL_API}/reply", headers=MM_HEADERS, json={
        "message_id": message_id, "body": body
    })
    return resp.json()

"cm"># Use these functions as tool implementations
"cm"># in your Superagent workflow or custom agent loop
result = check_inbox("mbx_abc123", limit=5)
print(f"Found {len(result.get(&"cm">#039;messages', []))} messages")

For more control, build a custom agent loop using Superagent's SDK with MultiMail API calls.


Step by step

1

Create a MultiMail Account and API Key

Sign up at multimail.dev, create a mailbox, and generate an API key from your dashboard. Your key will start with mm_live_.

2

Set Up Superagent

Sign up for Superagent and obtain your API key. You can use the hosted platform or self-host the open-source version.

bash
pip install superagent-py
3

Register Email Tools

Create custom tools in Superagent that map to MultiMail's API endpoints — send_email, check_inbox, reply_email, and others.

4

Create and Configure Your Assistant

Create a Superagent assistant with a system prompt that explains email oversight modes. Attach the MultiMail tools to the assistant.

5

Approve Pending Emails

If your mailbox uses gated_send mode (the default), review and approve pending emails in the MultiMail dashboard before they are delivered.


Common questions

How do I register MultiMail tools in Superagent?
Use Superagent's tool creation API to register MultiMail endpoints as custom function tools. Define the URL, HTTP method, headers (including your MultiMail API key), and parameter schemas. Then attach the tools to your assistant.
What happens when my assistant sends an email in gated_send mode?
In gated_send mode, the MultiMail API returns a success response with a pending status. The email is queued for human review in the MultiMail dashboard. Once approved, it is delivered. Your assistant can inform the user that the email is pending approval.
Can I use Superagent's memory features with email?
Yes. Superagent's memory system can store email context across conversations. The assistant can remember previous email interactions, contact preferences, and communication styles, improving email quality over time.
How do I monitor my assistant's email activity?
Use Superagent's built-in observability to track tool invocations and assistant behavior. Complement this with MultiMail's audit log endpoint to see the full lifecycle of every email — from draft to approval to delivery.
Is there rate limiting on the MultiMail API?
Rate limits depend on your plan tier. The Starter (free) plan allows 200 emails per month, while paid plans range from 5,000 to 150,000. The API returns standard 429 responses when limits are reached, which Superagent can handle with retry logic.

Explore more

The only agent email with a verifiable sender

Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.