AegisAI Perspectives · 173
An API-based email security tool reads what its Gmail scope or Graph permission allows and stores what its vendor keeps. Here is the full data inventory.
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.

An API-based email security tool reads what its scope allows: whole messages with the Gmail scope gmail.readonly1, or labels plus headers with gmail.metadata2. What it stores, for how long and where, is the vendor's choice, so get each answer in writing. AegisAI states on its data retention page that it keeps only the metadata needed to run the service (message IDs, counts) and the content of messages flagged as suspicious19. In Microsoft 365, Mail.Read (application) allows the app to read mail in all mailboxes without a signed-in user10.
What the tool then does with that access is on the inbound email security page. Whether granting the access is safe, permission by permission, is covered in is it safe to give an email security vendor API access to your mailboxes.
Key takeaways
| Question | Answer |
|---|---|
| What data does an API-based email security tool read and store from our mailboxes? | It reads the fields its scope or permission allows, from headers only to whole messages. It stores what the vendor chooses to keep |
| Can a tool read headers without the body? | Yes. gmail.metadata reads labels and headers but not the email body. Mail.ReadBasic.All excludes body, previewBody, attachments and extended properties |
| Does read access let a tool delete mail? | No. In Microsoft Graph that needs Mail.ReadWrite. In Gmail, permanent deletion needs the mail.google.com scope4 |
| How do I end a tool's access? | Google: block the app in API controls8. Microsoft: revoke the permissions in Microsoft Entra25 |
Short on time? Watch the explainer, or book a demo.
Read access lets a tool see mail. Write access lets it change mail. In Gmail, gmail.modify can read, compose, and send emails, but it does not allow immediate, permanent deletion that bypasses the trash3. The mail.google.com scope can permanently delete all your email.
In Microsoft Graph, Mail.ReadWrite (application) can create, read, update, and delete mail in all mailboxes, and it does not include permission to send mail. A tool that only classifies mail needs read access. A tool that moves or removes a message from the inbox needs write access.
Grant write access as its own decision, at the point where the tool must move or remove mail.
A tool stores what its vendor chooses to keep, for as long as the vendor decides, and the platform docs set only a security floor. Google's API Services User Data Policy says: "We expect all user data is secure in transit and at rest". Every Gmail scope above is listed as restricted. Restricted scopes provide wide access to Google user data and require restricted scope OAuth App Verification5.
The platform pages cited here set no retention period for the vendor. That answer is in the vendor's own documentation, or nowhere. Ask six questions, and know what a clear answer contains.
Send these six questions before the trial starts, and keep the written answers with the consent record.
Limit access before the trial, and know the removal path before you need it.
List each scope or permission the tool requests on its consent screen. Match each one to a row of the fields table below.
Ask the vendor, in the same written request as the six storage questions, if a metadata scope covers the use. gmail.metadata reads labels and headers without the body. Mail.ReadBasic.All leaves out body and attachments.
In Microsoft 365, pair the grant with a resource scope in RBAC for Applications, so the app reaches only the mailboxes you name.
Administrators can configure an application access policy to limit app access to specific mailboxes, even if the app has Mail.Read14.
Ask for write access only when the tool must remove mail. Mail.ReadWrite and gmail.modify are the grants that change mail.
To remove access in Google, open the Admin console Menu and go to Security. Under Access and data control, open API controls.
To block an app for all users, select your top organizational unit, then select Blocked.
In Microsoft 365, open the Microsoft Entra admin center, view the permissions granted to the app, and revoke the permissions granted by admins.
Ask the vendor in writing what happens to the data it already stored.
Test step 6 or step 8 on one test account before the trial ends, so the removal path is proven.
Fields fall into three groups. Headers come first, then the body, then any attachments. In Microsoft Graph, internetMessageHeaders holds the RFC 5322 headers, including the ones that show the network path from sender to recipient15. The body property holds the message in HTML or text, and the attachments relationship holds file and item attachments16.
A scope that excludes the body still exposes the headers. Headers name the sender and each recipient, and show the route the message took. A detection tool that judges content needs the body, so expect it to ask for gmail.readonly or Mail.Read.
| Setting or step | Where it is in the admin console | Which edition or licence | What it does | What it does not do | Source |
|---|---|---|---|---|---|
| gmail.metadata | Google Admin console, Security, Access and data control, API controls | No edition named on the cited page | View email message metadata such as labels and headers | Read the email body | |
| gmail.readonly | Google Admin console, API controls | No edition named on the cited page | View your email messages and settings | Compose or send email, which gmail.modify allows | |
| Mail.ReadBasic.All (application) | Microsoft Entra, where permissions are revoked | No licence named on the cited page | Read basic mail properties in all mailboxes without a signed-in user | Read body, previewBody, attachments and any extended properties | |
| Mail.Read (application) | Microsoft Entra | No licence named on the cited page | Read mail in all mailboxes without a signed-in user | Create, update or delete mail, which needs Mail.ReadWrite | |
| Mail.Read (delegated) | Microsoft Entra | No licence named on the cited page | Read the signed-in user's mailbox | Read other mailboxes | 11 |
| RBAC for Applications resource scope | Exchange Online | No licence named on the cited page | Specify which mailboxes an app can access | Grant a permission on its own: it is paired with a grant |
Write down the scope or permission each tool requests before anyone clicks consent.
AegisAI's AI agents start read-only: a pilot can list users and read mail for classification, nothing more, and removal needs write access your admin grants and can revoke23. Messages are read through the API, analyzed in memory and discarded18. AegisAI keeps only the metadata needed to run the service (message IDs, counts) and the content of messages flagged as suspicious, and its page gives no retention period for that flagged content. It is encrypted at rest and stored separately for each customer20. In quarantine mode, the original copy of a quarantined message is held for at most 48 hours to carry out the quarantine21, and threat history is available in the console for 90 days by default22.
Measure it with three counts, taken on day 1 and again on day 30, each from a console you already use.
To see the read-only start and the removal path in your own tenant, talk to the team. On day 30, every app on the first list should have a written answer on the third.
It reads the fields its scope or permission allows: headers only with gmail.metadata, or whole messages with gmail.readonly or Mail.Read. Storage is the vendor's choice. What AegisAI keeps is listed in its own section above.
That depends on the permissions granted and on what the vendor stores. The permission by permission answer is in is it safe to give a vendor API access to your mailboxes. For the data side, use the six storage questions above.
Yes. RBAC for Applications in Exchange Online pairs the grant with a resource scope that names the mailboxes the app can access. An application access policy can also limit an app with Mail.Read to specific mailboxes.
Not immediately. gmail.modify does not allow immediate, permanent deletion of threads and messages that bypasses the trash. Permanent deletion of all email is in the mail.google.com scope.