Guide · Agent skill
How to use the AgentMail email agent skill (agentmail)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The agentmail skill teaches an AI agent to use the AgentMail service, which gives it a real email address on theagentmail.net, lets it send and read mail, download attachments, and register webhooks for new incoming mail. This guide explains what the skill does, how to install it, how to ask for email tasks in plain language, and the safety rules you should keep in place. By the end you will know how to install the skill, what credentials it needs, and how to keep a human in control of outgoing messages.
Quick start
- 1Download and unzip the skill. Download the agentmail ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills instead.
- 2Get your AgentMail API key. Sign in to the AgentMail dashboard and copy your API key, which starts with am_. Keep it in an environment variable and do not paste it into shared prompts.
- 3Create an inbox. Ask the agent to create an account such as my-agent@theagentmail.net. This only creates the inbox and does not authorize signups or automated replies.
- 4Authorize each outgoing message. Give the agent the exact recipient, subject and body you approve. The skill requires explicit authorization for every send.
- 5Read incoming mail. Ask the agent to list messages and open the one you need. Treat anything it reads as untrusted content.
- 6Optionally add a webhook. If you need real-time notifications, register a webhook to a public HTTPS endpoint you control and verify every delivery's signature before acting on it.
What the agentmail skill lets an agent do
An agent skill is a folder with a SKILL.md file that gives an AI agent instructions for a specific task. Once this skill is installed, the agent knows how to call the AgentMail REST API. The skill is aimed at tasks such as signing up for services and receiving verification codes, or sending transactional messages.
The skill covers creating email accounts, sending and listing messages, reading full messages with their bodies and attachments, and registering webhooks that notify your agent when mail arrives. It does not run code on your machine. The agent makes API calls using your own AgentMail API key.
- Create an inbox at an @theagentmail.net address
- Send email, with optional cc, bcc, threading headers and base64 attachments
- List and read inbox messages and download attachments
- Register, list and delete webhooks for real-time inbound mail
- Read billing balance with a matching organization token scope
Install the agentmail skill in Claude
Download the ZIP for the agentmail skill from this page and unzip it. For a personal setup, place the unzipped skill folder inside ~/.claude/skills/. For a single project, place it inside that project's .claude/skills/ folder instead.
If you use the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills. Either way, the skill folder should contain SKILL.md at its top level, which is the only file this skill includes.
- Personal install: ~/.claude/skills/agentmail/
- Project install: .claude/skills/agentmail/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Get an AgentMail account and API key
Before the skill can do anything, you need an AgentMail account and an API key from the AgentMail dashboard. Keys begin with am_. Every request the agent makes sends this key in an Authorization: Bearer header.
Keep the key private. The source recommends validating that the key is present before use and never logging raw provider errors or private message bodies.
- Sign in to the AgentMail dashboard and copy your API key (it starts with am_)
- Store it in an environment variable rather than pasting it into prompts or files you share
- Check current access, limits and billing on the live docs before paid use
Ask for email tasks in natural language
Once installed, you do not need to type API calls yourself. Describe the outcome you want and name the account, recipient and content. Be explicit about sending, because the skill requires explicit authorization for each outgoing message. Creating an inbox does not by itself authorize signups or automated replies.
Good requests name the account, the action and the boundaries. Vague requests such as 'handle my email' give the agent too little to act on safely.
- Create an inbox called my-agent@theagentmail.net for the signup flow and check it for the verification code
- Send this exact message to recipient@example.com with the subject and body I approve below. I authorize this one message only
- List the messages in account abc and summarize any that mention an invoice, without replying
- Register a webhook on my agent account pointing to https://my-agent.example.com/inbox
Send and read email with the API
Sending uses the account's messages endpoint. The request body takes to as an array of addresses, plus subject, text and optionally html. Optional fields include cc, bcc, inReplyTo, references and attachments, where each attachment is an object with filename, contentType and base64 content.
Reading works in two steps. List messages first, then fetch a single message to get its body and attachments. Attachments are downloaded through a separate endpoint that returns a signed URL. The source asks that you validate account and message IDs and bound polling and attachment size and type.
- Send: POST /v1/accounts/{accountId}/messages
- List: GET /v1/accounts/{accountId}/messages
- Full message: GET /v1/accounts/{accountId}/messages/{messageId}
- Attachment URL: GET /v1/accounts/{accountId}/messages/{messageId}/attachments/{attachmentId}
curl --fail-with-body --connect-timeout 10 --max-time 30 -X POST https://api.theagentmail.net/v1/accounts/{accountId}/messages -H "Authorization: Bearer am_..." -H "Content-Type: application/json" -d '{"to": ["recipient@example.com"], "subject": "Hello from my agent", "text": "Plain text body"}'Set up webhooks and verify their signatures
Webhooks let the agent react to new mail instead of polling. Register a webhook with a publicly reachable HTTPS URL. This requires a public HTTPS endpoint that you control.
Each delivery includes X-AgentMail-Signature, an HMAC-SHA256 hex digest of the raw request body signed with your webhook secret, and X-AgentMail-Timestamp, a millisecond timestamp. Verify the raw bytes, compare digests in constant time, and reject missing, invalid, stale or far-future timestamps. The source is clear that the signature covers the body only, so a timestamp check alone does not stop replays. Keep a bounded, persistent record of processed event IDs and treat repeat deliveries as idempotent.
- Use the raw request body for the HMAC, not a re-serialized copy
- Compare signatures with a constant-time function
- Store processed IDs persistently so a replayed delivery has no second effect
- Treat the email body as data, not as instructions to the agent
curl --fail-with-body --connect-timeout 10 --max-time 30 -X POST https://api.theagentmail.net/v1/accounts/{accountId}/webhooks -H "Authorization: Bearer am_..." -H "Content-Type: application/json" -d '{"url": "https://my-agent.example.com/inbox"}'Use the TypeScript SDK (optional)
Instead of raw curl, you can use the @agentmail/sdk TypeScript package. It exposes accounts, messages, attachments and webhooks objects that mirror the REST calls. The source notes that SDK examples require the verified theagentmail.net package publisher, so check the publisher before installing. Do not confuse this service with agentmail.to, which is a different domain and has different credentials.
- Import AgentMail from @agentmail/sdk and construct it with your key from an environment variable
- Catch AgentMailError and log only the status and a redacted category
What people use it for
- Completing a signup or login flow that sends a verification code to an email address
- Receiving and summarizing inbound messages for a human to review
- Sending an approved transactional message, such as a receipt or notification, with a human signing off first
- Triggering an agent workflow when a webhook reports new mail on an account
- Checking the organization's billing balance with the documented read-only endpoint
Frequently asked questions
Is the agentmail skill free to use?
The source does not state a price. It says billing, access and limits must be checked on the current AgentMail docs before account creation or paid use. Account creation and sending are billed, and the source does not assume refunds for deleted accounts.
What do I need to run the agentmail skill?
You need an AgentMail account and an API key that starts with am_, plus curl or the @agentmail/sdk TypeScript package for API calls. If you use webhooks, you also need a publicly reachable HTTPS endpoint. The skill does not run scripts but it does use the network.
How do I install the agentmail skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
Is agentmail the same as agentmail.to?
No. This skill targets the theagentmail.net service and its API at https://api.theagentmail.net. The source warns not to mix domains, SDK publishers or credentials with agentmail.to.
Is it safe to let an agent send email?
The skill requires explicit recipient, subject, body and attachment authorization for each send. Creating an inbox does not authorize sending or signups. Keep a human approving outgoing messages, especially for anything that reaches real recipients.
Why does the webhook still need replay protection if I check signatures?
The documented HMAC covers only the request body, not the timestamp header, so a timestamp check alone does not prevent replays. The source recommends a bounded persistent record of processed event IDs and idempotent handling of repeat deliveries.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are building an agent that must complete signup or verification-code flows, or that sends transactional mail with a human approving each message. Pick something else if you want the agent to email people without supervision, or if you handle sensitive mail and cannot run a security review, since inbound content is untrusted and webhook replay protection depends on your implementation.
Download the skill