agentmail-to avatar

Agent Email Patterns

This is architectural guidance for agents that need to send and receive email, not SDK documentation. You get seven opinionated patterns: one inbox per agent (never share), two-way conversation loops using extracted_text to strip quoted replies, human-in-the-loop drafts for high-stakes messages, WebSockets over polling, multi-agent topologies with clear role separation, OTP extraction for verification flows, and labels for workflow state. The security section is brief but covers the critical stuff like prompt injection via inbound email and allow lists for production inboxes. Useful if you're building support bots, notification agents, or anything that needs structured email communication instead of just fire-and-forget sending.

skills.sh installs
903
GitHub stars
26
last updated
Aug 21, 2026

Install

$ npx -y skills add agentmail-to/agentmail-skills --skill agent-email-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Agent Email Patterns

Opinionated patterns for building AI agents that communicate over email. This skill covers architecture and security decisions, not SDK specifics. For AgentMail SDK usage, use the agentmail skill.

Why agents need their own inboxes

Giving an agent OAuth access to a human's Gmail account is the most common approach and the most dangerous:

  • Over-permissioned: typical OAuth scopes (e.g. gmail.modify) grant read/send/delete over the entire mailbox history, far beyond what any single task needs
  • Prompt injection risk: the agent inherits the full inbox history as reachable context, so any crafted email already sitting in the mailbox is a live attack surface
  • Revocation granularity: OAuth tokens are hard to revoke or scope per-agent -- pulling access from one workflow often means pulling it from all of them
  • Rate limits: consumer mailbox sending limits aren't designed for automated/programmatic workflows
  • Audit trail: agent actions are mixed with human actions in the same mailbox, making debugging and compliance review hard

The safer default: one dedicated, API-native inbox per agent (see Pattern 1).

Provider landscape

Sponsors

Details

Repository
github.com/agentmail-to/agentmail-skills
Categories
Backend & APIs, Security, Code Review & Quality, AI & Agent Building, Cloud & Infrastructure, Design & UI/UX
First seen
Jun 3, 2026

More from agentmail-to/agentmail-skills

All 7
1plastic-labs avatarhoncho-integrationplastic-labs/honchoIntegrate Honcho memory and social cognition into existing Python or TypeScript codebases. Use when adding Honcho SDK, setting up peers, configuring sessions, i903skills.sh installs
2pinchtab avatarpinchtabpinchtab/pinchtabUse this skill when a task needs browser automation through PinchTab: open a website, inspect interactive elements, click through flows, fill out forms, scrape 896skills.sh installs
3circlefin avatarswap-tokenscirclefin/skillsBuild token swap functionality with Circle App Kit or standalone Swap Kit SDKs. App Kit (@circle-fin/app-kit) is an all-inclusive SDK covering swap, bridge, and894skills.sh installs
4dimillian avatargithubdimillian/skillsInteract with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries. Use when the user asks 891skills.sh installs
5adobe avatarcontent-distributionadobe/skillsAEM as a Cloud Service content distribution and replication. Covers programmatic publishing using the Replication API and distribution event monitoring using Sl890skills.sh installs
6mindrally avatarperformance-optimizationmindrally/skillsPerformance optimization guidelines for web development including server-side rendering, CSS best practices, and JavaScript optimization883skills.sh installs