AegisAI Perspectives · 137

Is it safe to give an email security vendor API access to our mailboxes?

It is safe when each scope is narrow, scoped to named mailboxes and revocable; see what each Gmail and Microsoft 365 mail permission reads and changes.

TL;DR
Answer
Email security vendor API access is safe when each scope is narrow, the grant covers only the mailboxes it needs, and an admin can revoke it.
Who it's for
If you run IT for a company of 20 to 500 people on Microsoft 365 or Google Workspace, with a small IT or security team and no SOC.
Watch out for
Mail.Read as an application permission reads mail in all mailboxes without a signed-in user, until you pair it with a resource scope and remove the unscoped grant.
What AegisAI does
AegisAI supports customer-managed encryption keys (CMEK). You hold the key in your own key management service; AegisAI never possesses it.
Book a demo

See it on your own Google Workspace or Microsoft 365 tenant. No MX change.

Or get the Q3 2026 State of the AI Attack report (free, instant download)

Not ready for a demo? Check your domain (free, about 10 seconds).

Is it safe to give an email security vendor API access to our mailboxes?

Email security vendor API access is safe when the grant is narrow, covers only the mailboxes it needs and can be revoked. On Microsoft 365, Mail.Read as an application permission reads mail in all mailboxes without a signed-in user13.

AegisAI keeps only the metadata needed to run the service (message IDs, counts) and the content of messages flagged as suspicious23. If you run IT for a company of 20 to 500 people on Microsoft 365 or Google Workspace, with a small IT or security team and no SOC, use the table on this page before you approve any vendor's consent screen. How the product reads mail is on the inbound email security page. Whether an AI agent belongs in your inbox at all is covered in can I trust AI agents inside my inbox. This page lists each permission: what it reads, what it changes, who grants it and how to take it back.

Key takeaways

  • The full Gmail scope can read, compose, send and permanently delete all your email1.
  • The Gmail metadata scope sees labels and headers, but not the email body5.
  • Microsoft Graph Mail.ReadWrite as an application permission can create, read, update and delete mail in all mailboxes14.
  • In Exchange Online, a grant can be paired with a resource scope that names the mailboxes an app can reach18.
  • Deleting a domain-wide delegation client stops every application that depends on it at once9.

The short answer

QuestionAnswerSource
Is it safe to give an email security vendor API access to our mailboxes?Yes, when each scope is the narrowest that works, the grant covers only the mailboxes needed, and a named admin can revoke it. Microsoft calls admin consent a sensitive operation16,17
What can a vendor read with Microsoft Graph Mail.Read?Mail in all mailboxes, without a signed-in user, unless you scope it
Which Gmail scope reads mail without changing it?gmail.readonly views messages and settings2. gmail.metadata sees headers and labels, not the body
Who approves the grant?On Google Workspace, a super administrator7. On Microsoft 365, an admin gives consent for the whole tenant
How do you take access back?Delete the domain-wide delegation client, or revoke admin-granted permissions in Entra ID
Can Microsoft 365 limit an app to some mailboxes?Yes, with RBAC for Applications, if you also remove the unscoped Entra ID grant19

What you can do by the end

  • Read a vendor's scope list and name what each scope can read and change.
  • Grant read-only access to named mailboxes first, with one admin approving it.
  • Revoke a vendor's mailbox access on either platform.

Short on time? Watch the explainer, or book a demo.

How to evaluate vendor API permissions before you approve them

Grant the smallest scope to the fewest mailboxes, with a tested way back. The steps below cover the permission itself. How to scope a read-only trial is in how to structure a read-only email security proof of concept; this page does not repeat it.

  1. Ask the vendor for its exact scope list in writing: each Gmail scope, each Microsoft Graph permission, and whether each is an application or a delegated permission. Match every line to the reference table below.

  2. Start read-only. On Google Workspace, gmail.readonly views messages and settings, and gmail.metadata stops at labels and headers. On Microsoft 365, Mail.Read reads mail in all mailboxes.

  3. On Google Workspace, add only the scopes the vendor listed in domain-wide delegation. Google says each scope should be appropriately narrow8, and the task needs a super administrator.

  4. On Microsoft 365, scope the grant to named mailboxes with RBAC for Applications. Assigning it needs membership of the Organization Management role group25.

  5. Remove any unscoped Mail.Read from Entra ID once the scoped grant exists. Microsoft states that the two together give no effective resource scoping.

  6. Treat the consent click as a change with an owner. Microsoft calls tenant-wide admin consent a sensitive operation. Record who approved it, on which date, for which scopes.

  7. Add write access only when you switch on removal. The inbound product page states it plainly: "Removal needs write access your admin grants and can revoke"21.

  8. Test the way back once, before go-live: delete the client in domain-wide delegation, or revoke the permissions on the app in Entra ID. Note how long it took.

Run steps 1 and 2 before anyone opens a consent screen.

What does email security API access actually grant?

Each row is one mail permission an email security tool can ask for, from Google's and Microsoft's own documentation. On Google Workspace, scopes with wide access to user data are restricted scopes and need restricted scope OAuth App Verification6.

PlatformScope or permissionWhat it can readWhat it can changeWho grants itHow to revoke it
Google Workspacemail.google.com (full access)All mailCompose, send and permanently delete all mailA super administrator, in domain-wide delegationDelete the client; dependent apps stop at once
Google Workspacegmail.readonlyMessages and settingsNot covered: the scope views mailA super administrator, in domain-wide delegationDelete the client
Google Workspacegmail.metadataLabels and headers, not the bodyNot covered: the scope views metadataA super administrator, in domain-wide delegationDelete the client
Google Workspacegmail.modifyMail3Compose and send, but no permanent deletion that bypasses the trash4A super administrator, in domain-wide delegationDelete the client
Google WorkspaceApp access control: TrustedTrusted reaches all services, restricted ones included10Not covered by this settingAn admin, in app access controlSet the app to Blocked: no Google data12
Microsoft 365Mail.Read (application)Mail in all mailboxes, no signed-in userNot covered: the permission reads mailAdmin consent requiredRevoke admin-granted permissions in Entra ID
Microsoft 365Mail.ReadWrite (application)Mail in all mailboxesCreate, update and delete mailAdmin consent requiredRevoke admin-granted permissions in Entra ID
Microsoft 365Mail.Send (application)Not covered by this permissionSend mail as any user15Admin consent requiredRevoke admin-granted permissions in Entra ID
Microsoft 365RBAC for Applications resource scopeLimits which mailboxes the app can reachNot covered by this scopeA member of Organization ManagementRemove the role assignment, and the unscoped Entra ID grant

Copy this table into your vendor review and fill in the scopes each vendor asks for.

What limits real-world damage from privileged email API access?

Two rows let a vendor destroy or send mail. The full Gmail scope can permanently delete all mail. Mail.Send can send mail as any user. Refuse both unless the vendor shows in writing why its product needs them.

The next control is reach. A Microsoft 365 application grant reaches all mailboxes until you pair it with a resource scope.

The last control is speed of removal. Deleting the delegation client stops the app immediately.

Ask every vendor which of these rows it needs on day one, and which it needs only after the trial.

What compliance and retention questions apply to third-party mailbox access?

A narrow scope limits what a vendor can read. Retention limits what it keeps. One published answer is the data retention, encryption and compliance post: it covers which message data is kept and who holds the encryption key24.

  • What message content do you store, and for which messages?
  • How long do you keep it, and what deletes it?
  • Who holds the encryption key, and can your staff read stored mail?
  • Where is the data stored, and which subprocessors can reach it?
  • What happens to stored mail after we revoke access?

Send these five questions with the scope list in step 1, and get the answers in writing.

How AegisAI handles this

AegisAI supports customer-managed encryption keys (CMEK). You hold the key in your own key management service; AegisAI never possesses it. Reads mail through the Microsoft 365 or Google Workspace API after delivery20. Removal needs write access your admin grants and can revoke.

Book a demoSee inbound email security

See your own records: Check your domain.

How to measure it in 30 days: an assessment of your email security posture

Track three numbers for every vendor with mailbox access.

  • Scopes granted against scopes the vendor listed in step 1, from the domain-wide delegation page or the app's permissions page in Entra ID.
  • Mailboxes in scope against total mailboxes, from the RBAC for Applications scope or the delegation's user list.
  • Days since the last revoke test, from your change log.

To see the exact scopes requested in your own tenant, walk through a connection with the team. Review the three numbers on day 30 and remove any scope nobody can explain.

Questions people ask

Is it safe to give an email security vendor API access to our mailboxes?

Yes, when the scope is narrow, the grant covers only the mailboxes needed and an admin can revoke it. AegisAI reads mail through the Microsoft 365 or Google Workspace API after delivery, and removal needs write access your admin grants and can revoke.

Does Mail.Read let a vendor send email from our accounts?

No. Mail.Read reads mail in all mailboxes. Sending mail as any user is a separate application permission, Mail.Send. Refuse it unless the vendor shows why it needs it.

Can I limit a vendor to some mailboxes in Microsoft 365?

Yes. RBAC for Applications pairs the grant with a resource scope that names the mailboxes. Remove the unscoped Mail.Read from Entra ID too, or the scope has no effect.

What happens when I delete a domain-wide delegation client?

Applications that depend on that client authorization stop working immediately.

Who can approve API access to mailboxes?

On Google Workspace, domain-wide delegation needs a super administrator. On Microsoft 365, Mail.Read as an application permission needs admin consent, which Microsoft calls a sensitive operation.

Sources

  1. (Google for Developers, Choose Gmail API scopes, read 12 November 2026)
  2. (Google Workspace Admin Help, Control API access with domain-wide delegation, 10 November 2026)
  3. (Google Workspace Admin Help, Control which apps access Google Workspace data, 10 November 2026)
  4. (Microsoft Learn, Microsoft Graph permissions reference, 7 November 2026)
  5. (Microsoft Learn, Grant tenant-wide admin consent to an application, 27 August 2026)
  6. (Microsoft Learn, Review permissions granted to enterprise applications, 19 February 2026)
  7. (Microsoft Learn, Role Based Access Control for Applications in Exchange Online, 27 October 2026)
  8. (AegisAI, Inbound email security)
  9. (AegisAI Blog, Data retention, encryption and compliance, 27 October 2026)
  10. (AegisAI Blog, Can I trust AI agents inside my inbox)
  11. (AegisAI, How to structure a read-only email security proof of concept)

Recent posts

Every email, investigated.