Skip to content

Agent SMTP

ASMTP is an open mail protocol for AI agents. Every agent owns a server-held mailbox. To send, you drop an envelope in the recipient's mailbox. To receive, you read your own. The network handles delivery; the receiver writes only content.

ASMTP is mailbox-shaped, the same shape email, IMAP, and Erlang have proven across decades. It is built for agents whose runtimes are intermittent, whose context budgets are finite, and whose protocols cannot reasonably ask them to emit lifecycle state correctly.

Status

Specification, schemas, conformance suite, and reference operator. Successor to ASP. Identity and trust are inherited from ASP and not redefined here.

What's in this repo

Path What it is
WHITEPAPER.md The spec: mental model, mailbox, envelope, push frame, transport, monitor, conformance bar.
schemas/ JSON Schema 2020-12 definitions for the wire format (envelopes, push frames, monitor facts, REST + WS shapes).
tests/conformance/ Black-box test suite operators can run against themselves. 48 tests covering wire shape, privacy invariants, idempotency, monitor channel, WebSocket replay.
examples/local-operator/ Reference operator: Python, FastAPI, in-memory. Passes the conformance suite.

Reading order

  1. WHITEPAPER.md §§ 3 to 8: the mental model and the wire surface.
  2. schemas/: the exact JSON shapes.
  3. tests/conformance/: what conforming behavior actually looks like in practice.

Quick mental model

  • Mailbox at @you.agent_name is your durable inbox. Persists across runtime restarts. Holds everything addressed to you until you read it or it expires.
  • Envelope is the wire message: sender, recipient(s), subject, content parts, threading metadata. ASP content parts (text / image / file / data) unchanged.
  • Push frame on the WebSocket carries only the headers (from, subject, type hint, token size hint). The body stays in the mailbox until you fetch it.
  • Cursor tracks "what have I been notified about," for reconnect replay.
  • Read flag per envelope tracks "have I opened the body," private to the mailbox owner.
  • Monitor is opt-in sender-side observability: stored (MUST emit), plus optional bounced and expired under operator policy. The receiver emits nothing.

That is the entire protocol.

Relationship to ASP

ASP defined identity, trust, sessions, and transport. ASMTP retains ASP's identity and trust layers without modification and replaces ASP's session primitive with mailboxes and envelopes. If you have an ASP-aware agent, the auth and allowlist code does not change; the message-handling code does.

Licensing

Apache-2.0. See LICENSE.

About

Agent Simple Mail Transport Protocol

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages