Agents · 6 min read · Nov 17, 2026

How to give an AI agent email access with a person in control

By Lockally Team

Short answer: give the agent its own address, grant it only the mailboxes its job needs, keep it drafting rather than sending until you trust it, hold anything that starts a conversation, adds a recipient, carries personal data or answers a suspicious message, and keep a log of every read and send. Then make sure one person can switch it off in seconds.

Below are the eight steps in order, with the rules we use ourselves. They apply whichever provider you use; where Lockally does something specific, we say so.

1. What job is the agent doing?

Write it in one sentence before you touch a setting. “Answer delivery questions sent to support@ and hand everything else to a person” is a job. “Help with email” is not.

The sentence decides everything after it: which mailboxes, whether it needs to send at all, and what counts as “everything else”. Agents with one narrow job are easier to grant, easier to test and easier to audit. If you have two jobs, run two agents.

2. Does the agent need its own address?

Yes, almost always. An agent working inside a person’s mailbox sends as that person, sees everything they see and cannot be switched off without locking them out. Give it an address of its own, such as support-agent@yourcompany.com, so its mail is labelled as its own. We explain why this matters in email for the agent era.

3. How narrow should its access be?

As narrow as the job sentence allows. In practice that means:

  • Grant mailboxes, not the account. Each API key is granted specific mailboxes; a key granted support@ cannot see any other mailbox.
  • Never hand over a password. Use an API key or an OAuth connection that can be revoked without changing anyone’s sign-in.
  • Keep sensitive mailboxes out of reach. On Lockally, a mailbox with end-to-end encryption switched on can never be granted to an agent.
  • Do not let the agent discover what it cannot read. A mailbox the key was not granted answers exactly like one that does not exist, so an agent cannot discover what it may not read.

4. Should the agent send, or only draft?

Start with read-only, then drafts, then sending, and move up only when the log shows it is ready.

Many useful agents never need to send: triage, tagging, summaries, routing to the right person. A read-only key can list, read and summarise mail but cannot draft or send, and its MCP client never sees the sending tools.

When it does need to reply, start in draft mode: the agent writes, a person approves. A draft-only key can propose replies but never send them: every draft it makes waits for a person, and its MCP client never sees the sending tools. A person approves in the console or in webmail; an agent key cannot approve its own draft.

Be honest with yourself about one detail, because it catches most teams out: a draft is an approval step only if the agent cannot send by some other route. That is why the key matters more than the prompt: give an agent in draft mode a key that cannot send.

5. Which replies should always wait for a person?

These, at minimum. They are the rules our own approval engine applies to every agent reply, however it is sent, written as plain checks rather than a model’s judgment:

Hold the reply whenWhy
A reply adds someone who is not already in the threadThe classic way private mail reaches the wrong person.
A message goes to more than 10 recipientsA reply is a conversation; a long list is a broadcast.
The body contains a card number, an IBAN or a US social security numberPersonal data should leave only when a person means it to.
The message being answered was flagged as a likely prompt injectionThe moment an agent may be following someone else’s instructions.

A few notes from building them:

  • Check for personal data with a checksum, not a pattern. We look for card numbers (checked with the Luhn algorithm), IBANs, US social security numbers. The Luhn check matters: without it, every order number and phone number trips the rule, people start approving without reading, and the rule is worthless.
  • Count recipients. We hold anything addressed to more than 10 people. A reply is a conversation; a long list is a broadcast.
  • Treat a new conversation as its own case. A new message from an agent is held when it contains personal data, goes to more than 10 people, or the agent asks to hold it; a draft that starts a new conversation always waits.
  • A false hold costs a click. A false send costs trust. When in doubt, hold.

6. How do you stop an email from steering the agent?

Treat every incoming message as untrusted input, because it is. Anyone on the internet can write to your agent, and some will write instructions instead of questions.

Three layers help. Screen incoming mail for injection phrasing and flag it. Label message content as untrusted data when the agent reads it, so the model is told the difference between your instructions and a stranger’s. And hold any reply to a flagged message for a person, so a successful injection still stops at the approval queue. No filter catches every rewording, which is why the last layer matters most.

7. What should you watch in the first weeks?

The audit log, daily at first. Look for reads outside the job (why did a support agent open an attachment from finance?), drafts that are held for the same reason again and again (a rule to tune, or a prompt to fix), and replies people reject (the clearest signal of where the agent is not ready).

On Lockally every agent action, reads included, is written to the audit log in the console and kept for 12 months. We wrote separately about the audit trail an agent’s email needs.

8. How do you switch it off?

In one place, in seconds, without touching anyone else. Know where that switch is before you need it. Each mailbox has a switch that turns agent access off at once, whatever keys exist. Revoking the agent’s API key also stops it, and leaves your team’s sign-ins and your app’s sending untouched.

What does this look like on Lockally?

Create an agent inbox on your domain, issue a key granted only that mailbox, and connect your agent over our MCP server at {mcpServer.host} (10 tools) or the REST API. Your team’s mailboxes and your app’s sending live in the same account, so the agent can hand a thread to a person without anyone switching systems.

Start at Agents and MCP, see how the options compare on our agentic mail page, or read the definition of agentic email if you are new to the term.

Lockally is encrypted email with your domain, on every plan.