AegisAI Perspectives · 006

How to structure a read-only email security PoC

Grant one scoped read permission to a named pilot group, write pass criteria and an end date first, verify the scope, then revoke and delete on that date.

How to structure a read-only email security PoC

Grant one read permission, scope it to a named pilot group, write the pass criteria and end date before consent, then revoke on that date. Exchange Online app permission changes take 30 minutes to 2 hours to apply1.

A read-only proof of concept (PoC) gives a new email security tool only a read role, such as Application Mail.Read, which allows reading email in all mailboxes4. The structure below covers Microsoft 365 and Google Workspace. It assumes the tool connects through the platform API, so no MX record changes. If you are still choosing a deployment model, start with whether API-based email security needs an MX record change.

What you can do by the end

  • Scope a Microsoft 365 read grant to a pilot group, then prove the app cannot read mailboxes outside it.
  • Pick the narrowest read permission per platform: Mail.ReadBasic or Mail.Read, gmail.metadata or gmail.readonly.
  • Tear the PoC down on its end date: revoke consent, delete the delegation client, confirm data deletion.

What makes a PoC read-only?

The permission does. Microsoft documents Application Mail.Read as reading email in all mailboxes. Application Mail.ReadBasic reads email in all mailboxes without a signed-in user, except the body, preview, attachments and extended properties.

Microsoft's own guidance is to request the least privileged permission the app needs5. The Canadian Centre for Cyber Security says the same for cloud email: use the cloud service's own access management tools to enforce least privilege23.

On Google Workspace, gmail.readonly lets an app view messages and settings18. The gmail.metadata scope shows labels and headers but not the body19. Google lists both as restricted scopes.

Run the PoC in eight steps

  1. Write the pass criteria and the end date, with the pilot list, before anyone clicks consent.

    IANS advises granting access only for the limited period the PoC needs and including full deletion of data once it ends24. For pass criteria that survive a vendor demo, use how to run a fair proof of value against a vendor's claims.

  2. Choose the narrowest permission that answers your question.

    Mail.ReadBasic covers mail without the body, preview, attachments or extended properties, so body and attachment analysis needs Mail.Read. On Google, gmail.metadata excludes the body and gmail.readonly views messages.

  3. Route the grant through the admin consent workflow.

    Reviewers can view, block or deny a request, but only a Global Administrator approves Microsoft Graph application permissions7. The workflow takes up to an hour to switch on after you save it6. Set "Consent request expires after (days)" to fix how long a request stays valid8.

  4. Scope Mail.Read to the pilot group in Exchange Online.

    Use resource scoping in Exchange Online RBAC so the Application Mail.Read role covers only the pilot mailboxes. Then remove the unscoped Mail.Read grant in Entra ID: Exchange adds the two grants together, and an unscoped Entra grant cancels the scope2.

  5. Prove the scope before data flows.

    Run Test-ServicePrincipalAuthorization against one mailbox inside the pilot and one outside it. InScope should read true, then false3. The test skips the 30 minute to 2 hour cache. It excludes permissions granted in Entra ID, so also open the app's Admin consent tab in Entra ID and revoke any Mail.Read listed there.

  6. On Google Workspace, treat delegation as tenant-wide.

    With domain-wide delegation the app reaches the data of all users20. Add only the scope from step 2, and write the pilot list into the PoC agreement. Google asks admins to keep each scope narrow and review service accounts22.

  7. Keep your own record of what the tool flagged.

    Message trace searches up to 90 days of history, 10 days per query15. Ranges over 10 days return only a downloadable CSV prepared from archived data, and Microsoft warns that report takes several hours in some cases16. Export a summary every week, not once on the last day.

  8. Tear down on the end date.

    In Entra ID, revoke the admin consent permissions from the app's Admin consent tab. Revoking does not stop a re-consent11, so delete the service principal or block consent too. On Google, delete the delegation client; apps that depend on it stop working at once21. Then ask for written confirmation of data deletion.

Which read permission fits each platform?

PlatformPermission or scopeWhat the app readsHow to limit it to the pilotHow to remove it
Microsoft 365Application Mail.ReadBasicMail without body, preview, attachments or extended propertiesResource scoping in Exchange Online RBACRevoke in the Admin consent tab
Microsoft 365Application Mail.ReadEmail, including the parts Mail.ReadBasic excludesSame, with the Entra grant removedRevoke, then block re-consent
Google Workspacegmail.metadataLabels and headers, no bodyPilot list in the PoC agreement; delegation reaches all usersDelete the delegation client
Google Workspacegmail.readonlyMessages and settingsSame as aboveDelete the client, review service accounts

Illustrative example, figures are fictional. A 1,400 mailbox Microsoft 365 tenant scopes Application Mail.Read to a 120 mailbox administrative unit: finance, executives and the service desk. The Global Administrator approves the request on day 0. Test-ServicePrincipalAuthorization shows InScope true for a finance mailbox and false for a marketing mailbox. On day 9 the tool flags 14 delivered messages; message trace confirms 11 reached inboxes, and the security team deletes them by hand because the PoC cannot. On day 30 the team revokes consent, deletes the service principal and files the vendor's deletion letter.

The example shows why a read-only PoC needs a manual removal path: Mail.Read and Mail.ReadBasic allow the tool to read email, and the team removes what it flags.

How to measure it in 30 days

Track three numbers, each from a log you own rather than the vendor's dashboard.

  • Scope check result. The Test-ServicePrincipalAuthorization output for one pilot and one non-pilot mailbox, kept with the PoC record. Run it again after any group change.
  • Confirmed delivered threats. Flagged messages that message trace shows as delivered, from weekly exports of 10 days or less. To set targets for that count, see which numbers security leaders should measure for AI in email.
  • App activity in the audit log. Microsoft Purview keeps Exchange Online audit records for one year under the Audit (Premium) default policy for E5 users13. Audit (Standard) logs from October 17, 2023 onward default to 180 days12. Pull the app's records before teardown.

Questions people ask

Does a read-only email security PoC block anything?

No. Application Mail.Read and Mail.ReadBasic are roles that allow an app to read email. Name who deletes confirmed threats by hand during the PoC, and how fast, before the tool starts flagging messages.

Is Mail.ReadBasic enough for a PoC?

Only if the test is about headers and senders. Mail.ReadBasic excludes the body, preview, attachments and extended properties, so content-based detection of phishing text or payloads needs Mail.Read.

How long does an Exchange scope change take to apply?

Between 30 minutes and 2 hours, depending on how recently the app called the API. Test-ServicePrincipalAuthorization bypasses that cache, so run it to check the new scope without waiting for the app to pick it up.

Can I limit a Google Workspace PoC to some users?

Not through delegation. Domain-wide delegation gives the app access to the data of all users. Limit what it reads instead: gmail.metadata excludes the body. Write the pilot list into the agreement, and edits to delegation can take up to a day to apply.

Who has to approve the app?

A Global Administrator. Reviewers in the admin consent workflow can view, block or deny the request, but only a Global Administrator approves application permissions for Microsoft Graph.

What happens to our mail data after the PoC?

Agree on full deletion of data at the end before access starts, as IANS advises for third-party PoCs. On the end date, revoke the grant, delete the service principal or delegation client, and keep the vendor's written deletion confirmation with the PoC record.

Sources

  1. Role Based Access Control for Applications in Exchange Online, Microsoft Learn
  2. Microsoft Graph permissions reference, Microsoft Learn
  3. Configure the admin consent workflow, Microsoft Learn
  4. Review permissions granted to enterprise applications, Microsoft Learn
  5. Manage audit log retention policies, Microsoft Learn
  6. Message trace in the new EAC in Exchange Online, Microsoft Learn
  7. Choose Gmail API scopes, Google for Developers
  8. Control API access with domain-wide delegation, Google Workspace Admin Help
  9. Email security best practices (ITSM.60.002), Canadian Centre for Cyber Security
  10. Best practices for secure and effective third-party PoCs, IANS Research

Recent posts

Every email, investigated.