$npx -y skills add resend/resend-skills --skill agent-email-inboxUse when building any system where email content triggers actions — AI agent inboxes, automated support handlers, email-to-task pipelines, or any workflow processing untrusted inbound email. Always use this skill when the user wants to receive emails and act on them programmatica
| 1 | # AI Agent Email Inbox |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This skill covers setting up a secure email inbox that allows your application or AI agent to receive and respond to emails, with content safety measures in place. |
| 6 | |
| 7 | **Core principle:** An AI agent's inbox receives untrusted input. Security configuration is important to handle this safely. |
| 8 | |
| 9 | ### Why Webhook-Based Receiving? |
| 10 | |
| 11 | Resend uses webhooks for inbound email, meaning your agent is notified **instantly** when an email arrives. This is valuable for agents because: |
| 12 | |
| 13 | - **Real-time responsiveness** — React to emails within seconds, not minutes |
| 14 | - **No polling overhead** — No cron jobs checking "any new mail?" repeatedly |
| 15 | - **Event-driven architecture** — Your agent only wakes up when there's actually something to process |
| 16 | - **Lower API costs** — No wasted calls checking empty inboxes |
| 17 | |
| 18 | ## Architecture |
| 19 | |
| 20 | ``` |
| 21 | Sender → Email → Resend (MX) → Webhook → Your Server → AI Agent |
| 22 | ↓ |
| 23 | Security Validation |
| 24 | ↓ |
| 25 | Process or Reject |
| 26 | ``` |
| 27 | |
| 28 | ## SDK Version Requirements |
| 29 | |
| 30 | This skill requires Resend SDK features for webhook verification (`webhooks.verify()`) and email receiving (`emails.receiving.get()`). Always install the latest SDK version. If the project already has a Resend SDK installed, check the version and upgrade if needed. |
| 31 | |
| 32 | | Language | Package | Min Version | |
| 33 | |----------|---------|-------------| |
| 34 | | Node.js | `resend` | >= 6.9.2 | |
| 35 | | Python | `resend` | >= 2.21.0 | |
| 36 | | Go | `resend-go/v3` | >= 3.1.0 | |
| 37 | | Ruby | `resend` | >= 1.0.0 | |
| 38 | | PHP | `resend/resend-php` | >= 1.1.0 | |
| 39 | | Rust | `resend-rs` | >= 0.20.0 | |
| 40 | | Java | `resend-java` | >= 4.11.0 | |
| 41 | | .NET | `Resend` | >= 0.2.1 | |
| 42 | |
| 43 | Install the `resend` npm package: `npm install resend` (or the equivalent for your language). For full sending docs, install the `resend` skill. |
| 44 | |
| 45 | ## Quick Start |
| 46 | |
| 47 | 1. **Ask the user for their email address** — You need a real email address to send test emails to. Ask the user and wait for their response before proceeding. |
| 48 | 2. **Choose your security level** — Decide how to validate incoming emails *before* any are processed |
| 49 | 3. **Set up receiving domain** — Configure MX records for the user's custom domain (see Domain Setup section) |
| 50 | 4. **Create webhook endpoint** — Handle `email.received` events with security built in from the start. **The webhook endpoint MUST be a POST route.** |
| 51 | 5. **Set up tunneling** (local dev) — Use Tailscale Funnel (recommended) or ngrok. See [references/webhook-setup.md](references/webhook-setup.md) |
| 52 | 6. **Create webhook via API** — Use t |