The OAuth scope https://mail.google.com/ gives an app every right Gmail has to offer, including permanent deletion that bypasses the Trash, and many integrations request it when a far narrower scope would do the job. Once a user or administrator grants it, the app, or anyone who steals its token, can read, send and erase a mailbox without a password or MFA prompt. This guide explains exactly what the full access scope grants, how its risk differs from the other Gmail scopes, which narrower scope fits each common use case, and the Google Workspace admin controls and logs that limit and reveal its use. It is written for Workspace administrators reviewing third-party and internal apps, and for developers building on the Gmail API who want to request the least they need.
This is an independent guide from NHI Mgmt Group, based on Google's public Gmail API and Workspace admin documentation as of November 2026. It is not sponsored or reviewed by Google. Product features change, so confirm settings against Google's current documentation.
Key takeaways
- Full access is only needed for permanent deletion. Google's scope reference says to request https://mail.google.com/ only if the app must permanently delete threads and messages, bypassing the Trash, and that all other actions can use less permissive scopes.
- Restricted does not mean rare. Most useful Gmail scopes, including gmail.readonly, gmail.modify and gmail.metadata, are classed as restricted alongside full access; the difference is what each one lets an app do once granted.
- Verification is the developer control. Public apps that request restricted scopes need restricted-scope verification, and apps that store or transmit restricted-scope data on servers need an annual CASA security assessment.
- API controls are the admin control. Setting Gmail to Restricted under Manage Google Services stops untrusted apps from obtaining high-risk Gmail scopes; Trusted apps keep them.
- Tokens are non-human identities. Every grant of full Gmail access is a standing credential held by software, so it needs an owner, a review date and alerting on new grants.
What the scope grants
Google's Gmail API scope reference describes https://mail.google.com/ as the scope to "read, compose, send, and permanently delete all email". It is classed as restricted, the highest of Google's three classifications. Because the scope covers the whole mailbox, it is also the scope used for IMAP, POP and SMTP access with OAuth (XOAUTH2), which is why mail clients and legacy connectors often ask for it.
The table lists every Gmail API scope with Google's own description and classification. Platforms and scope names are as Google documents them.
| Scope | What Google says it allows | Classification |
|---|---|---|
| https://mail.google.com/ | Read, compose, send and permanently delete all email; only needed for permanent deletion bypassing the Trash | Restricted |
| gmail.modify | Read, compose and send email; does not allow immediate, permanent deletion bypassing the Trash | Restricted |
| gmail.readonly | View email messages and settings | Restricted |
| gmail.metadata | View message metadata such as labels and headers, but not the body | Restricted |
| gmail.compose | Manage drafts and send email | Restricted |
| gmail.insert | Add email into the mailbox | Restricted |
| gmail.settings.basic | View and change email settings and filters | Restricted |
| gmail.settings.sharing | Manage sensitive mail settings, including who can manage the user's mail; admin-only, through a service account with domain-wide delegation | Restricted |
| gmail.send | Send email on the user's behalf | Sensitive |
| gmail.addons.current.message.readonly | View email messages while the add-on is running | Sensitive |
| gmail.addons.current.message.metadata | View message metadata while the add-on is running | Sensitive |
| gmail.labels | View and edit email labels | Non-sensitive |
| gmail.addons.current.message.action | View email messages when the user interacts with the add-on | Non-sensitive |
| gmail.addons.current.action.compose | Manage drafts and send email when the user interacts with the add-on | Non-sensitive |
All scopes other than full access carry the prefix https://www.googleapis.com/auth/. A grant can be made in two ways: a user consents for their own mailbox, or a super administrator lists the scope against a service account under domain-wide delegation, which lets that service account act as any user in the domain. The second case turns one mailbox's worth of risk into the whole tenant's. See the Google Workspace Domain-Wide Delegation Security Guide.
Risk
The risk does not come from a flaw in the scope; it comes from how complete it is. Whoever holds a valid token holds the mailbox.
- Token theft bypasses sign-in controls: refresh tokens stored by an integration's servers can be stolen and replayed to the API without triggering 2-Step Verification. MITRE ATT&CK tracks this as T1528 Steal Application Access Token and T1550.001 Application Access Token.
- Bulk collection: read access to every message is the API route to T1114.002 Remote Email Collection, including password reset emails and invoices that enable further fraud.
- Sending as the user: send rights enable internal phishing and payment fraud from a trusted mailbox.
- Permanent deletion: the one right unique to full access lets an attacker erase evidence or destroy mail beyond the Trash, which complicates investigation and recovery.
- Persistence: a consented app survives password changes. Malicious app grants are a persistence route under T1671 Cloud Application Integration, often obtained through consent phishing links (T1566.002). See the Consent Phishing and Illicit OAuth Grants Guide.
- Over-scoped AI tools: an assistant or agent that only summarises mail but holds full access gives prompt injection a path to send or delete. See AI Agent Email Access Security.
Closely related: gmail.settings.basic lets an app create filters, and filters that forward or hide mail map to T1114.003 Email Forwarding Rule. Review settings scopes with the same care as full access.
Narrower scopes
Google's guidance is to choose the most narrowly focused scope that meets the app's needs, to use non-sensitive scopes where possible, and not to request scopes the app does not require. Users are also more willing to grant limited scopes with clear descriptions.
| Use case | Narrowest fitting scope | Why not full access |
|---|---|---|
| Send notifications or transactional mail as the user | gmail.send (sensitive) | No read access to the mailbox at all |
| Act on the open message inside a Gmail add-on | gmail.addons.current.message.action or .readonly, plus gmail.addons.current.action.compose to reply | Access is limited to the message the user is working with, while the add-on runs |
| Organise mail with labels | gmail.labels (non-sensitive) | Cannot read message bodies |
| Analytics on volume, senders or routing | gmail.metadata | Headers and labels only, no bodies |
| Archiving, search, summarisation or backup | gmail.readonly | Cannot send, change or delete |
| Triage, labelling and replying, moving to Trash | gmail.modify | Same daily capability without permanent deletion |
| Draft replies for a human to review | gmail.compose | No read of the whole mailbox beyond drafts and sending |
| Import or migrate mail into a mailbox | gmail.insert | Adds messages without reading existing mail |
| Retention tooling that must purge mail beyond Trash | https://mail.google.com/ | The only documented case that needs full access |
Developer steps to narrow an existing app
- List the API methods the code calls: map each to the scope Google documents for it, and drop scopes no method needs.
- Replace IMAP with the Gmail API where possible: IMAP and SMTP with OAuth need full access, while the Gmail API supports the narrower scopes above.
- Request incrementally: ask for an extra scope at the moment a feature needs it, not at first sign-in, using Google's incremental authorisation.
- Test in a staging project: confirm every feature works with the reduced scopes before changing the production consent screen.
- Re-verify: changing restricted scopes may trigger verification or reassessment; plan for it.
- Roll back safely: keep the old scope set available behind a configuration flag until users have re-consented, so a missed method does not break the app.
Restricted scope verification
Google requires apps that request restricted scopes to complete restricted-scope verification before requesting them from any Google Account, unless an exception applies. Exceptions include personal use by a few known people, internal apps whose project is owned by the organisation with the OAuth consent screen set to the Internal user type, development and testing projects, and service accounts that access only their own data. Domain-wide installation exempts an app from brand verification only, not app verification. Apps that access restricted-scope data from or through a third-party server must also pass a security assessment by a Google-empanelled assessor under the App Defense Alliance CASA framework, and must be reverified and reassessed at least every 12 months from the Letter of Assessment approval date. Adding a new restricted scope may require reassessment, and the privacy policy must meet Google's Limited Use requirements. See the Google CASA Security Assessment Guide.
| Classification | Verification | Example Gmail scopes |
|---|---|---|
| Non-sensitive | Basic OAuth verification | gmail.labels, gmail.addons.current.message.action |
| Sensitive | Additional OAuth verification | gmail.send, gmail.addons.current.message.readonly |
| Restricted | Restricted-scope verification; security assessment where data is stored or transmitted on servers | https://mail.google.com/, gmail.readonly, gmail.modify |
Admin controls
Workspace administrators control which apps can obtain Gmail scopes in the Admin console under Security, Access and data control, API controls. The settings below are the customer-side controls.
- Restrict Gmail: under Manage Google Services, set Gmail to Restricted so that only Trusted apps can obtain its high-risk scopes. Google maintains the list of which Gmail scopes count as high-risk for this setting. Restricting a service revokes tokens held by untrusted apps, so announce the change and pilot it on an organisational unit first.
- Set an access level per app: Trusted (all services, including restricted ones), Limited (unrestricted services only), Specific Google data (offered when approving from the pending review list) or Blocked. Reserve Trusted for apps with a named owner and a documented need for full or restricted Gmail access.
- Default for unconfigured apps: choose either "Don't allow users to access any third-party apps" or "Allow users to access third-party apps that only ask for Google sign-in info", and turn on the request flow so users ask through Apps pending review instead of working around the block.
- Internal apps: decide deliberately whether to tick Trust internal apps. Staff-built apps can request full access too and should be inventoried like third-party apps.
- Domain-wide delegation: review every service account client ID listed under Manage Domain Wide Delegation and remove https://mail.google.com/ wherever a narrower scope works. See How to audit Google Workspace domain-wide delegation grants.
- Revoke what should not exist: the Directory API tokens resource lists each user's grants by client ID and scope, and deleting a token removes that user's grant to the client. See How to revoke a malicious or risky OAuth app across Google Workspace and block it.
Access setting changes can take up to 24 hours to apply. Revoked tokens cannot be restored; users must consent again, so tell app owners before bulk revocation.
Choosing a posture
| Situation | Posture | Trade-off |
|---|---|---|
| Small organisation, few integrations | Gmail Restricted, sign-in only for unconfigured apps, short Trusted list | Some user friction, very little upkeep |
| Large organisation with many organisational units | Block unconfigured apps, approve through Apps pending review, Trusted per organisational unit | Needs an owner for the request queue |
| Business need for full access (retention, migration) | Trusted only for the unit that needs it, named owner, quarterly review, alerting on activity | Accepts concentrated risk for a defined purpose |
| Unverified or anonymous client asking for full access | Block and revoke, then ask users what it was for | May break a personal workflow |
Detection
OAuth token events are available in the Admin console under Reporting, Audit and investigation, OAuth log events, and through the Reports API with applicationName=token. Google keeps these events for six months, so export them continuously to a SIEM or BigQuery.
| Signal | Source | Why it matters |
|---|---|---|
| authorize event that includes https://mail.google.com/ | OAuth log events | New full mailbox grant; alert if the client ID is not in your register |
| Same client ID granted by many users in a short window | OAuth log events | Possible consent phishing campaign |
| Grant by an administrator or executive account | OAuth log events joined with directory roles | Highest impact if the token is stolen |
| activity events with high response bytes for Gmail API | OAuth log events (activity, on editions that log it) | Bulk mailbox reads by an app |
| New service account scope under domain-wide delegation | Admin log events | Tenant-wide mail access added |
| New mail filters or forwarding by an app | Gmail and admin audit logs | Hidden forwarding or rule-based collection |
OAuth activity events, which show whether an app is still calling APIs, are available only on certain editions. On other editions you see grants and revocations, not usage. The Google Workspace Audit Log Detection Guide covers alert design, and How to Inventory third party oauth apps in google workspace covers building the register.
Metrics
- Full access holders: number of client IDs holding https://mail.google.com/, trending down.
- Owned and reviewed: percentage of those apps with a named owner and a review in the last 90 days.
- Delegation exposure: number of domain-wide delegation clients with full Gmail access.
- Unregistered grants: full access grants to client IDs not in the register in the last 30 days, target zero.
- Developer narrowing: for your own apps, the share of releases that request no restricted scope beyond what the code calls.
Framework mapping
| Framework | Reference | Applies to |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-6 Least Privilege; CM-7 Least Functionality | Choosing narrow scopes; restricting Gmail |
| NIST SP 800-53 Rev. 5 | SA-9 External System Services; AU-6 Audit Record Review, Analysis, and Reporting | Third-party app approval; OAuth log review |
| NIST CSF 2.0 | PR.AA-05; DE.CM-03 | Enforced access settings; monitoring app activity |
| MITRE ATT&CK v20 | T1528; T1550.001; T1114.002; T1114.003; T1671; T1566.002 | Token theft and use, mail collection, forwarding rules, malicious app integrations, consent phishing |
Practitioner checklist
- Export every client ID that holds https://mail.google.com/, from API controls and the Directory API tokens resource.
- Give each one a named owner and a documented reason that needs permanent deletion; otherwise move it to a narrower scope.
- Set Gmail to Restricted under Manage Google Services after a pilot and an announcement.
- Block or limit unconfigured apps to sign-in information and turn on the access request flow.
- Remove full Gmail access from domain-wide delegation clients unless the need is documented.
- Alert on any new grant of https://mail.google.com/ and on grants by administrators.
- Export OAuth log events continuously beyond the six-month retention.
- For your own apps, map API methods to scopes, request incrementally and plan for restricted-scope verification and CASA reassessment.
- Record every full access grant as a non-human identity with a review date.
Standards and references
- Google for Developers: Choose Gmail API scopes
- Google for Developers: Restricted scope verification
- Google Workspace Admin Help: Control which third-party and internal apps access Google Workspace data
- Google Workspace Admin Help: Control API access with domain-wide delegation
- Google Workspace Admin Help: OAuth log events
- Google for Developers: Directory API tokens resource
- App Defense Alliance: Cloud Application Security Assessment (CASA)
Related NHI Mgmt Group resources: Google Workspace Security Guide · SaaS and OAuth App Governance Guide · OAuth Scope Design Guide · Google Workspace Less Secure Apps Retirement