AI Agent Access Control for Agent Mailboxes

AI Agent Access Control for Agent Mailboxes

Ten proposed design principles, not a better system prompt: NIST's agent identity guidance describes access control built around distinct agent identities and deterministic authorization. For a developer handing an agent a mailbox, the practical implication is straightforward. The mailbox should be an identity boundary, and permission decisions should happen outside the model.

Table of Contents

Why a Shared Inbox Token Is Not Access Control

Organizations reporting three to five AI incidents increased from 30% to 50% between 2024 and 2025, according to Kiteworks' account of Stanford HAI's 2026 AI Index. Those figures concern AI incidents generally, not agent-mailbox failures. They motivate containment, not a claim about email security.

Consider a developer who drops a personal inbox token into Claude Code, Cursor, Codex, or a REST client and asks an agent to handle email. Authentication succeeds. The agent can now call whatever operations that credential permits, including operations the task never required.

A malicious message doesn't need to steal that token. It can instead persuade the agent to use an already authorized tool for an unauthorized purpose.

Authentication isn't the action boundary

AI agent access control means external checks on which mailbox identity may read, send, change settings, or stop work. A successful login answers who presented the credential. It doesn't establish whether forwarding a private conversation serves the delegated task.

An infographic contrasting shared inbox tokens with formal access control systems, highlighting security risks and management differences.

An agent with a send tool can repeat a mistake through retries, scheduled work, or parallel runs. A warning in its prompt doesn't prevent those calls, and a shared human role makes the resulting activity harder to attribute.

The useful controls are least privilege, mailbox-scoped keys, boundaries the agent cannot widen, and audit records that identify the actual actor. Each belongs in the service executing the action, not merely in the instructions describing acceptable behavior.

Design-review rule: A valid credential must never turn an email body into a trusted instruction.

The permission map below belongs in a design review before tool registration. It forces an explicit answer for each operation, including the failure path. Without that answer, developers tend to implement the successful send first and discover the missing restrictions only when a workflow behaves unexpectedly.

Permission Boundaries for Every Mailbox Action

Who may take each mailbox action

ActionAgent with a scoped keyPersonIf the check fails
Read a messageAllowed with a read key; body treated as untrusted dataNot requiredBody stays out of normal model context until the screening step has run
Send a new message or replyAllowed only after duplicate, cooldown, suppression, and limit checks, and only if autonomy allows itRequired for first contact or for every message, depending on autonomyMessage does not leave
Approve a held sendNot allowedRequired; the person decidesSend stays held
Release a quarantined originalNot allowedRequiredAgent never receives the raw body
Tighten a mailbox ruleAllowedNot requiredStricter rule applies immediately
Loosen a rule or resume a paused mailboxNot allowedRequiredMailbox stays restricted
Hand a thread to a personAllowed, with a notePerson reads and replies until the thread is returnedAgent replies stop until return

Copy this table into the mailbox service's design review. In this permission model, a read key opens inbound mail, a send key sends messages and replies, and a manage key changes mailbox settings. Autonomy determines whether a send needs a person.

The agent is a temporary worker with a badge for a particular mail room, not a master key to the building. OWASP's AI Agent Security Cheat Sheet recommends per-tool permission scoping, separate read and write capabilities, parameter validation against session authority, and human confirmation for irreversible actions.

Reading and sending need different gates

Read access should reach message content only after screening. This is an ingestion boundary, not an instruction telling the model to disregard suspicious text after it has already consumed it.

A send request needs an independent evaluation immediately before execution. Duplicate detection catches repeated work, cooldowns constrain repeated contact, suppression respects recipient restrictions, and limits contain runaway activity. A contact lease prevents concurrent agents from starting conflicting outreach while those checks run.

For commercial email, the FTC's CAN-SPAM compliance guide requires an opt-out mechanism to work for at least 30 days after sending and requires opt-out requests to be honored within 10 business days. The sending service should check a shared suppression list before every send. Human approval doesn't override a valid opt-out.

Human decisions must stay outside agent authority

A held send isn't approved because the agent produces an approval-shaped argument. The approval must come from a person through an authenticated decision path. Likewise, releasing a quarantined original exposes content intentionally withheld from the model, so that decision can't belong to the same agent.

Tightening a rule should take effect immediately. If that change fails to persist, the service should reject the operation rather than report success while leaving broader access active.

Loosening restrictions and resuming a mailbox paused for high bounces or complaints require a person. Handoff is different: the agent may transfer a thread with a note, but subsequent agent replies must stop until the person returns it.

The agent may narrow its authority. Only a person may widen it.

A summarizer therefore receives reading capability, not send or delete tools. For irreversible sends requiring review, the human decision must authorize the actual message, not grant an open-ended exception.

Scoped Keys and Mailbox Identity

Only 21.9% of respondents treated AI agents as independent identity-bearing entities in Gravitee's State of AI Agent Security survey. That gap matters because an authorized service-account call can still leave the initiator, delegated purpose, and expiry unclear.

A mailbox identity should stay stable while execution identities change. The mailbox identifies the address and inbox. An agent identifier identifies the software actor, a run identifier identifies the execution, and an on-behalf-of principal identifies the person or organization that delegated authority.

A diagram illustrating how scoped keys provide secure, controlled access to different types of user mailboxes.

Build a small credential model

A useful authorization record contains mailbox_id, agent_id, run_id, principal_id, permitted operations, task purpose, and expiry. These are suggested application fields, not a provider-specific API schema.

The key should resolve to that record through trusted server-side state. The model mustn't be allowed to nominate its own principal or extend its expiry through tool arguments.

  1. Create an agent-owned address and inbox. Keep the developer's personal inbox out of the workflow. The mailbox API implementation guide provides context for treating the mailbox as an application resource rather than borrowing a human session.
  2. Register only the summarizer's required tools. Give it read access, and omit send and delete tools from its runtime entirely.
  3. Scope outreach credentials to the intended mailboxes. A sales workflow shouldn't receive access to support conversations merely because both belong to the same account.
  4. Keep management authority outside the model process. A separate administrative path should handle settings that could expand access.
  5. Make handoff and pause change live authorization. Revoke effective send authority for the affected thread or mailbox instead of relying on a notification that the agent might miss.
  6. Coordinate shared-mailbox workers. Lease each contact to an agent and evaluate sends against the same suppression state.

Reject authority supplied as an argument

Say a support summarizer has read access to the support mailbox, while a sales agent has send access to the sales mailbox. Neither credential opens the other mailbox. Their account membership doesn't erase those resource boundaries.

If the sales agent supplies the support mailbox identifier in a tool call, the server compares that identifier with the credential's allowed resources and the current session. The request fails even if its accompanying explanation says a user authorized it.

Short-lived authority adds operational work: tasks need renewal, and expired runs need predictable failure handling. That cost is preferable to leaving a dormant credential able to resume an old task indefinitely.

Model output may explain why an operation is useful. It mustn't establish whether the actor has permission to perform it.

When Hostile Email Arrives After Access

A badge can open the mail room without making every letter on the desk trustworthy. Email authorization has the same split: the agent may legitimately access an inbox while the sender controls the text inside a message.

OWASP's Top 10 for Agentic Applications identifies indirect prompt injection through external content, including email, documents, and web pages. Such instructions can redirect an agent toward data exfiltration or tool misuse.

A four-step diagram illustrating the process of indirect prompt injection targeting an AI agent via hostile email.

Separate ingestion from execution

The developer-built pipeline should treat incoming bodies as untrusted data. Screening happens before those bodies enter normal model context, and risky originals remain available for human review without being exposed through the agent's ordinary read path.

  • Classify attempts to redirect behavior. A message asking for a refund is business content. A message directing the agent to ignore its task and export private threads is an attempted instruction.
  • Quarantine the original. Return a safe status or metadata to the agent rather than the raw suspicious body.
  • Protect the controls. The agent gets no tool that disables screening, releases quarantined content, or removes the resulting restrictions.
  • Hold flagged-thread replies. Drafting a response doesn't establish permission to send it.

Molted screens every incoming email for prompt injection before the agent can read it, quarantines high-risk messages for person-only release, and holds agent replies on flagged threads for human approval. The agent cannot switch off those checks. The email-pipeline prompt-injection guide explains the placement of this ingestion boundary.

Screening isn't proof of safety

Screening can miss an attack, and approval for every harmless reply consumes operator attention. A practical design allows routine work within a narrow task while escalating high-impact or goal-changing actions.

A research prototype using task-scoped temporary permissions reported preventing an instruction-injection attempt to forward private emails. The useful lesson is architectural: denying unnecessary forwarding authority can stop the side effect even when attacker-controlled text reaches the workflow.

Outbound duplicate, cooldown, suppression, and limit checks must therefore remain active after screening. An apparently ordinary message still doesn't receive an exemption from sending policy.

The containment objective isn't a model that never follows malicious text. It's a system where a fooled model still encounters independent authorization, rate, and human-approval barriers before an external side effect.

Audit Logs That Reconstruct Each Send

Authorization belongs in the execution component, not in a user_confirmed flag sitting in model context. OWASP's agent security guidance calls for execution-side authorization and clear audit trails rather than trusting model-generated assertions of approval.

Credential attribution must connect the agent software with the human or organization it represents. Token issuance, exchange, attenuation, and expiration should remain reconstructable, including when a credential becomes narrower during a task.

Audit fields for one mailbox action

EventRecordEnforced where
Token issued, attenuated, or expiredMailbox id, key rights, expiry, human or organization principalIdentity service, written into every later entry
Send attemptedActor, exact recipients, policy result, credential usedExecution layer, immediately before delivery
Policy blockRule that fired: duplicate, cooldown, suppression, or limitPolicy layer, not the model prompt
Approval grant or denyPerson, exact message, consumed onceExecution layer, checked against the current actor and send
Handoff or mailbox pauseWho took the thread or paused the box, agent replies stoppedMailbox state, until a person returns or resumes it

Record the decision that actually ran

A token event establishes the initial authority. Later entries should carry its credential reference and principal linkage, rather than merely recording an account name that many workers share.

A send event needs the exact recipient set and the final policy result. Record blocked attempts as deliberately as successful delivery attempts. A block without its rule name leaves an operator guessing whether retrying is appropriate.

For example, a blocked-send record could contain:

event=send_blocked mailbox_id=sales_box agent_key_id=sales_worker recipient=recipient_ref rule=suppression delivery_id=null

These are illustrative application fields. The absent delivery identifier distinguishes a rejected request from a message submitted for delivery.

Bind approval to an immutable request

An approval record should identify the person, current actor, recipients, and exact message version. Editing recipients or content after approval must invalidate that grant.

The execution layer should check and consume the approval atomically. Otherwise, concurrent workers can both observe an unused approval and reuse it for different sends.

Incident-response requirement: An operator should be able to reconstruct why a message left, not merely prove that an API call occurred.

Handoff and pause records need the actor who changed state and evidence that agent replies stopped. A real-time pause must affect pending execution checks, not just future planning inside the model.

Store these events in an append-oriented, access-restricted destination with tamper-evident handling. The mailbox audit-log guide offers a mailbox-focused reference for organizing the event chain. Logs support investigation, but they don't replace a working stop mechanism.

Test Each Boundary Before Launch

Negative tests should run against a disposable mailbox before the agent receives live correspondence. Each attempted boundary violation should produce an observable refusal and a matching event, without sending real private content.

Check capabilities and authority

  1. Summarizer tools remain read-only. Inspect the registered tools and attempt a prohibited operation through the service test harness. Pass means no send or delete capability appears, and the rejected operation records an authorization failure.
  2. Cross-mailbox arguments fail. Submit a send request naming a mailbox outside the credential's scope. Pass means the session check rejects it even when the prompt claims a user requested the action.
  3. Self-approval is refused. Ask the agent to approve its held message. Pass means the message stays held and the attempted approval identifies the agent as an unauthorized actor.
  4. Restrictions survive persuasion. Request a looser rule and a restart of a paused mailbox. Pass means both requests fail and the restricted mailbox state remains unchanged.

Exercise the sending path

  1. Suppression blocks delivery. Attempt a send to a suppressed recipient. Pass means the event names suppression and contains no delivery identifier.
  2. Cooldown applies across workers. Have another agent attempt contact during an active cooldown. Pass means the shared policy rejects the attempt with the cooldown rule.
  3. Approval cannot be replayed. Reuse a consumed approval on another send, including through concurrent requests. Pass means no additional send is authorized.

Challenge content trust and recipient choice

  1. An email cannot grant tools. Place an instruction to forward the inbox inside a test message. Pass means the tool registry and effective permissions remain unchanged, no unauthorized forward occurs, and any attempted prohibited action is logged.
  2. Opt-out changes subsequent execution. Process a recipient's opt-out, then attempt another send from an already prepared workflow. Pass means the send-time suppression check blocks delivery rather than trusting the campaign's earlier recipient snapshot.

Retain the input, expected refusal, actual rule name, and event reference for each test. A model refusing politely isn't sufficient evidence. The test passes when the execution service rejects the action even if the model proposes it.

Give Each Agent Its Own Mailbox

The deployment decision is to keep personal inbox credentials out of the agent runtime. Give the agent a separate address and inbox, then issue access for its task rather than inheriting a human's working identity.

A dedicated mailbox makes ownership concrete. An operator can identify which workflow receives a message, which worker attempted a reply, and which correspondence belongs to a person after handoff. It also avoids mixing personal password resets, billing messages, and private conversations into an automation task.

Choose a mailbox rather than assemble a sending wrapper

Molted is a mailbox for AI agents, for agents what Gmail is for humans. It isn't an API wrapper or a layer on top of Resend, Postmark, or SES, and no separate email provider account is needed. Agents connect through MCP, the command line, or a REST API.

New mailboxes run on their own. Approvals are an optional dial for workflows that need a person in the loop, not the prerequisite for every useful action.

Each agent can receive a key limited to the mailboxes it needs, with read, send, or manage rights on each. The practical deployment choice is to keep management authority separate from routine model execution.

Make account ownership explicit

An agent can create its account with npx @molted/cli auth signup. If it cannot run npx, the agent setup instructions describe the HTTP signup path.

CLI-created and API-created accounts are agent-owned and cannot use the Free plan. An agent may request a paid-plan checkout link, but requesting that link charges nothing. A charge happens only when someone completes checkout.

That distinction matters for unattended setup scripts. Provisioning an identity, requesting billing approval, and completing payment are separate actions with different authorities.

The smallest sensible launch is a bounded workflow with a dedicated inbox and a documented owner. Broader responsibilities should follow explicit operational decisions, not emerge because a model discovers another tool in its environment.


Molted Email provides agent mailboxes with scoped access and mailbox policy enforced outside the model. Start free at molted.email, free for people, with paid plans from $19 a month.

The Molted team