v1.4 — Scoped grants for AI agents

An email API designed for agents,
not just users.

Power AI mail clients, agentic workflows, and inbox automation on real user accounts — with scoped grants that keep your agents on a leash.

Read the docs npm i @mailfrom/sdk ─ no message bodies stored · self-hostable
Provider support

Gmail-native today — covers ~80% of agent email. Outlook and IMAP are next; the SDK shape doesn't change when they land.

Gmail Generally available live
Outlook Private beta · Q2 beta
IMAP On the roadmap planned
Exchange On the roadmap planned
02 / Scope & grants

One privileged key.
Many short-lived agents.

Your server holds a privileged root key with full access to a connected account. For every agent task, mint a grant: a short-lived token scoped to specific capabilities, MCP tools, and a corner of the inbox. Expiry, revocation, and full audit log are built in.

capabilities TTL thread / label / sender pinning MCP tool subset signed audit log
[01] root key · privileged [02] grant · scoped [03] mcp tools · derived
root FULL
accountalex@acme.co
providergmail
caps*
scopefull
triage-agent ttl 15m
caps
metadata labels search
reply-drafter ttl 5m
caps
read draft search
sender-bot ttl 60s
caps
send
→ tools 3 exposed
thread.classify metadata
inbox.search search
label.apply labels
→ tools 3 exposed
thread.read read
inbox.search search
draft.create read + draft
→ tools 1 exposed
draft.send send
∀ tool ∈ registry : exposed ⇔ tool.requires ⊆ grant.caps three grants · three derived tool surfaces · same root key
03 / SDK

Standard mail ops.
One import.

List, search, send, draft, label, watch — across all providers, with a single normalised shape. The SDK is fully typed; the wire protocol is plain JSON over HTTPS.

mailfrom.messages.list paginated, normalised across providers
mailfrom.messages.send idempotent, with delivery receipts
mailfrom.threads.watch long-poll or webhook
mailfrom.search.query provider-native search, normalised results
mailfrom.grants.mint scoped, short-lived agent tokens
TypeScript Python cURL
POST /v1/messages
// Send a message on behalf of a connected account.
import { MailFrom } from '@mailfrom/sdk';

const mailfrom = new MailFrom({ rootKey: process.env.MAILFROM_ROOT });

const { id } = await mailfrom.messages.send({
  account: 'alex@acme.co',
  to:      ['ops@acme.co'],
  subject: 'Q3 sync — minutes',
  body:    { html: rendered, text: fallback },
  inReplyTo: 'msg_018f...',
});
↪ idempotency-key auto-attached ↪ p99 ≤ 280ms ↪ retries on 429 / 5xx
04 / Built for

What teams ship on MailFrom.

01 · AI mail clients

Replace the inbox.

Build a smart client on top of any provider. Threads, labels, search, drafts — normalised. Latency budgets that actually fit a UI.

→ threads.watch→ messages.search→ drafts.write
02 · Agentic workflows

Agents that handle email.

Mint a grant per task, hand the agent a token, watch it work within capability bounds. Revoke instantly. Every action signed and logged.

→ grants.mint(ttl)→ mcp tools subset→ signed audit log
03 · Inbox automation

Triage, route, respond.

Server-side rules, classifiers, and webhooks. Drop into existing pipelines. No SMTP, no IMAP plumbing, no provider quirks to chase.

→ webhooks→ normalised events→ idempotent sends
Storage

We don't store message bodies.

Metadata only — IDs, headers, thread structure — held just long enough to keep your app fast. Bodies and attachments are fetched on demand from the provider, streamed through, and forgotten. Nothing about a message persists on our servers after the request ends.

STORED
headers · ids · thread map
NOT STORED
bodies · attachments · search index
FETCHED
on demand, streamed
RETENTION
0s after request end
Deployment

Self-host for compliance.

For HIPAA, SOC 2 type II, and customers with stricter data-residency rules: run the full MailFrom stack inside your VPC. Same SDK, same API, same grants — just no traffic leaving your perimeter. Helm chart and Terraform module ship with the enterprise plan.

kubernetes
helm install mailfrom/mailfrom
terraform
module "mailfrom" { ... }
residency
your VPC, your keys, your logs
certifications
SOC 2 II · ISO 27001 · HIPAA BAA

Start with a key. Ship the agent.

Free up to 1k messages / month and 100 active grants. No card.