一键导入
agentmail-setup
Set up AgentMail direct and through Composio; diagnose send blocks, bounce suppression, and inbound vs outbound delivery failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up AgentMail direct and through Composio; diagnose send blocks, bounce suppression, and inbound vs outbound delivery failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Set up AgentCard MCP for Hermes.
Manage prepaid virtual Visa cards for AI agents with AgentCard. Create cards, check balances, view credentials, pay for things, shop and check out at merchants like DoorDash, close cards, manage plans, and get support. Use when the user wants to create or manage virtual payment cards for AI agents, pay for online purchases, shop on their behalf, set up agent spending, or configure card billing and limits.
Use when diagnosing, comparing, or tuning an AI agent's context window, token budget, output reserve, automatic compaction threshold, or provider-specific context cap. Separates model capability from route limits and client bookkeeping, verifies live metadata before editing config, and prevents unsafe fake context-length overrides.
Use when choosing Hermes vs Claude Code / Codex / Grok Build for coding work, wiring multi-CLI specialist setup, or diagnosing specialist auth/availability on Dewey.
Class-level workflow for configuring Hermes Agent messaging gateway platforms, especially QR/managed onboarding flows such as Telegram.
Use Orgo cloud computers via CLI and MCP.
| name | agentmail-setup |
| description | Set up AgentMail direct and through Composio; diagnose send blocks, bounce suppression, and inbound vs outbound delivery failures. |
| version | 0.3.2 |
| author | Hermes |
| metadata | {"hermes":{"tags":["AgentMail","Email","Composio","MCP","Outbound","Slack"]}} |
Set up AgentMail as an API-first email inbox provider for agents, either directly with AgentMail credentials/CLI/MCP or indirectly through Composio when a Composio-connected toolkit is available. This skill does not assume AgentMail is already connected in Composio; it verifies the available Composio surface first and uses exact tool slugs discovered at runtime. Dependency stance: use terminal for CLI/API checks and Hermes MCP configuration, and prefer environment variables over pasted secrets.
Also covers operational delivery failures: outbound 403 bounce suppression (send/block) and how that differs from missing inbound OTP/notices.
Also covers Dewey outbound send policy (always CC Nick, approval rules) and dual-channel notify (email + Slack) when the user asks to alert someone.
MessageRejectedError / 403 / Recipient(s) blocked … bounced (auto send-block suppression).Nick personal inbox triage — DUAL-SOURCE (+ Granola when asked) mandatory. If the user asks “what emails have I missed / should I get back to / catch up,” you MUST check BOTH mail sources, and Granola when they also mention meetings/follow-ups:
${OWNER_EMAIL} via Composio gmail toolkit (COMPOSIO_SEARCH_TOOLS → GMAIL_LIST_THREADS / GMAIL_FETCH_EMAILS paginated with page_token + hydrate in parallel via COMPOSIO_REMOTE_WORKBENCH ThreadPoolExecutor). Primary human mail. 200+ unread is normal; filter noisy senders (openrouter receipts, Mia watchdog alerts, Latitude, otter/fireflies/riverside, xfinity, slacks, linkedin). See references/personal-gmail-triage-via-composio.md.dewey@, orgo@, org@, momentum-amp@, ideabrowser@, alex_stbl@ via MCP list_threads. OTP/card noise usually; surface real human leads and vendor support. AgentMail alone is NEVER sufficient.granola_mcp. Prefer GRANOLA_MCP_QUERY_GRANOLA_MEETINGS for Nick-owned action items. List ranges serially (this_week / last_week / last_30_days) — parallel triple list often returns Rate limit exceeded.User correction “why not check composio” = first-class skill signal. Next session must start with both mail sources.
One-by-one action loop (Nick preference): When Nick says work through items “one by one,” do not batch-send after the triage board. For each item: (1) state what is known, (2) ask questions before proposing (slot, agenda, reply-only vs reply+calendar), (3) propose exact reply and/or calendar change, (4) execute only on explicit go, confirm ids, then advance.
https://console.agentmail.to, or use first-time agent signup.AGENTMAIL_API_KEY=am_....npm install -g agentmail-cli.https://mcp.agentmail.to/mcp.?apiKey=YOUR_API_KEY or x-api-key header.curl -fsSL https://composio.dev/install | bash, then composio login.COMPOSIO_API_KEY=....user_id; avoid default in production.agent_mail; its auth type is API key.AGENT_MAIL_CREATE_INBOX, AGENT_MAIL_GET_MESSAGE, AGENT_MAIL_LIST_INBOXES, AGENT_MAIL_LIST_MESSAGES, AGENT_MAIL_SEND_EMAIL.Use the terminal tool for all shell commands. Use search_files or read_file to inspect local .env files before changing configuration, and use patch or write_file rather than shell redirection when editing files. For Hermes MCP setup, first run hermes mcp add --help through terminal and then add the AgentMail server with a URL/auth form supported by the current Hermes build.
| Surface | Command / endpoint |
|---|---|
| Agent signup | agentmail agent sign-up --human-email you@example.com --username my-agent |
| Signup API | POST https://api.agentmail.to/agent/sign-up |
| Verify OTP | agentmail agent verify --otp-code 123456 |
| Verify API | POST https://api.agentmail.to/agent/verify |
| API key env | export AGENTMAIL_API_KEY=am_... |
| Create inbox | agentmail inboxes create |
| List inboxes | agentmail inboxes list |
| Send email | agentmail inboxes:messages send --inbox-id inb_xxx --to user@example.com --subject "Hello" --text "Hi there" |
| Reply | agentmail inboxes:messages reply --inbox-id <inbox_id> --message-id <message_id> --text "..." |
| List threads | agentmail inboxes:threads list --inbox-id inb_xxx |
| Webhook | agentmail webhooks create --event-type message.received --url https://example.com/webhook |
| AgentMail MCP | https://mcp.agentmail.to/mcp |
| Send block GET | GET /v0/lists/send/block/{email} |
| Send block DELETE | DELETE /v0/lists/send/block/{email} |
| Composio install | `curl -fsSL https://composio.dev/install |
| Composio login | composio login |
| Composio search | composio search "agentmail email inbox" |
| Composio link | composio link <toolkit> |
| Composio schema | composio execute <TOOL_SLUG> --get-schema |
Determine the requested access path.
Check local prerequisites. Invoke through terminal:
command -v node || true
command -v npm || true
command -v agentmail || true
command -v composio || true
printenv AGENTMAIL_API_KEY >/dev/null && echo AGENTMAIL_API_KEY=set || echo AGENTMAIL_API_KEY=missing
printenv COMPOSIO_API_KEY >/dev/null && echo COMPOSIO_API_KEY=set || echo COMPOSIO_API_KEY=missing
Completion criterion: you know which CLIs and keys are present without printing secret values.
Install the direct AgentMail CLI when needed. Invoke through terminal:
npm install -g agentmail-cli
agentmail --version
Completion criterion: agentmail --version exits successfully.
Obtain AgentMail credentials.
https://console.agentmail.to and store it as AGENTMAIL_API_KEY.agentmail agent sign-up \
--human-email you@example.com \
--username my-agent
Then set AGENTMAIL_API_KEY from the response and verify the OTP:
agentmail agent verify --otp-code 123456
Completion criterion: API key is available and verified if using first-time agent signup.
Smoke-test direct AgentMail. Invoke through terminal:
agentmail inboxes list --format json
agentmail inboxes create --display-name "Hermes AgentMail Smoke Test" --format json
Completion criterion: list succeeds and create returns an inbox identifier or email address.
Send only with explicit recipient approval (user-directed “send email to X” counts). Prefer both text and html. Always include cc: ["${OWNER_EMAIL}"] on every real outbound send so Nick can see it (standing Dewey rule). Default from-inbox for Dewey: ${AGENTMAIL_INBOX} (inboxId is that email string on the MCP send_message tool).
MCP example shape:
{
"inboxId": "${AGENTMAIL_INBOX}",
"to": ["recipient@example.com"],
"cc": ["${OWNER_EMAIL}"],
"subject": "...",
"text": "...",
"html": "..."
}
CLI (if installed): pass whatever CC flag the current CLI exposes; if none, send via MCP/API with cc.
If a send already left without Nick on CC, do not re-spam the primary recipient. Send Nick a separate copy (to ${OWNER_EMAIL} only) with the same body and a subject like Copy: <original subject>.
Completion criterion: send returns messageId/threadId and Nick is on the thread (CC or explicit copy).
Add AgentMail hosted MCP when the user wants MCP access. First inspect the active Hermes syntax:
hermes mcp add --help
Then add the hosted server using the current Hermes-supported URL flow. AgentMail’s hosted MCP server is:
https://mcp.agentmail.to/mcp
If the MCP client cannot do OAuth, AgentMail supports API key auth via:
https://mcp.agentmail.to/mcp?apiKey=YOUR_API_KEY
x-api-key: YOUR_API_KEY
Completion criterion: hermes mcp test agentmail or the equivalent current Hermes MCP test command succeeds.
Verify Composio AgentMail access. Install/login if needed, then invoke through terminal:
curl -fsSL https://composio.dev/install | bash
composio login
composio whoami
composio search "agentmail email inbox"
Expected toolkit slug from Composio's public toolkit page: agent_mail. Expected tools: AGENT_MAIL_CREATE_INBOX, AGENT_MAIL_GET_MESSAGE, AGENT_MAIL_LIST_INBOXES, AGENT_MAIL_LIST_MESSAGES, AGENT_MAIL_SEND_EMAIL. Completion criterion: Composio login succeeds and search or schemas confirm the agent_mail toolkit/tools for the active account.
Connect and execute through Composio only after discovering exact names. Use the exact toolkit and tool slug returned by composio search:
composio link <toolkit>
composio execute <TOOL_SLUG> --get-schema
composio execute <TOOL_SLUG> -d '{ /* schema-valid input */ }'
Completion criterion: schema retrieval succeeds and a low-risk read/list tool executes successfully.
For Composio SDK/MCP projects, use current v3 session patterns. Do not use old ComposioToolSet or app/action terminology. Python native-tools pattern:
from composio import Composio
composio = Composio()
session = composio.create(user_id="user_123")
tools = session.tools()
MCP pattern:
from composio import Composio
composio = Composio()
session = composio.create(user_id="user_123", mcp=True)
mcp_url = session.mcp.url
mcp_headers = session.mcp.headers
Completion criterion: the project stores the Composio session ID for reuse or can recreate a scoped session intentionally.
When MCP send_message or POST .../messages/send returns:
MessageRejectedError 403
Recipient(s) blocked: user@domain.com (bounced)
AgentMail is refusing the send before mail leaves. A previous delivery attempt bounced/rejected/complained, and AgentMail auto-added an org-level send block. Known-good customer addresses can still sit here after a one-off historical bounce.
# Never print AGENTMAIL_API_KEY
curl -sS -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
"https://api.agentmail.to/v0/lists/send/block/user@domain.com"
# 200 + reason "bounced" or "Unsubscribed via List-Unsubscribe" → suppressed; 404 → not blocked
# If JSON has read_only:true, DELETE returns 409 — do not loop; fall back to Nick Gmail Composio
# Known: opticalresourcesgroup@gmail.com (Mark/ORG) is read-only List-Unsubscribe; use ${OWNER_EMAIL} Gmail for Mark approval packs
# 413 on send: compress attachments to email JPEG or Drive-link large packs
# Only if address is known-good AND not read_only:
curl -sS -X DELETE -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
"https://api.agentmail.to/v0/lists/send/block/user@domain.com"
# expect 204; re-GET → 404; then resend (text + html)
Also: GET /v0/lists/send/block (paginated), GET /v0/lists/receive/block, GET /v0/metrics (message.bounced / rejected / complained).
| Pattern | Direction | Where to look |
|---|---|---|
403 blocked … bounced on send | Outbound | send/block auto-suppression |
| Third-party OTP never appears | Inbound | Inbox list + receive/block (often empty) — product/gate, not send-block |
| Other mail from same vendor does land | Inbound OK | Missing type is product-side |
Fallback: operator Gmail (Composio) if AgentMail still blocked or policy forbids unblocking.
Full cheatsheet: references/bounce-suppression-send-block.md.
composio search "agentmail email inbox" and use only returned toolkits/tool slugs.printenv NAME >/dev/null style commands.?apiKey= or x-api-key for clients that do not.to, cc, and bcc.text and html when possible; AgentMail docs call this a deliverability best practice.composio.create(user_id) and session.tools() or session.mcp.url; do not use old “entity ID,” “actions,” “apps,” or ComposioToolSet patterns.send/block first; often a one-line DELETE, not a domain investigation.${OWNER_EMAIL} on outbound AgentMail sends. Never omit because the message is “informal” or “internal.” Nick asked for visibility on every agent-sent email.references/outbound-cc-and-dual-notify.md. Slack workspace for Orgo is via Composio (SLACK_FIND_USERS → SLACK_OPEN_DM → SLACK_SEND_MESSAGE). Work emails can differ from Slack profile emails (e.g. Tiger: vault tiger@orgo.ai, Slack profile may be personal Gmail; name search works when email lookup returns empty).org@agentmail.to Jobber/Revo sequences): load customer-outbound-campaigns. Always-CC-Nick applies to one-off / operator-style sends, not every row of a 200+ drip — use campaign labels + Google Sheet tracking for bulk; still CC Nick when emailing Mark/Richard personally or sending approval links.AGENT_MAIL_LIST_MESSAGES / GET_MESSAGE) before writing new subjects.A setup is verified when this terminal check succeeds without exposing secrets:
agentmail inboxes list --format json >/tmp/agentmail-inboxes.json && \
python3 - <<'PY'
import json, pathlib
p = pathlib.Path('/tmp/agentmail-inboxes.json')
print('agentmail_direct_ok=', p.exists() and p.stat().st_size > 0)
PY
For Composio, additionally verify:
composio whoami && composio search "agentmail email inbox"
If the Composio search does not return AgentMail-specific tools, report direct AgentMail as working and Composio AgentMail access as unverified/unavailable in the current Composio surface.
Bounce fix is verified when: GET send/block/{email} is 404 after DELETE, and a subsequent send returns a real messageId/threadId.
Outbound policy is verified when every real send includes cc containing ${OWNER_EMAIL} (or a deliberate Nick-only copy if fixing a missed CC).
references/bounce-suppression-send-block.md — outbound 403 send/block diagnosisreferences/inbound-otp-vs-send-block.md — do not conflate inbound OTP miss with send-blockreferences/outbound-cc-and-dual-notify.md — always CC ${OWNER_EMAIL}; dual-channel email + Slack DM; Tiger lookup notesreferences/personal-gmail-triage-via-composio.md — personal Gmail triage via Composio (${OWNER_EMAIL}), priority rubric, deliverable shapereferences/composio-gmail-bulk-triage.md — bulk 200+ unread pattern, pagination, ThreadPoolExecutor hydration, noise denylist expansion (Jul 10 2026 session)