Email tenant isolation means each customer on a shared platform gets a sending identity — credentials, DNS records, and reputation signals — that can't bleed into anyone else's. For multi-tenant AI agent platforms, this isn't optional. One tenant with a misconfigured outbound flow can get every agent on a shared sending domain paused within hours.
This post covers the mechanisms in depth: how shared infrastructure creates blast-radius problems, how per-customer credential architecture works at the DNS and SMTP layers, and what your orchestration layer needs to enforce real boundaries.
Why shared sending domains fail multi-tenant platforms
Shared sending domains fail multi-tenant platforms because every sender on the domain shares the same IP reputation and DMARC alignment. When one tenant's agent triggers a complaint rate above 0.3% or a bounce rate above 5%, the entire domain's sending can be throttled or blocked by receiving mail servers — taking down every other tenant with it.
This isn't hypothetical. Google's Postmaster Tools measures domain reputation, not just IP reputation, and a domain-level spam rate above 0.1% triggers inbox filtering for all senders on that domain. When your platform has 500 customers all sending from agents.yourplatform.com, one bad actor can cause cascading deliverability failures for everyone.
The specific failure modes:
- Bounce contagion: one tenant imports a stale contact list and generates 15% hard bounces. Receiving MXs like Gmail and Outlook start applying domain-level skepticism to all mail from your sending domain.
- Complaint spillover: a tenant's agent sends automated messages a user didn't want. The user hits "Report Spam" in Gmail. That complaint is recorded against your sending domain in Google Postmaster Tools, raising the domain-level spam rate across all tenants.
- DMARC alignment pollution: if tenants send with
From: user@theirdomain.combut your platform signs with its own DKIM key on a different domain, DMARC alignment fails unless you've explicitly set up relaxed alignment or per-customer DKIM.
The architecture: per-customer sending identities
Real email tenant isolation requires three separate components: per-customer DKIM keys, per-customer SPF-aligned sending IPs or subdomains, and credential isolation at the application layer.
Per-customer DKIM signing
DKIM (DomainKeys Identified Mail) signs each outbound message with a private key. The corresponding public key is published in DNS as a TXT record at a selector address like s1._domainkey.customerdomain.com.
For true isolation, each tenant needs their own DKIM key pair:
- Generate a 2048-bit RSA or Ed25519 key pair for each tenant at onboarding time.
- Store the private key in your secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.), scoped to that tenant's service account.
- Publish the public key to their DNS via your API, or give them the TXT record to add themselves.
- Configure your sending infrastructure to use the tenant-specific key when signing outbound mail for that tenant.
The DKIM selector should be tenant-specific — something like mta1._domainkey.tenant-slug.yourplatform.com if you're sending on subdomains, or instructions for them to add mta1._domainkey.customerdomain.com if they bring their own domain.
Key rotation matters. Per-tenant keys mean you can rotate one tenant's key without touching anyone else's. Set a rotation policy (annually at minimum) and automate the DNS update.
SPF alignment
SPF authenticates the envelope sender (the MAIL FROM address used in the SMTP transaction), not the From: header. For alignment under DMARC, the domain in the MAIL FROM must match the domain in the From: header — or be a registered subdomain, for relaxed alignment.
For multi-tenant platforms, the common approach is subdomain per tenant: each tenant gets a sending subdomain like tenant-slug.mail.yourplatform.com. Their SPF record lives at that subdomain:
tenant-slug.mail.yourplatform.com TXT "v=spf1 include:sendinginfra.yourplatform.com ~all"
SPF lookups for that tenant's subdomain point to your sending infrastructure without touching other tenants' subdomains.
If tenants bring their own domain, they add your sending infrastructure to their own SPF record:
yourplatform.com TXT "v=spf1 include:spf.yourplatform.com ~all"
Never use +all or ?all — both are effectively no-ops and will fail DMARC enforcement.
DMARC per tenant
DMARC policies live at _dmarc.theirdomain.com. For custom-domain tenants, they publish their own DMARC record. For platform-subdomain tenants, you manage it.
Start tenants at p=none (monitoring) while their domain warms up, then graduate to p=quarantine and eventually p=reject. Use the rua tag to route aggregate reports to a per-tenant reporting address so you catch alignment failures early:
_dmarc.tenant-slug.mail.yourplatform.com TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports+tenant-slug@yourplatform.com; pct=100"
Parsing these RUA reports programmatically tells you which senders are failing alignment before recipients start filtering the mail.
Credential architecture for agent platforms
SMTP credentials in a multi-tenant agent platform need to be scoped to the tenant, not the platform. The goal: a credential leak for Tenant A cannot be used to send mail on behalf of Tenant B.
sequenceDiagram
participant Agent as Agent Runtime
participant Vault as Secrets Vault
participant MTA as Sending MTA
participant DNS as Tenant DNS
Agent->>Vault: Request creds for tenant-slug
Vault->>Agent: Return scoped SMTP credentials
Agent->>MTA: SMTP AUTH with tenant credentials
MTA->>DNS: Lookup DKIM key for tenant-slug
DNS->>MTA: Return public key for verification
MTA->>MTA: Sign with tenant private key
MTA-->>Agent: 250 OK message accepted
The secrets vault is the control plane. Each tenant gets:
- A unique SMTP username (typically
tenant-slug@mail.yourplatform.comor a UUID) - A unique SMTP password or API key, never shared with other tenants
- A policy binding that credential to only the allowed
FROMdomains/addresses for that tenant
That last point is critical. SMTP credentials that don't enforce sender binding let a compromised credential send from any From: address. Your MTA should validate at AUTH time that the authenticated identity is permitted to use the requested sender address.
For platforms built on a provider like SendGrid, Postmark, or Mailgun, per-tenant isolation maps to per-tenant subusers (SendGrid) or per-tenant sending domains with separate API keys. The API key is scoped to that domain and stored per-tenant in your vault.
For platforms using an agent-native email infrastructure, the agent model handles this natively — each agent address is provisioned with its own identity, its own DKIM signing context, and its own reputation tracking.
Reputation boundary enforcement
Credential isolation alone doesn't create reputation isolation. Reputation at receiving MXs is tracked by IP address and by sending domain. If multiple tenants share one IP, their bounce and complaint signals aggregate.
True reputation isolation requires one of:
- Dedicated IP per tenant: only practical for high-volume tenants (typically 50k+ emails/month). Below that threshold, a cold dedicated IP has worse deliverability than a warm shared IP.
- IP pool segmentation by tenant risk tier: low-volume or new tenants share one pool; established high-volume tenants get dedicated IPs or a separate warm pool.
- Subdomain reputation isolation: some receiving MXs (notably Gmail) track reputation at the subdomain level. Tenant subdomains partially isolate reputation at the domain level, though IP reputation still aggregates.
The practical implementation for most platforms: segment into 2-3 IP pools by tenant health score. Run automated reputation monitoring — bounce rate, complaint rate — per tenant. When a tenant exceeds thresholds (5% bounce, 0.3% complaint), pause that tenant's sending before it contaminates the pool. This is triage, not true isolation, but it limits blast radius.
Mails.ai's dedicated IP option works at the workspace level for Scale plan customers, keeping that workspace's reputation entirely separate from the shared pool.
DNS provisioning automation
Manual DNS provisioning doesn't scale. For a platform with hundreds of tenants, you need automated DNS record management.
The flow at tenant onboarding:
- Tenant registers their domain (or accepts your subdomain).
- Your onboarding API generates a DKIM key pair, stores the private key in Vault scoped to that tenant.
- Your API returns the DNS records the tenant needs to add: SPF TXT, DKIM TXT, DMARC TXT, and optionally an MX record for inbound.
- Your verification worker polls or uses a DNS-over-HTTPS API to confirm records propagated before activating sending for that tenant.
- Only after verification does the tenant's sending credential become active.
DNS propagation takes 0-48 hours depending on TTL. Set low TTLs (300s) on records during initial setup, then raise them once confirmed.
For the DKIM public key TXT record, the format is:
selector._domainkey.tenant.yourplatform.com TXT "v=DKIM1; k=rsa; p=<base64-encoded-public-key>"
If the public key exceeds 255 characters (common with 2048-bit RSA keys), it must be split across multiple quoted strings in the TXT record. Many DNS providers handle this automatically; some require manual chunking.
Inbound isolation
Tenant isolation applies to inbound mail too. If tenants receive mail on your platform, their inbound webhook handler should only receive events for their own addresses — never events meant for another tenant.
Your inbound email parsing infrastructure needs tenant-aware routing: the MX record for tenant.yourplatform.com points to your inbound MTA, which looks up the tenant by recipient address and fires the correct tenant's webhook. The webhook URL and signing secret must be per-tenant, so a leaked secret for Tenant A can't be used to replay events against Tenant B's handler.
Prompt injection is a real vector in multi-tenant agent platforms. An attacker on Tenant A could try to send crafted email to Tenant B's agent address if your routing has any ambiguity. Strict tenant-to-address binding — enforced at the MTA layer, not the application layer — closes this.
For classification flows, email classification on inbound should run in the context of the receiving tenant's agent, not a shared classifier that could leak signal between tenants.
Implementation checklist
- Per-tenant DKIM key pairs, stored in secrets manager, scoped to tenant service account
- Per-tenant SPF record (platform subdomain or customer domain)
- Per-tenant DMARC record starting at
p=none, graduating top=reject - SMTP credentials bound to allowed sender addresses at AUTH time
- Automated DNS provisioning and verification at onboarding
- Per-tenant bounce and complaint rate monitoring with automatic pause thresholds
- IP pool segmentation by tenant health tier
- Per-tenant inbound webhook URLs and signing secrets
- Tenant-scoped routing enforcement at the MTA layer, not application layer
- DMARC RUA report parsing per tenant for alignment failure early-warning
Frequently Asked Questions
Does per-tenant DKIM signing require each tenant to own a domain?
No. If tenants use your platform subdomain (e.g., tenant.mail.yourplatform.com), you control and manage the DNS records entirely. Per-tenant DKIM just means each tenant gets a unique key pair and selector published under their subdomain. Custom domains require tenant cooperation to add DNS records, but the key generation and vault storage is still on your side.
How is a dedicated IP different from per-tenant DKIM for isolation?
DKIM and SPF authenticate identity — they prove the message was sent by an authorized sender. They don't isolate IP reputation. A dedicated IP isolates reputation at the network layer: your sending IP isn't shared with other senders, so their bounce and complaint signals don't affect your domain's IP reputation at receiving MXs. For true isolation you need both: authenticated identity (DKIM/SPF/DMARC) and IP-level reputation separation.
What bounce rate threshold should trigger tenant suspension?
Google and Yahoo's 2024 bulk sender requirements set the bar at 0.3% for spam complaints and implicitly expect bounce rates under 5% for sustained sending. For a multi-tenant platform, it's safer to pause individual tenants at 3% hard bounce rate and 0.2% complaint rate — before they approach the threshold that would trigger receiving MX action on your sending domain.
Can a tenant use their own ESP while still on my platform?
Yes, but it complicates DMARC alignment. If a tenant sends through their own Mailgun or SendGrid account using their own domain, they publish their own DKIM and SPF records pointing to that ESP, and DMARC passes fine. The platform shouldn't intercept or re-sign that mail. The complication arises if you want unified observability — bounce, complaint, and reply events — across tenants using different ESPs. You'd need a per-tenant webhook or event-forwarding layer, which is non-trivial.
How do I handle DMARC aggregate report parsing at scale?
DMARC RUA reports are ZIP files containing XML. Each aggregate report covers a 24-hour period and lists the IP addresses that sent mail claiming your domain, the authentication results, and disposition counts. Parse them with a library like parsedmarc (Python) or a commercial DMARC reporting service. For multi-tenant platforms, the key signal is any row where SPF or DKIM alignment fails — that indicates a misconfigured tenant identity before it becomes a deliverability problem.
Does this architecture apply to AI agent platforms specifically, or any multi-tenant SaaS?
The mechanisms are the same, but AI agent platforms have higher risk exposure. Agents send automatically, often without human review of recipient quality. They may process inbound email that includes adversarial prompt injection attempts. And they're more likely to have bursty sending patterns that look anomalous to spam filters. For agent email platforms, the operational discipline around tenant isolation has to be tighter than for a standard transactional SaaS — the blast radius of a misconfigured agent is larger and faster.
Related guides: Agent Mail: What It Is and How It Works, Autonomous AI Agents vs. Chatbots: The Inbox Difference, Email Reply Threading: Multiple Agents, One Domain and Email Threading Across Provider Boundaries Explained.
Explore the product: Mails.ai vs SendGrid, Mails.ai vs Postmark, Mails.ai vs Mailgun, All features and Pricing.
