Skip to content

MCP serverPermissions and security

MCP permissions and security

Two things limit what an agent can do over MCP. The first is the scopes on the API key behind the connection. The second is how the server handles email content the agent did not write. This page covers picking connection permissions, how the server treats untrusted content (events included), and the smoke test to run against production before you trust a new setup. For the tool list, see tools, resources and prompts.

Last updated

Choose connection permissions

Set up OAuth connections under Developer, Connections. Choose Read and draft, Mail assistant, Full access, or Custom. Full access grants every permission your role can hold, with no mailbox or domain limit. Custom groups the permissions by area, with optional mailbox and domain limits. If you skip the limits, the connection reaches everything you can reach, now and later. Stdio uses the same policy through its API key. A policy change applies on the next REST call. If you widen access, reconnect the host so it refreshes its cached tool list.

A client may also request OAuth scopes, which use the API key scope names. Its token then reaches only the tools, resources and events those scopes allow, and only within the permissions you approved. A client that requests no API scope gets everything your approval allows. After you approve specific API scopes, a token request that drops them gets invalid_scope; disconnect the app in Developer, Connections to approve it again without them.

When you approve a connection with a mailbox password, it stays limited to the mailbox you signed in with. You can pick member-tier capabilities for that mailbox, but you can't add another organization or mailbox. For broader access, sign in with your account. Resetting the mailbox password, revoking an app password, signing out of the mailbox, or losing mailbox access disconnects its mailbox-approved AI connections.

Start a new workflow with a dedicated mailbox and Read and draft. That profile can read mail and calendars and create drafts, but it cannot send email. Permissions limit what the agent can do. They don't make email content safe or the agent's answers correct. Approve with that mailbox's password to keep the connection limited to that mailbox. For an account-approved OAuth connection, check the organizations, mailboxes, and permissions you grant.

AI connections made before the current permission model need to reconnect once. Reconnect from the AI client and check the permissions again.

Check the app before connecting

Shipmail allows open OAuth client registration, so MCP apps can connect without you registering them by hand. Registering an app gives it no access to your account or email. You still sign in, pass any required multi-factor check, and approve the connection permissions.

Check the callback destination on the consent screen before approving. The app picks its own name, so a familiar name doesn't prove who runs it. A local callback doesn't prove who published the app either. Only connect apps you meant to use, and give them only the organizations, mailboxes, and permissions they need.

Each request checks the connection's current permissions and approved client ID. Revoking a connection cuts its MCP access, even if its access token hasn't expired. Reconnecting with a new client registration replaces the one you approved before.

Registration requests are rate limited. Shipmail may remove an anonymous registration that stays unused for seven days. The app registers again when you connect it. Cleanup keeps any registration that has stored consent, tokens, or a connection.

Security behavior

  • Email bodies, addresses, and error text are sanitized before reaching the LLM.
  • Email bodies and attachments stay untrusted and can't authorize outbound tool calls.
  • Unexpected upstream errors are redacted, but keep the request ID so support can trace them.
  • Webhook URLs must be public HTTPS endpoints.
  • Risky tools have per-session circuit-breaker limits.
  • Destructive tools are flagged so MCP hosts can ask for confirmation.

Untrusted content in events

An MCP event for new mail carries the subject and the sender's name and address. The sender wrote those, so a subject can hold text that reads like an instruction. The event schema marks those fields as untrusted, and an event never carries the body, a snippet or attachment names. Calendar and booking events work the same way: an invitation's title and a booker's name are marked untrusted, and an event never carries an event description or a booking note.

An automation runs with the connection's permissions, without you watching. Give the connection only what the automation needs, and prefer drafting a reply over sending one when the trigger is mail from people you do not know. Filter on a sender or a domain where you can.

Email can contain attacker-written instructions in its body, subject, quoted replies, attachments, hidden markup, or metadata. Microsoft also says you still need runtime safeguards when an assistant can use tools or mailbox data. Read Microsoft's prompt injection guidance.

Production smoke test

The repository QA command installs the published npm package in a temp directory and connects over MCP stdio. It checks startup, tool registration, and status access, and changes nothing in the account.

bun run qa