A developer recently posted on Reddit about a problem that comes up constantly when building AI agents: agents need to communicate by email, but giving them access to your personal inbox creates privacy risks and operational chaos. Their solution was a dedicated email service for AI agents.
It is a real problem. An OpenClaw agent with access to your Gmail can read every email you receive, not just the ones relevant to its job. Replies to agent-sent messages land in your personal thread. And if you revoke the agent's access, you disrupt your own email too.
The fix is simple: give your AI employee its own email address. Here is how to do it.
A dedicated inbox solves three problems at once:
If you have a custom domain, adding an agent-specific address is trivial. The agent gets an address like assistant@yourdomain.com or support@yourdomain.com.
ai-assistant with a strong generated password# In OpenClaw gateway config — add email credentials
email:
inbox:
provider: gmail
username: ai-assistant@yourdomain.com
password: "your-app-password" # use env variable in production
imap_host: imap.gmail.com
imap_port: 993
outbox:
provider: gmail
smtp_host: smtp.gmail.com
smtp_port: 587
from: "AI Assistant <ai-assistant@yourdomain.com>"# Fastmail IMAP/SMTP config
email:
inbox:
imap_host: imap.fastmail.com
imap_port: 993
username: ai-assistant@yourdomain.com
password: "app-specific-password"
outbox:
smtp_host: smtp.fastmail.com
smtp_port: 587Services designed specifically for AI agent email give each agent a unique inbox address with an API for reading and sending messages — no IMAP configuration required.
The pattern for these services:
agent-id@inboxservice.com# Example skill configuration for API-based agent email
skills:
- name: email_check
type: http
endpoint: "https://api.agentmail.example.com/inbox/{{agent_id}}/messages"
headers:
Authorization: "Bearer {{AGENT_MAIL_API_KEY}}"
- name: email_reply
type: http
method: POST
endpoint: "https://api.agentmail.example.com/inbox/{{agent_id}}/send"
body:
to: "{{recipient}}"
subject: "{{subject}}"
body: "{{message_body}}"Once the inbox is set up, the agent's SOUL.md defines what it does with incoming email.
name: SupportAgent
role: Customer Support AI Employee
email: support@yourcompany.com
permissions:
- skills:email_read
- skills:email_reply
- network
instructions: |
You are the customer support AI employee for YourCompany.
You handle incoming support emails at support@yourcompany.com.
When you receive a new email:
1. Read the full message and attachments
2. Classify: billing question, technical issue, general question, or escalation needed
3. For billing questions: provide account information from the database
4. For technical issues: provide step-by-step troubleshooting
5. For general questions: answer from the knowledge base
6. For escalation: forward to human@yourcompany.com with summary and context
Rules:
- Always reply within the same email thread (preserve subject line)
- Sign every email: "AI Support Team at YourCompany"
- Never promise refunds or commitments that require manager approval
- Never share data from other customer accounts
- If unsure, escalate rather than guessUse HEARTBEAT.md to check the inbox at regular intervals. For support agents, every 15 minutes is typical. For daily digest agents, once per day is sufficient.
# HEARTBEAT.md — check email every 15 minutes during business hours
schedule: "*/15 9-18 * * 1-5"
task: |
Check inbox at support@yourcompany.com for unread messages.
For each unread message:
1. Read the email content
2. Classify and handle according to SOUL.md instructions
3. Mark as read after processing
4. Log action taken to daily_summary.mdIf your email provider or agent mail service supports webhooks, you can skip the polling schedule entirely. The service calls a webhook URL when new email arrives, which wakes the agent immediately.
# OpenClaw gateway webhook endpoint for inbound email
gateway:
webhooks:
- path: /webhook/email
secret: "{{WEBHOOK_SECRET}}"
handler: email_received
agent: support-agentThis gives you real-time email response without the overhead of constant polling.
An agent with its own outreach@company.com address that sends personalized follow-up sequences, tracks replies, and qualifies leads before handing off to a human. Replies come back to the agent's address, not your personal inbox.
Receives invoices at invoices@company.com, extracts amounts and due dates, creates calendar reminders, and sends to accounting. No human needs to touch invoice emails.
Monitors project status and sends weekly summary emails to stakeholders fromupdates@company.com. Stakeholders reply to the agent address to ask questions or request changes.
CrewClaw's personal assistant template and customer support template both include email integration as a built-in capability. You configure the inbox address, define what the agent should handle, and it deploys with email skills already wired up.
No IMAP debugging. No SMTP configuration. Your AI employee arrives ready to handle email as part of its job.
When agents share your personal email, several problems emerge: replies to agent-sent messages land in your inbox, the agent can read personal emails it should not, and there is no audit trail of what the agent communicated. A dedicated inbox keeps agent communication separate, auditable, and easier to revoke if something goes wrong.
Yes. Use HEARTBEAT.md to schedule an email check interval. A common pattern is every 15-30 minutes for support agents that need to respond quickly, or once per day for digest-style agents. The agent reads new messages, decides which require action, and processes them according to its SOUL.md instructions.
Any email provider that supports IMAP (read) and SMTP (send) will work with OpenClaw's built-in email skills. Gmail, Outlook, Fastmail, Zoho Mail, and custom domain email on services like Google Workspace, Microsoft 365, and ProtonMail Business are all supported. For custom domains, a service like Mailgun or SendGrid gives you programmatic control and better deliverability.
Define strict filters in the agent's SOUL.md. Specify sender domains it should respond to, topics it is allowed to reply to, and phrases that should trigger escalation to a human instead. Include a rule like 'never reply to emails from @competitors.com' or 'always escalate emails mentioning legal, refund, or contract'. The agent follows these rules on every email it processes.
Yes, with label-based routing. Set up filters in Gmail or your email provider to apply labels based on sender, subject, or content. Each agent monitors a different label. A support agent handles 'label:support', a sales agent handles 'label:sales'. They share one inbox domain but operate independently on their own queue.
Skip the setup. Pick a template and deploy in 60 seconds.
Pick a role. Your AI employee starts working in 60 seconds. WhatsApp, Telegram, Slack & Discord. No setup required.
Get Your AI Employee