PRACTICAL AGENT EMAIL GUIDE
How to send and receive email safely with AI agents.
The short answer: give each agent a dedicated email identity, bind one scoped key to it, enforce rules outside the model, treat inbound mail as untrusted, and require human approval for consequential messages. TekMail packages that architecture behind REST and MCP.
No credit card required · One free agent · Paid plans from $5/month
Approval needed: vendor renewal
8 minfinance@northstar.example
highRe: Q3 market landscape brief
24 minmaya@acme.example
New support escalation #1842
41 minalerts@support.example
mediumYour API usage summary
1 hrreports@platform.example
Contract notes and next steps
2 hrlegal@partner.example
Security notice for integration
5 hrsecurity@vendor.example
mediumApproval needed: vendor renewal
From finance@northstar.example
To research-agent@agents.tekmail.app
10:42 AM
Northstar vendor operations
Renewal review requested
Hello Research Agent,
The annual vendor renewal is ready for review. Please summarize the updated terms and prepare a recommendation for Maya.
Requested workflow
- Review updated service terms
- Compare against last year
- Draft for human approval
THE SAFE ARCHITECTURE
Five boundaries that matter more than the model.
A capable model does not create a secure mail system by itself. Identity, enforcement, isolation, and observability have to live in infrastructure the model cannot rewrite.
- 1
Give the agent its own identity
Do not make autonomous software impersonate a person by default. A dedicated address keeps ownership, history, and revocation clear.
- 2
Bind credentials to one configured agent
The caller should not choose an arbitrary From address. Its key should select the agent, inbox, permissions, and rules on the server.
- 3
Enforce outbound rules before delivery
Apply recipient restrictions, suppressions, plan limits, content policies, and human review before a message enters the delivery queue.
- 4
Treat every inbound message as untrusted
Check authentication and risk signals, isolate attachments, and hold suspicious or consequential messages before an agent can act on them.
- 5
Make retries and outcomes observable
Use an idempotency key for each logical send, poll for replies, and retain delivery, approval, rejection, and failure status in an audit trail.
WORKING API EXAMPLES
Send once. Poll safely for replies.
Create the agent and key in the dashboard first. The same bearer token then selects that agent's sending address, permissions, rules, and isolated inbox.
curl -X POST https://api.tekmail.app/api/v1/send \
-H "Authorization: Bearer tk_your_api_key" \
-H "Idempotency-Key: task_01K_SEND_REPORT" \
-H "Content-Type: application/json" \
-d '{
"to": "customer@example.com",
"subject": "Your report is ready",
"text": "I completed the requested report."
}'curl \
"https://api.tekmail.app/api/v1/inbox/poll?since=2026-08-05T12:00:00.000Z" \
-H "Authorization: Bearer tk_your_api_key"
# Read a returned message
curl \
"https://api.tekmail.app/api/v1/inbox/in_message_id" \
-H "Authorization: Bearer tk_your_api_key"CHOOSE THE RIGHT MAIL BOUNDARY
Human assistant, send-only API, or agent inbox?
ONE IDENTITY PER AGENT
Keep the inbox when tools and models change.
A real inbox per agent
Each configured agent receives its own address, inbound history, threads, attachments, and searchable mailbox.
One scoped credential
The key selects one agent and its From address. Rotate or revoke it without exposing a human mailbox password.
Controls outside the model
Use permissions, rate limits, policies, quarantine, and human approvals at the email boundary.
Model and client agnostic
Connect through remote MCP or REST from Codex, Claude, Kimi, OpenCode, n8n, or your own runtime.
COMMON QUESTIONS
AI agent email FAQ
How can an AI agent send email?
Create a dedicated agent in TekMail, generate that agent's API key, and call POST https://api.tekmail.app/api/v1/send with the key as a bearer token. The configured agent—not a tool argument—determines the From address and applicable rules.
How can an AI agent receive email and replies?
Each configured agent gets an isolated inbox. Its key can list GET /api/v1/inbox, poll GET /api/v1/inbox/poll?since=ISO_TIMESTAMP, and read a specific message. Held or quarantined messages stay hidden until a human releases them.
Should I give an AI agent access to my Gmail account?
A Gmail connector can make sense when an agent assists a person inside that person's mailbox. For autonomous software, a dedicated agent address and scoped credential usually create a clearer identity, smaller blast radius, and more durable audit boundary.
How do I protect an AI agent from prompt injection through email?
Treat email bodies and attachments as untrusted input. Combine sender-authentication and risk signals with deterministic permissions, quarantine, allowlists, and human approval for consequential actions. No detector is perfect, so a classifier should not be the only control.
Does TekMail work with Codex, Claude, Kimi, and OpenCode?
Yes. TekMail is model and client agnostic. A configured agent can connect through TekMail's remote MCP endpoint or REST API. Each additional email identity requires its own configured agent and scoped key.
Can every AI agent have its own email address?
Yes. TekMail provisions a separate address and inbox for each configured agent. Plans limit how many agents and billable messages an account can use, and approved custom domains are available on eligible plans.
Stop making agents borrow human inboxes.
Start with one free agent, connect through REST or MCP, and keep its identity when your tools or models change.