Index of every page on this site: llms.txt
All skills
agentmail-to avatar

/agentmail

@8b3d9ae
Run it yourself

Build with the AgentMail TypeScript or Python SDK for inbox, message, thread, draft, attachment, domain, allow/block list, pod, webhook, and WebSocket workflows, including programmatic agent sign-up, domain/DNS administration, and deliverability triage (bounces, spam, blocked mail). Use when implementing or reviewing AgentMail API code; do not use for direct mailbox operations, CLI usage, MCP setup, or framework-toolkit integration.

Use this Skill: https://skilld.dev/gh/agentmail-to/agentmail-skills/agentmail

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceswebsockets.md

≈795 tokens on demand. Your agent reads this file only when SKILL.md points to it.

WebSockets

Use WebSockets for low-latency events without exposing a public webhook endpoint. Reconnect, resubscribe, and make event processing idempotent.

TypeScript

Current event objects use type: "event"; the API event name is in eventType.

import { AgentMailClient } from "agentmail";

const client = new AgentMailClient({
  apiKey: process.env.AGENTMAIL_API_KEY,
});
const socket = await client.websockets.connect();

socket.on("open", () => {
  socket.sendSubscribe({
    type: "subscribe",
    inboxIds: ["agent@agentmail.to"],
    eventTypes: ["message.received"],
  });
});

socket.on("message", (event) => {
  if (event.type === "subscribed") {
    console.log("Subscribed", event.inboxIds);
  } else if (event.type === "event" && event.eventType === "message.received") {
    console.log(event.message.subject);
  }
});

Do not compare event.type to message.received; that is an API event name, not the envelope discriminator.

Python

Use generated event classes, and inspect event.event_type when distinguishing received-message variants. For async code, use AsyncAgentMail and async with / async for — see python.md.

from agentmail import AgentMail, MessageReceivedEvent, Subscribe, Subscribed

client = AgentMail()

with client.websockets.connect() as socket:
    socket.send_subscribe(
        Subscribe(
            inbox_ids=["agent@agentmail.to"],
            event_types=["message.received"],
        )
    )

    for event in socket:
        if isinstance(event, Subscribed):
            print("Subscribed", event.inbox_ids)
        elif isinstance(event, MessageReceivedEvent):
            print(event.event_type, event.message.subject)

Explicitly subscribe to message.received.spam, message.received.blocked, or message.received.unauthenticated only when the credential has the required label permissions and the application intentionally processes those messages.

Event types

Event Python class TypeScript type
Subscription confirmed Subscribed AgentMail.Subscribed
New email received MessageReceivedEvent AgentMail.MessageReceivedEvent
Email sent MessageSentEvent AgentMail.MessageSentEvent
Email delivered MessageDeliveredEvent AgentMail.MessageDeliveredEvent
Email bounced MessageBouncedEvent AgentMail.MessageBouncedEvent
Spam complaint MessageComplainedEvent AgentMail.MessageComplainedEvent
Email rejected MessageRejectedEvent AgentMail.MessageRejectedEvent
Domain verified DomainVerifiedEvent AgentMail.DomainVerifiedEvent

Reconnection

The SDK does not auto-reconnect. Reconnect with exponential backoff and resubscribe on every connection:

backoff = 1
while True:
    try:
        with client.websockets.connect() as socket:
            socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
            backoff = 1  # reset after a successful connection
            for event in socket:
                ...
    except Exception:
        time.sleep(backoff)
        backoff = min(backoff * 2, 60)

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warnings1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides an SDK for the AgentMail email platform, enabling AI agents to manage inboxes, send messages, and handle webhooks. It follows security best practices by recommending environment variables for secret management and explicitly warning developers to treat all incoming email content as untrusted. No malicious patterns or unauthorized behaviors were detected.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

  • Runlayer9mo

    2/3 files flagged

  • ZeroLeaks7mo

    3 findings · Score: 69/100

Signed by skilld at 8b3d9ae. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 4 months ago

README badge

README badge for agentmail-to/agentmail-skills

AgentMail is an API-first email platform that gives AI agents dedicated email inboxes for sending, receiving, and managing messages programmatically. The SDK supports multi-tenant pods, label-based organization, draft creation for human approval, attachment handling, and real-time event notifications via webhooks or websockets. Available in TypeScript/Node and Python.

Generated from the current SKILL.md.

Does this support both TypeScript and Python?
Yes. The SDK is available for both Node.js/TypeScript (npm install agentmail) and Python (pip install agentmail).
Can I use custom domains for agent email addresses?
Yes. You can create inboxes with a custom username and domain (e.g., support@yourdomain.com) or let AgentMail auto-generate an address.
How do I set up real-time email notifications?
AgentMail supports both webhooks (HTTP-based, requires a public URL) and websockets (persistent connection, no public URL needed). See the webhooks.md and websockets.md reference files.
Does this support human-in-the-loop workflows?
Yes. You can create draft messages for human approval before sending them, then convert the draft to a sent message via the API.
How does multi-tenant isolation work?
Use pods to create isolated inbox namespaces per customer. Each pod gets its own set of inboxes scoped within it, useful for SaaS platforms.

Generated from the current SKILL.md. These answers refresh after source changes.