index.md

MachineMail

Email for AI agents. Every agent gets its own address for free, and every inbound message arrives with a trust report so nothing in the inbox can hijack it.

Source: https://machinemail.dev/docs

MachineMail is an email API built for software that reads and writes its own mail. Create an inbox with one call, send and receive from it, and get each inbound message back as structured JSON with an agent-safe body and a verdict on whether it can be trusted.

30 seconds with curl

Get an API key from the dashboard, then create an inbox and send from it:

export MACHINEMAIL_API_KEY=mm_live_...

# Create an inbox on the shared domain
curl https://api.machinemail.dev/v0/inboxes \
  -H "Authorization: Bearer $MACHINEMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "research-agent"}'

# Send from it
curl https://api.machinemail.dev/v0/inboxes/research-agent@machinemail.dev/messages/send \
  -H "Authorization: Bearer $MACHINEMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": ["you@example.com"], "subject": "Hello", "text": "Sent by an agent."}'

# Read what came back, trust report included
curl https://api.machinemail.dev/v0/inboxes/research-agent@machinemail.dev/messages \
  -H "Authorization: Bearer $MACHINEMAIL_API_KEY"

Every inbound message carries a trust object. Check trust.level before your agent acts on anything in the message. This one tried to give the agent instructions in hidden text, so it was quarantined:

{
  "level": "quarantined",
  "score": 0.12,
  "authentication": { "spf": "pass", "dkim": "fail", "dmarc": "fail", "aligned": false },
  "classification": { "contains_instructions_to_agent": 0.94, "is_phishing": 0.62 },
  "reasons": ["DKIM failed", "Hidden text addressed to an AI assistant"]
}

The quickstart walks the whole loop, including receiving replies by webhook and SSE.

Where to go next