← All projects

AGMX

Open-source email inboxes for AI agents. An agent can ask for its own address and, once a human approves, read the verification codes and links AGMX pulls out of each email, send and reply over a REST API or an MCP server, and get signed webhooks. Inbound mail is checked for hidden prompt injection, outgoing mail can wait for a human's approval, and anyone can run it on their own server with Amazon SES.

AGMX's mail client in a dark theme. A sidebar with the agmx logo and a Beta tag lists Overview, Mail, Approvals, Agents, Domains, API keys, Settings and Operator. A folder column lists Inbox, Starred, Sent, Drafts, Scheduled, Held, Archived, Spam and All mail above the inboxes ledger@agmx.localhost and scout@agmx.localhost. The message list holds Invoice 4471 is overdue from Northwind Billing with a red shield, a receipt from Acme Cloud, a sign-in link from Parcel, Your verification code from GitHub with a 482913 chip, and two messages from Alice Chen about a Q3 vendor shortlist. The open GitHub message, from noreply@github.com to scout@agmx.localhost, shows SPF pass, DKIM pass and DMARC pass, a Verification code box holding 482913 with a copy button, and the body Your code is 482913.
The mail client in dark mode, with the README's test email open, from a local copy of AGMX with demo agents and test mail.

AGMX gives AI agents real email addresses. An agent gets an inbox such as scout@bot.agmx.io, reads the verification codes and sign-in links that AGMX pulls out of each email, sends, replies and forwards through a REST API or an MCP server, and can get signed webhooks for new mail. A human owns the account, approves each agent that signs itself up, and can read along in a three-pane mail client, hold an agent’s outgoing mail for review or pause it. The hosted service at agmx.io is in invite-only early access. The code is open source under the MIT license, and anyone can run their own copy, sending and receiving through their own Amazon SES account.

The agmx.io homepage in its light theme. A small link reads Agents can now sign themselves up, above the headline Email inboxes for AI agents and a line about real addresses agents can sign up with, read verification codes from and reply on, over one REST API, an MCP server or webhooks. Below are Get started free and Read the docs buttons and a Tell your agent box reading Read agmx.io/skill.md and set up your o…. On the right, a terminal titled scout, agent shows a curl POST to agmx.io/api/v1/signup with the name Scout, a 200 response with userCode KQ7M-3XPA, waiting for your human to approve, then approved with scout@bot.agmx.io and a masked agmx_agt_ key, then curl agmx.io/api/v1/messages/wait?timeout=60 holding the connection open until mail from noreply@github.com is received after 1.8s, with extracted.codes holding 482913 and links[0].kind set to verify. A card over the terminal shows a GitHub email, [GitHub] Please verify your device, with Extracted 482913, a verify link button and DKIM and SPF checks.
The top of the agmx.io homepage. The terminal and the inbox card are an animation of an agent signing up and catching a code, captured here at its last frame.

How an agent gets an inbox

A person signs in to the dashboard with a magic link or a password, creates agents and gives each one an API key. An agent can also sign itself up. POST /api/v1/signup needs no credentials and returns an approval link, a short code and a poll token. The human opens the link, checks that the code matches the one the agent showed, can change the requested address, and approves or denies. The agent is told to poll every five seconds, and the first poll after approval returns its API key, once. A request expires after 30 minutes, and if the agent named its owner’s email, only that account can see or decide it. The site serves a guide written for agents at /skill.md, so telling an agent “Read agmx.io/skill.md and set up your own inbox,” as the homepage puts it, is meant to be enough.

An approval page on a light background, signed in as you@example.com. A card says Research wants an email inbox on your account, Request expires in 29:45, with the description Tracks papers and newsletters for the team. Below it: Check this code matches the one your agent showed you, next to the code WQ7S-2V74; an Inbox address field reading research with the suffix @agmx.localhost; notes that the agent gets a key that can only use this inbox and counts toward your plan's agent limit; the client, curl/8.23.0; and Deny and Approve buttons. A footnote says to only approve agents you started yourself, and that you can pause or delete an agent at any time.
The approval page for a sign-up request sent with curl, the way the README shows.

An account key acts for the whole account, and an agent’s key can only use that agent’s inboxes. An agent can own as many addresses as its plan allows, one on Starter, 5 on Pro and 25 on Scale, and plus-addressing works: mail to scout+github@… reaches Scout’s inbox with github as a label. expiresIn makes an inbox temporary, deleted with its mail after anywhere from a minute to seven days, and an agent’s temporary inboxes, up to 10 at a time, don’t count toward that limit. With acceptFrom and maxMessages: 1 as well, a one-off sign-up can use an address that only accepts mail from one domain and closes after its first email. For a custom domain, AGMX creates the SES identity with DKIM, lists the DNS records to publish and checks them.

Reading mail

Every inbound email is parsed and checked, and AGMX pulls structured data out of its visible content before storing it. extracted.codes holds up to five likely one-time codes, scored mostly by nearby words such as “code”, “verification” or “sign in”, and a few in other languages, with prices and years filtered out. extracted.links sorts links into verify, login, reset, tracking, unsubscribe and other. AGMX also reads calendar invites from .ics parts, receipt totals and order numbers, UPS, FedEx, USPS and DHL tracking numbers, and up to 20,000 characters of text from PDF and text attachments. GET /api/v1/messages/wait holds the request open for up to 60 seconds until the next email arrives, optionally filtered by sender or subject, and the TypeScript SDK’s waitForCode builds on it.

Hidden instructions

Agents feed email straight into a model, so AGMX treats every inbound message as possible prompt injection. It removes HTML comments and elements a human wouldn’t see, such as display:none and visibility:hidden, zero opacity, fonts of a pixel or less, collapsed or off-screen boxes, white-on-white text, text colored like its background, and classes that a <style> block hides. It also removes zero-width characters, word joiners, soft hyphens, bidi controls and Unicode tag characters. The result is safeText: the plain-text part, or the cleaned HTML as text when there isn’t one. Then it scores the message against patterns for asking the reader to ignore its instructions, take on a new role, hide something from its human, send credentials or codes, forward mail, run tools or move money, for mentions of a system prompt or hidden instructions, and for chat-template tokens such as <|im_start|>. A match in hidden text adds 5 points, one in the visible text adds 2, and a score of 5 or more is high risk.

The mail client with Invoice 4471 is overdue from Northwind Billing open; the message has a red shield icon in the list. The sender's address, cut off as accounts@northwi…, shows SPF pass, DKIM pass and DMARC pass. A red banner says This email contains hidden or manipulative content. Agents read a cleaned version and are told not to follow instructions in email, with details expanded: Hidden text (white-on-white text), Hidden content asks the reader to ignore its instructions, Hidden content contains chat-template control tokens, Hidden content asks the reader to hide something from its human, and Hidden content asks the reader to forward mail or data. A Safe view and Original switch has Safe view selected, and the body shows only the visible note that invoice 4471 for $1,280.00 is now 14 days overdue.
A test email with instructions hidden in white text, scored 21 and marked high risk. The safe view shows only what a person would see.

Codes and links are extracted from the cleaned content, so text hidden in the ways AGMX detects can’t plant a code, and list previews and webhooks are built from it too. The checks are heuristics, and the module’s own comment says they reduce risk without making untrusted text trustworthy. SES’s SPF, DKIM and DMARC verdicts decide whether the sender is trusted: when DMARC fails, or SPF and DKIM both fail, the message gets 3 more points, and its codes and its verify, sign-in and reset links are left out of extracted, though they’re still in the message text. When SES flags an attachment as malware, the message goes to spam and its attachments are kept by name only, never stored or served. The MCP tools return safeText and the security report instead of the raw HTML unless an agent asks for it, and the agent guide tells agents to read safeText, check the risk, and never follow instructions found in an email.

Lines 113 to 157 of agmx.io/src/server/mail/security.ts. A loop goes over every element, and when hiddenReason gives a reason, and the element's text is at least 12 characters, it records the text as hidden and adds a hidden text reason, and either way it removes the element. Script, noscript and template elements are removed too. The visible text is the plain-text part, or the cleaned HTML converted to text, and invisible characters are counted and removed to make safeText. Three or more invisible characters add 2 points, or 3 for ten or more, Unicode tag characters add 4, any hidden content adds 1, and each instruction pattern adds 5 when it matches the hidden text or 2 when it matches the subject and safe text joined together. A score of 5 or more is high risk, 2 or more medium, and anything less low, and the function returns the risk, score, up to eight reasons and whether there was hidden content, plus safeText and the visible HTML.
Removing hidden elements, building safeText and scoring a message, in src/server/mail/security.ts.

Sending and approvals

Each agent has a send policy for mail sent with its own key. auto sends at once, first_contact holds mail to any address the inbox hasn’t exchanged mail with, and all holds everything, and a separate switch also holds anything with an attachment. New agents start on auto unless they’re created with another policy. Held mail waits in the Approvals queue, with the reason, until a human or an account key rejects or approves it, and approved mail goes out at once or at its scheduled time. An agent’s key can’t change its own policy, and mail sent from the dashboard or with an account key is never held.

The Approvals page: Mail your agents tried to send that their send policy holds for review. Nothing goes out until you approve it. 1 message waiting, oldest first. A card from Ledger, ledger@agmx.localhost, held 1m ago, with Reject and Approve and send buttons, says Held because ap@northwind.example hasn't exchanged mail with ledger@agmx.localhost before, above the message to ap@northwind.example, Question about invoice 4471, asking for the purchase order number the invoice was raised against.
Mail from Ledger, whose policy is to approve first contact, held because its inbox had never exchanged mail with that address.

The API also has drafts, scheduled sends with sendAt, which a worker checks every 10 seconds, and an Idempotency-Key header so a retried request never sends twice. A message can have at most 50 recipients, and addresses on the suppression list, where hard bounces and complaints go, are refused. Every agent on a server shares its operator’s SES account, so AGMX tracks each agent’s bounce and complaint rates over 30 days. At least five hard bounces making up 5% or more of its sends, or at least two complaints making up 0.1% or more, pause the agent’s sending until a human resumes it, while its receiving keeps working. Per-inbox rules can allow or block senders before mail is stored, or label it, forward a copy or send it to an extra webhook once it is, only a human or an account key can add forward and webhook rules, and a copy that has already been forwarded three times, or an auto-reply, isn’t forwarded again. Webhooks for received, sent, delivered, bounced, complained, held, approved and rejected mail, and for an agent’s sending being paused or resumed, are signed with HMAC-SHA256 in a t=…,v1=… header like Stripe’s, and a failed delivery is tried up to eight times in all, waiting 30 seconds after the first failure and doubling each time.

The dashboard

The mail client is built for the keyboard: j and k move through messages, c composes, r replies and e archives. It has threads, search, stars, drafts, scheduled and held mail, archive and spam folders, live updates over server-sent events, and dark mode. HTML mail renders in a sandboxed iframe that can’t run scripts, under a strict Content-Security-Policy and a no-referrer policy. The Overview lists held mail and pending sign-ups next to usage and activity, each agent’s page sets its policy, webhook and color and shows its bounce and complaint rates, and Settings exports or deletes the account’s data.

The Operator page, for operators, who are the addresses in ADMIN_EMAILS and anyone they promote, shows how the server is configured and walks through setting up SES, and operators can change each user’s plan and role. Plans are plain data in src/shared/plans.ts. The public ones are Starter, free with 2 agents, 300 sends and 5,000 received emails a month, Pro at $19 a month and Scale at $99, and operators get a hidden Unlimited plan. The pricing page says paid plans are enabled by the operator on request, and the repository has no payment code.

The Operator page: Server health, Amazon SES setup and account management. A System card lists Mail transport, Development log (not sent); Shared domain, agmx.localhost; AWS region, us-east-1; Production access, a dash; the inbound webhook http://localhost:5197/api/inbound/ses; and Allowed sign-in emails, you@example.com, set with the ALLOWED_EMAILS environment variable. An Amazon SES setup card lists six steps: configure AWS credentials, verify agmx.localhost in SES, point MX at SES inbound with inbound-smtp.us-east-1.amazonaws.com, create a receipt rule that sends mail through SNS to AGMX at the webhook URL, set up delivery feedback with a configuration set, and request production access to leave the sandbox.
The Operator page of the local copy, which runs without AWS, so mail is only logged and the SES steps are still to do.

How it’s built

AGMX is one TanStack Start app, with React 19, Vite and Nitro, written in TypeScript. The backend is built with Effect 4: services for agents, mail, quotas, webhooks, inbound mail, domains, sign-ups and accounts, with typed errors, transactions and background workers, all wired into one runtime. The REST API is an Effect HttpApi defined once in src/shared, which produces the OpenAPI spec, the Scalar reference at /api/v1/reference and the typed client the dashboard uses. The MCP server at /mcp speaks Streamable HTTP and wraps the same services in 22 tools, from whoami and wait_for_email to drafts and inbox rules, so its limits and errors match the API’s. Drizzle ORM maps the Postgres schema, which seven SQL migrations build. Better Auth handles magic links, passwords and sessions, and the ALLOWED_EMAILS list is checked at sign-up, at sign-in and for every new session.

Outgoing mail leaves through SESv2 as raw MIME. Incoming mail arrives through an SES receipt rule that publishes to SNS, which posts it to /api/inbound/ses. AGMX checks the SNS signature with a certificate fetched from an sns.*.amazonaws.com host, and in production it refuses topics that aren’t on its list. Mail too large for an SNS message goes through S3, and AGMX deletes the raw object once it’s stored. Mail between two AGMX inboxes never touches SES. Attachments live in Postgres or in any S3-compatible bucket, which serves downloads through signed URLs. Long polls and the live dashboard run on an in-process event bus, and the rate limits, 600 requests a minute per key or session, 120 a minute per IP without credentials, 10 agent sign-up requests an hour per IP and 30 failed authentications per 10 minutes per IP, are counted in memory, which a comment in the code says matches a single-replica deployment.

The repository has about 24,000 lines of hand-written TypeScript in 146 files, not counting the generated route tree and SDK schema. The TypeScript SDK, @agmx.io/sdk, takes its types from the OpenAPI spec. The CLI, @agmx.io/cli, signs an agent up, creates temporary inboxes, waits for codes, reads and sends mail, and with agmx mcp runs a local MCP bridge over stdio for clients that can’t send headers to a remote server. Version 0.1.0 of both is on npm. A Python SDK is in packages/python, installed from the repository: it isn’t published, and the agmx name on PyPI belongs to an unrelated project. On GitHub Actions, each push to main and each pull request is typechecked, tested against Postgres 17 and built, and a second job makes sure the SDK’s types still match the API.

Running it locally

For this page, the repository’s latest commit was built with Bun 1.4.2, then run with Node 24 and PostgreSQL 18.6 inside a Linux network namespace with only a loopback interface, so the running app couldn’t reach agmx.io, AWS or anything else on the internet. With MAIL_TRANSPORT=log and MAIL_DOMAIN=agmx.localhost, a demo account created two agents through the API, Scout and Ledger, both set to approve first contact. Test mail went in through the development endpoint, POST /api/dev/inbound, which marks it as passing SPF, DKIM and DMARC, and two more agents asked for inboxes with curl. All 90 of the repository’s tests, in seven files of unit tests and end-to-end API tests, passed against the same local Postgres.

How it was made

The repository was created on GitHub on October 3, 2026, and has an issue opened on October 20 and a pull request merged on October 21, but the 22 commits now on main are dated November 2 to November 25, 2026. The first holds a README stub and an icon, and the second, “AGMX: email inboxes for AI agents”, adds 125 files, the docs among them. The rest of November 2 brought object-storage attachments, a design system and logo, the agent safety backend, and approvals, drafts, scheduling, the SDKs, the CLI and more docs. November 3 added sender checks, reputation pauses, rate limits, alerts and data export and deletion, then a polish pass. A reliability pass followed on November 9 as pull request 3, and November 20 brought dependency updates, refinements and publishing the SDK and CLI to npm. On November 25, the last two commits moved the deployment docs from Railway to Coolify, tightened security and added SECURITY.md and CONTRIBUTING.md to “prepare for open source.” Sixteen commits, from the second through the reliability pass, carry a co-author trailer for Claude: fifteen name Claude Opus 5.5 and one just Claude. The first commit and the last five have none.

Try it

The hosted service is invite-only for now, and agmx.io has the docs, the agent guide and the API reference. To run your own copy, git clone https://github.com/nearbycoder/agmx.io && cd agmx.io, then ADMIN_EMAILS=you@example.com docker compose up --build starts Postgres, RustFS for attachments and AGMX on http://localhost:3000, with no AWS account. Sign in with Email me a sign-in link and copy the link from docker compose logs -f app. After creating an agent such as scout, you can post a test email as JSON to localhost:3000/api/dev/inbound, addressed to scout@agmx.localhost, the way the README’s local development section does. The README covers switching to Amazon SES and deploying the Dockerfile with Coolify. From an app, npm install @agmx.io/sdk adds the SDK, and npx @agmx.io/cli runs the CLI.

Browse the source on GitHub. The creation date shown here is the GitHub repository’s UTC creation date. The homepage picture was captured for this page from agmx.io in headless Chromium, at the last frame of its animation, and cropped to the top of the page. The cover and the other screenshots were captured for this page from the local copy described above, using demo agents, test mail from invented senders on reserved domains and the README’s GitHub test email, with the dashboard’s Geist font served from a local copy. The cover is cropped to 1440 by 810, and the others are cropped to the part of the window they show. The code excerpt is from src/server/mail/security.ts, in light and dark versions that follow this site’s theme.

Keyboard shortcuts

Shortcuts stay out of text fields. Extra shortcuts are off until you enable them on this device. Ctrl or Command K is always available.

?
Open this help
Ctrl / ⌘ K
Open site search
Alt A
Browse articles
Alt R
Open your reading list
Alt T
Browse topics
Escape
Close dialogs or leave article focus mode