Give AgentGPT's autonomous agents email capabilities through MultiMail — with gated oversight that ensures every email action is reviewed before execution.
AgentGPT is a web-based platform for deploying autonomous AI agents that create and execute task plans without continuous human input. MultiMail provides the email infrastructure layer that gives these autonomous agents the ability to send, receive, and manage email while maintaining human oversight guardrails.
Fully autonomous agents represent the highest-risk category for email access. MultiMail's gated_all mode is strongly recommended for AgentGPT integrations, ensuring every email action — reading, sending, replying — requires human approval. This prevents autonomous agents from sending inappropriate emails during unsupervised task execution.
Connect AgentGPT to MultiMail by extending AgentGPT's tool system with custom functions that call the MultiMail REST API. The integration adds email to AgentGPT's capability set while keeping humans in the loop for every email interaction.
AgentGPT agents run autonomously without human supervision. MultiMail's gated_all mode is essential here — every email action (send, reply, even inbox reads) gets human approval, preventing runaway autonomous email behavior.
Start with gated_all for new autonomous agents, then carefully progress to gated_send once you trust the agent's email judgment. MultiMail's five oversight modes let you incrementally increase autonomy with safety checkpoints.
When AgentGPT creates a task plan involving email, MultiMail's pending queue shows exactly what emails the agent wants to send. Humans can review the full plan before any emails are delivered.
MultiMail logs every email action with timestamps and approval status. For autonomous agents that may execute dozens of steps, this audit trail is critical for understanding what happened and why.
MultiMail's plan-based rate limits act as an additional safety valve for autonomous agents. Even if an agent enters a loop, the email rate limit prevents it from sending unlimited messages.
const MULTIMAIL_API = 'https://api.multimail.dev/v1';
const MM_HEADERS = {
'Authorization': 'Bearer mm_live_your_api_key',
'Content-Type': 'application/json'
};
async function sendEmail(args: {
mailbox_id: string;
to: string;
subject: string;
body: string;
}): Promise<Record<string, unknown>> {
"cm">// In gated_all mode, this queues for human approval
const resp = await fetch(`${MULTIMAIL_API}/send`, {
method: 'POST',
headers: MM_HEADERS,
body: JSON.stringify(args)
});
return resp.json();
}
async function checkInbox(args: {
mailbox_id: string;
limit?: number;
}): Promise<Record<string, unknown>> {
const params = new URLSearchParams({ limit: String(args.limit || 10) });
const resp = await fetch(
`${MULTIMAIL_API}/mailboxes/${args.mailbox_id}/inbox?${params}`,
{ headers: MM_HEADERS }
);
return resp.json();
}
async function replyEmail(args: {
message_id: string;
body: string;
}): Promise<Record<string, unknown>> {
const resp = await fetch(`${MULTIMAIL_API}/reply`, {
method: 'POST',
headers: MM_HEADERS,
body: JSON.stringify(args)
});
return resp.json();
}Define email tool functions that AgentGPT can use during autonomous task execution.
"cm">// Extend AgentGPT's tool registry with MultiMail email tools
const emailToolDefinitions = [
{
name: 'send_email',
description: 'Send an email through MultiMail. Uses gated_all mode — '
+ 'the email will queue for human approval before delivery.',
parameters: {
mailbox_id: { type: 'string', description: 'Mailbox to send from', required: true },
to: { type: 'string', description: 'Recipient email address', required: true },
subject: { type: 'string', description: 'Email subject line', required: true },
body: { type: 'string', description: 'Email body content', required: true }
},
execute: sendEmail
},
{
name: 'check_inbox',
description: 'Check a mailbox inbox for recent messages.',
parameters: {
mailbox_id: { type: 'string', description: 'Mailbox to check', required: true },
limit: { type: 'number', description: 'Max messages to return', required: false }
},
execute: checkInbox
},
{
name: 'reply_email',
description: 'Reply to an email. Queues for human approval in gated_all mode.',
parameters: {
message_id: { type: 'string', description: 'Message ID to reply to', required: true },
body: { type: 'string', description: 'Reply content', required: true }
},
execute: replyEmail
}
];
// Register tools with AgentGPT's tool system
emailToolDefinitions.forEach(tool => {
registerTool(tool);
});Add MultiMail email capabilities to AgentGPT's available tools for autonomous task planning.
import requests
import json
MULTIMAIL_API = "https://api.multimail.dev/v1"
MM_HEADERS = {"Authorization": "Bearer mm_live_your_api_key"}
def create_email_tools():
"""Define email tools for use with AgentGPT&"cm">#039;s task execution."""
tools = {
"send_email": {
"description": "Send an email. Uses gated_all mode — queues for approval.",
"execute": lambda args: requests.post(
f"{MULTIMAIL_API}/send", headers=MM_HEADERS, json=args
).json()
},
"check_inbox": {
"description": "Check inbox for recent messages.",
"execute": lambda args: requests.get(
f"{MULTIMAIL_API}/mailboxes/{args[&"cm">#039;mailbox_id']}/inbox",
headers=MM_HEADERS, params={"limit": args.get("limit", 10)}
).json()
},
"reply_email": {
"description": "Reply to an email. Queues for approval.",
"execute": lambda args: requests.post(
f"{MULTIMAIL_API}/reply", headers=MM_HEADERS, json=args
).json()
},
"list_pending": {
"description": "List emails pending human approval.",
"execute": lambda args: requests.get(
f"{MULTIMAIL_API}/pending", headers=MM_HEADERS
).json()
}
}
return tools
# Usage in AgentGPT task execution
tools = create_email_tools()
result = tools["check_inbox"]["execute"]({"mailbox_id": "mbx_abc123"})
print(f"Inbox: {json.dumps(result, indent=2)}")A standalone Python script that adds MultiMail email capabilities to AgentGPT through its API.
Sign up at multimail.dev, create a mailbox, and generate an API key. Set the oversight mode to gated_all for autonomous agent use.
Deploy AgentGPT using the self-hosted option or use the hosted platform at agentgpt.reworkd.ai.
Create functions that call MultiMail's REST API endpoints for send_email, check_inbox, reply_email, and list_pending.
Add the email tool functions to AgentGPT's tool registry so the autonomous agent can include email actions in its task plans.
Watch the MultiMail dashboard for pending emails from your autonomous agent. Review and approve each action before it executes. Check the audit log for a complete history of agent email activity.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.