| name | email-outreach |
| description | Send, receive, and manage email from the agent's own @instaclaw.io inbox. Use when the user asks to send email, check inbox, draft replies, cold outreach, email campaigns, follow-ups, or check for verification codes. |
Email & Outreach
name: email-outreach
version: 1.0.0
updated: 2026-02-22
author: InstaClaw
triggers:
keywords: [email, outreach, inbox, send email, reply, forward, newsletter, cold email, follow-up, OTP, verification code, email digest]
phrases: ["send an email", "check my email", "draft a response", "follow up with", "email campaign", "cold outreach", "check for verification codes", "what's in my inbox", "email digest"]
NOT: [Slack message, Discord message, SMS, phone call, text message]
Overview
Every InstaClaw agent ships with its own email address — auto-provisioned during setup, fully operational from day one. The agent can send, receive, reply, extract OTP codes, manage threads, and handle email-based workflows autonomously. This is the agent's identity on the internet.
The agent's email (e.g., mucus@instaclaw.io) supplements the user's personal Gmail — the agent monitors both inboxes, sends from its own address for autonomous work, and drafts replies for the user's Gmail that the human reviews and sends. Two identities, one unified inbox experience.
Why this matters: Email is still the universal protocol of the internet. Without email, agents can't sign up for services, receive verification codes, communicate with other agents, send invoices, or operate autonomously in any meaningful business context. AgentMail.to gives every agent a real inbox in milliseconds via API.
Two-identity email system:
- AgentMail @instaclaw.io (PRIMARY, auto-provisioned): Full send+receive inbox for autonomous work — service signups, OTP extraction, agent-to-agent communication, invoices, newsletters. Provisioned automatically during
configureOpenClaw().
- Resend (FALLBACK): Transactional email fallback if AgentMail has delivery issues. Send-only.
- User's Gmail (OAuth monitor): Agent monitors for important emails, drafts replies for human review. Human sends from their own address.
Prerequisites (on your VM):
- AgentMail inbox auto-provisioned during setup (InstaClaw master API key)
AGENTMAIL_API_KEY in ~/.openclaw/.env (InstaClaw master account key)
RESEND_API_KEY in ~/.openclaw/.env (fallback for transactional sends)
- From address in
~/.openclaw/email-config.json
- Helper scripts:
~/scripts/email-client.sh, ~/scripts/email-safety-check.py, ~/scripts/email-digest.py
- Webhook endpoint on gateway for incoming email notifications
AgentMail.to Platform Details
provider: "agentmail.to"
type: "API-first email for AI agents"
features:
- Create inboxes via API in milliseconds
- Full send/receive/reply/thread management
- Built-in SPF/DKIM/DMARC (deliverability handled)
- Webhooks for real-time incoming email notifications
- Attachment handling (send and receive)
- Semantic search across inbox
- Python + TypeScript SDKs
pricing:
playground: Free — 3 inboxes, 3K emails, 3GB storage
developer: $20/mo — 10
Provider Details
Primary Provider: AgentMail.to (full inbox, send+receive, auto-provisioned)
Domain: instaclaw.io (SPF/DKIM/DMARC handled by AgentMail)
API: https://api.agentmail.to/v0
Auth: Authorization: Bearer <AGENTMAIL_API_KEY>
Fallback Provider: Resend (transactional email, send-only)
Domain: instaclaw.io (SPF/DKIM/DMARC verified)
API: https://api.resend.com
Auth: Authorization: Bearer <RESEND_API_KEY>
Architecture: Two-Identity Email System
┌─────────────────────────────────────────────┐
│ Agent Email Brain │
│ │
│ ┌───────────────┐ ┌───────────────────┐ │
│ │ Agent's Own │ │ User's Gmail │ │
│ │ @instaclaw.io │ │ (OAuth monitor) │ │
│ │ │ │ │ │
│ │ SENDS FROM │ │ MONITORS │ │
│ │ RECEIVES │ │ DRAFTS FOR │ │
│ │ AUTONOMOUS │ │ USER SENDS │ │
│ └───────────────┘ └───────────────────┘ │
│ │
│ Unified inbox view → Daily digest → User │
└─────────────────────────────────────────────┘
Agent's @instaclaw.io email (fully autonomous):
- Service signups and verification codes
- Agent-to-agent communication
- Marketplace activity (Contra, Clawlancer)
- Automated workflows (invoices, confirmations)
- Newsletter distribution
User's Gmail (agent assists, human controls):
- Agent monitors for important emails
- Agent drafts replies for human review
- Human sends from their own address
- Preserves user's identity and relationships
Auto-Provisioning: configureOpenClaw() Integration
Every new agent gets an email address automatically during VM setup:
import { AgentMailClient } from '@agentmail/sdk';
async function provisionAgentEmail(config: {
agentName: string;
userId: string;
customAddress?: string;
}): Promise<string> {
const agentmail = new AgentMailClient({
apiKey: process.env.AGENTMAIL_API_KEY
});
const username = config.customAddress?.split('@')[0]
|| config.agentName.toLowerCase().replace(/[^a-z0-9]/g, '');
const inbox = await agentmail.inboxes.create({
username: username,
domain: 'instaclaw.io',
description: `InstaClaw agent: ${config.agentName} (User: ${config.userId})`
});
await agentmail.webhooks.create({
inbox_id: inbox.id,
: ,
: [, ]
});
({
: {
: ,
: inbox.,
:
}
});
cron.({
: ,
: { : , : , : },
: { : , : },
:
});
;
}
.();
emailAddress = ({
: config.,
: config.,
: config.
});
.();
Naming Convention
Default: {agent_name}@instaclaw.io → mucus@instaclaw.io
Custom: {agent_name}-{custom}@instaclaw.io → mucus-trading@instaclaw.io
During onboarding:
"Your agent needs an email for autonomous operation.
Suggested: mucus@instaclaw.io
[Use this] [Customize]
(Your agent will monitor your Gmail too, but this is its own identity
for services, signups, and agent-to-agent communication)"
Avoid: mucus-cooper@instaclaw.io (exposes user identity), cooper-agent@instaclaw.io (sounds like assistant, not autonomous agent).
Which Provider Am I Using?
~/scripts/email-client.sh info
Email Autonomy Rules
ALWAYS auto-send (no human approval needed):
- Service signup confirmations
- Pre-approved newsletter distribution
- Agent-to-agent communication
- Automated receipts and confirmations
NEVER auto-send (always get human approval):
- Cold outreach to new contacts
- Emails mentioning money, pricing, invoices
- Emails mentioning legal matters
- Emails to VIP contacts (defined in USER.md)
- Emails making commitments or promises
When in doubt: Draft it, present it to the user, wait for approval.
Workflow 1: Autonomous Email Operations (No Human Needed)
These workflows run without any human approval:
A. Service Signups & OTP Extraction
~/scripts/email-client.sh send \
--to "signup@service.com" \
--subject "Account Registration" \
--body "Registration details..."
~/scripts/email-client.sh search --query "verification code"
B. Send Email (Always Available)
~/scripts/email-client.sh send \
--to "recipient@example.com" \
--subject "Subject line" \
--body "Email body text"
~/scripts/email-client.sh send \
--to "recipient@example.com" \
--subject "Newsletter" \
--body "<h1>Hello</h1><p>Content here</p>" \
--content-type "text/html"
C. Automated Confirmations & Receipts
~/scripts/email-client.sh send \
--to "customer@example.com" \
--subject "Your order has been received" \
--body "Order confirmation details..."
D. Newsletter/Content Distribution (after initial setup)
~/scripts/email-client.sh send \
--to "subscriber@example.com" \
--subject "Weekly newsletter" \
--body "Personalized content..."
Workflow 2: Check Inbox & Manage Threads
~/scripts/email-client.sh check --unread --limit 10
~/scripts/email-client.sh search --query "verification code"
~/scripts/email-client.sh threads --limit 10
~/scripts/email-client.sh reply --thread-id "thread_abc" --body "Reply text"
Workflow 3: Human-Approved Email Operations
These require user review before sending:
A. Cold Outreach
Agent drafts → User reviews → User approves → Agent sends + tracks responses
OUTREACH READY FOR REVIEW
Draft 1: Partnership inquiry to CompetitorX
To: partnerships@competitorx.com
Subject: "InstaClaw x CompetitorX — Integration Opportunity"
Preview: "Hi Team, I noticed your recent API launch..."
Confidence: 82%
[Approve] [Edit] [Skip]
Draft 2: Follow-up to investor (3 days since last email)
To: investor@vc.com
Subject: "Re: InstaClaw Demo Follow-up"
Preview: "Hi Sarah, wanted to follow up on..."
Confidence: 90%
[Approve] [Edit] [Skip]
B. First-Time Responses (Gmail drafts)
Agent detects new email in Gmail → Drafts response → User reviews → User sends from Gmail
NEW EMAIL REQUIRING RESPONSE
From: newclient@company.com
Subject: "Interested in your AI agents"
Received: 2 hours ago
Agent's draft:
"Hi [Name], Thanks for your interest! InstaClaw agents can..."
[Send from Gmail] [Edit First] [I'll Handle It]
You NEVER send from the user's Gmail directly. You only draft. The user sends.
C. Invoices & Proposals
Agent generates → User approves amounts/terms → Agent sends → Agent follows up automatically
INVOICE READY
Client: CompanyX
Amount: $500 (brand extraction + video)
Terms: Net 15
[Approve & Send] [Edit Amount] [Edit Terms]
After approval: Agent sends and auto-follows up at Day 7, Day 14
Workflow 4: Gmail Draft Assistance
When the user gets an important Gmail that needs a response:
- Detect email via Gmail monitoring
- Draft a response
- Present to user: [Send from Gmail] [Edit First] [I'll Handle It]
You NEVER send from the user's Gmail directly. You only draft. The user sends.
Pre-Send Safety Checks
ALWAYS run before sending any email:
python3 ~/scripts/email-safety-check.py \
--to "recipient@example.com" \
--subject "Subject line" \
--body "Email body text"
What gets blocked:
- API keys, passwords, tokens in email body
- Dollar amounts > $999 without human approval
- Legal terms (lawsuit, legal action, confidential)
- Exceeding daily rate limits
Rate Limits
Cold outreach: 20/day (hard cap)
Known contacts: 100/day
Total daily: 200/day
Warmup schedule (new from-address):
Week 1: 10/day
Week 2: 25/day
Week 3: 50/day
Week 4+: Full limits
Check status: python3 ~/scripts/email-safety-check.py --rate-status
Daily Email Digest
python3 ~/scripts/email-digest.py generate
Example digest output (delivered via Telegram):
Daily Email Digest — Feb 21, 2026
URGENT (Action Needed):
- VIP email from investor@vc.com (3h ago)
Subject: "Follow-up on demo"
[Draft Reply] [Open in Gmail]
- Deadline: Proposal due tomorrow
From: client@company.com
[View Details]
NEW (May Need Response):
- Partnership inquiry from newcontact@startup.com
Agent draft ready — confidence 82%
[Review Draft] [I'll Handle It]
HANDLED AUTONOMOUSLY:
- 3 OTP codes extracted & used (Contra, GitHub, Heroku)
- 2 order confirmations sent
- 1 follow-up to existing client thread
- Newsletter sent to 47 subscribers
INBOX STATS:
- Agent inbox: 12 received, 8 sent
- Gmail: 23 received, 0 requiring response
- Priority emails caught: 2
- Spam filtered: 14
Your time: 3 minutes to review urgent items
Email Client Commands
| Command | Provider | Usage |
|---|
send | AgentMail (primary), Resend (fallback) | email-client.sh send --to X --subject Y --body Z |
check | AgentMail | email-client.sh check [--unread] [--from X] |
reply | AgentMail | email-client.sh reply --thread-id X --body Y |
threads | AgentMail | email-client.sh threads [--limit N] |
search | AgentMail | email-client.sh search --query "text" |
info | Any | email-client.sh info |
delete | AgentMail | email-client.sh delete --message-id X |
Common Mistakes
-
Sending from wrong identity. Agent should send from @instaclaw.io for autonomous work and only DRAFT for Gmail. Never send from the user's Gmail without explicit approval.
-
Over-emailing contacts. Respect rate limits. If someone hasn't responded after 3 follow-ups, stop. Don't be the annoying bot.
-
Missing VIP emails in noise. Priority classification must run on every incoming email. A missed investor email is catastrophic. Configure VIP sender list during onboarding.
-
Not warming up new addresses. AgentMail handles SPF/DKIM, but a brand new address sending 100 emails on day 1 will get flagged. Follow the warmup schedule.
-
Auto-replying to auto-replies. Detect auto-reply headers (Auto-Submitted: auto-replied, X-Autoreply: yes) and skip. Otherwise you create infinite email loops.
Quality Checklist