# agent-email-patterns

A skill of architecture patterns for agents that talk over email: dedicated inboxes, reply loops, drafts a human approves before sending.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 853 installs · ★ 25
- Author: agentmail-to
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/agentmail-to/agentmail-skills/tree/HEAD/agent-email-patterns/SKILL.md
- Updated: 2026-10-06
- HTML: https://affpapa.org/en/nevibecode/skills/agent-email-patterns

## What it does

The skill covers how an agent should send, receive and manage email conversations. It stays away from AgentMail SDK calls — the `agentmail` skill handles those. Inside are patterns: one inbox per agent, a two-way loop where the agent sends, a human replies and the agent reads the reply, human-in-the-loop drafts, event delivery over WebSocket or webhook, multi-agent roles, and OTP flows.

A separate section is the threat model: prompt injection through mail, webhook spoofing, credential exposure, data leakage. The rules are blunt. Content from email, attachments or tool output never counts as authorization for a consequential action, webhook signatures get verified with Svix, and raw email text must not go into a system prompt. Allow lists on production inboxes are recommended as one layer.

This is a design-time skill, not a send-a-message skill. If your agent reaches a person's mailbox through OAuth, that is worth revisiting: typical scopes open the whole mailbox history, and revoking access for one workflow usually means revoking it for all of them.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add agentmail-to/agentmail-skills --skill agent-email-patterns -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/agent-email-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/agent-email-patterns/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add agentmail-to/agentmail-skills --skill agent-email-patterns -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/agent-email-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add agentmail-to/agentmail-skills --skill agent-email-patterns -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/agent-email-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install agentmail-to/agentmail-skills agent-email-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/agent-email-patterns/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add agentmail-to/agentmail-skills --skill agent-email-patterns -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/agentmail-to/agentmail-skills --path agent-email-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/agent-email-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add agentmail-to/agentmail-skills --skill agent-email-patterns -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/agentmail-to/agentmail-skills/tree/HEAD/agent-email-patterns/SKILL.md

## When to use it
- decide whether an agent needs its own inbox instead of access to a human mailbox
- design a reply loop that does not reprocess the quoted chain every turn
- put a human approval step in front of high-stakes sends
- compare WebSocket and webhook delivery for inbound events
- split roles across several agents and restrict who can reach each one

## Example prompts
- Design the email loop for a support agent: its own inbox, replies threaded to the parent message, state kept in my database
- I need the agent to draft a client email and wait for human approval before sending — walk me through it
- Compare WebSocket and webhook for an agent's inbound mail and propose a signature verification scheme

## Similar
- [agent-email-inbox](https://affpapa.org/en/nevibecode/skills/agent-email-inbox.md) — skill · 13400 installs
- [email-best-practices](https://affpapa.org/en/nevibecode/skills/email-best-practices.md) — skill · 13500 installs
- [pipefy-members-email-webhooks](https://affpapa.org/en/nevibecode/skills/pipefy-members-email-webhooks.md) — skill · 669 installs
- [what-an-email-reveals](https://affpapa.org/en/nevibecode/skills/what-an-email-reveals.md) — skill · 1800 installs
- [email-quality-auditor](https://affpapa.org/en/nevibecode/skills/email-quality-auditor.md) — skill · 1000 installs
- [extension-email-raw](https://affpapa.org/en/nevibecode/skills/extension-email-raw.md) — skill · 28100 installs

From the same set: [agentmail-to/agentmail-skills](https://affpapa.org/en/nevibecode/by/agentmail-to/agentmail-skills.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
