OAuth app setup guide

Gmail

Google·review required·Library guide 2026-12-05·spot-checked
JSON

Reading and processing user emails requires Restricted OAuth scopes, demanding brand verification, a recorded demo video, and an annual third-party CASA security assessment.

Difficulty
4/5
Your hands-on time
3–8 h
Waiting on provider
14–56 days
uncertainS7S8S10
Evidence
1 tested · 23 sourced · 4 uncertain

Depends on what your agent does

self-serve

Development, testing, or internal Workspace use

Any scope in testing status or internal Workspace apps

Self-serve access for testing or personal use (limited to 100 test users with an unverified app warning screen). sourcedS5S7S10

self-serve

Manage labels and add-on interactions

https://www.googleapis.com/auth/gmail.labels, add-on action scopes

Non-sensitive scopes such as label management or Workspace add-on message triggers require only basic setup and optional brand verification. sourcedS2S4S5

review required

Send emails on behalf of user

https://www.googleapis.com/auth/gmail.send

Sensitive scopes allow sending emails on behalf of a user without reading whole mailboxes, triggering sensitive-scope OAuth verification without an external CASA audit. sourcedS2S4S5S8

review required

Read, summarize, and act on user emailsthis guide

https://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.modify, https://mail.google.com/

Restricted scopes allow reading, modifying, or managing full mailboxes; server-side agents accessing these must undergo formal Google app verification plus an annual independent third-party security assessment (CASA). sourcedS2S4S5S7S8S9S10

Stepsfor: Read, summarize, and act on user emails

1

Access Google Cloud Console · ~15 min

Log in to Google Cloud Console and select or create the Google Cloud project for your application. testedS3S5S7A1

you
2

Verify domain ownership in Search Console · ~30 min

Verify ownership of your application's domain in Google Search Console using the same account associated with your Cloud project. sourcedS7

you
3

Configure OAuth consent screen branding · ~30 min

In the Google Auth Platform / Branding section, configure app name, user support email, developer contact email, homepage URL, and privacy policy URL. sourcedS5S7

you
4

Create OAuth 2.0 credentials · ~15 min

Generate OAuth 2.0 Web application credentials (client ID and client secret) and configure authorized redirect URIs. sourcedS1S3

agent can
5

Declare Gmail API scopes · ~15 min

Declare requested scopes (such as gmail.readonly or gmail.modify) under Data Access in Google Cloud Console. sourcedS2S5S7

agent can
6

Record and upload demo video · ~60 min

Record an unlisted YouTube demo video demonstrating the full OAuth flow in English, displaying the client ID in the address bar and showing how each requested scope functions in the agent. sourcedS7

you
7

Submit OAuth verification request · ~30 min

Submit the brand verification and restricted scope review via Google Cloud Console, providing justifications and links to policy documents and the demo video. sourcedS5S7

you
8

Wait for Google Trust & Safety review

Wait for Google Trust & Safety review and respond to clarification emails regarding scope minimization and usage. uncertainS7S8S10

wait
9

Undergo third-party CASA security assessment · ~120 min

Complete the CASA Tier 2 security assessment via an approved assessor lab, resolving any DAST scan or questionnaire findings. uncertainS7S8S10

you
10

Wait for final verification approval

Wait for lab approval and issuance of the Letter of Assessment (LOA) to Google to publish the app to external production users. uncertainS7S8

wait
What an agent can do for you
  • Draft code to implement OAuth 2.0 authorization code flow and token refresh handling.
  • Formulate scope list and justify minimal data access requirements.
  • Prepare privacy policy disclosures matching Google API Services User Data Policy requirements.
  • Generate configuration parameters and redirect URIs for Google Cloud Console.
Where you take over
  • Sign in to Google Cloud Console with your organization or developer account.
  • Verify domain ownership in Google Search Console.
  • Record and upload the YouTube OAuth consent demo video.
  • Contract, pay for, and coordinate with an authorized CASA assessment lab.
  • Handle official email communications with Google Trust & Safety.

Requirements

Ownership of authorized domain verified in Google Search Console using the project owner/editor account.sourcedS7
Publicly accessible home page hosted on the authorized domain explaining application features.sourcedS7
Privacy policy hosted on the same domain as the home page that discloses how Google user data is accessed, used, stored, or shared, adhering to Google API Services User Data Policy.sourcedS7
An unlisted YouTube demo video showing OAuth consent with client ID visible in the browser URL bar and live usage of every requested scope.sourcedS7
Annual third-party security assessment (CASA) by an authorized lab if restricted data is accessed by or through a server.sourcedS2S4S7S8S9S10

Nuances and gotchas

Unverified apps in development/testing mode are capped at 100 test users and show a full-screen unverified app warning screen.sourcedS2S7S8S10
Restricted scope approval must be recertified annually with a new CASA security assessment every 12 months.sourcedS4S7S8
Brand verification must be published within 7 days of approval, otherwise it expires and requires re-verification.sourcedS7
Gmail sending (gmail.send) is sensitive, whereas reading (gmail.readonly) and modifying (gmail.modify) are restricted, triggering higher verification standards and CASA.sourcedS2S8
Verification is exempt if the app is strictly internal to a single Google Workspace organization or deployed domain-wide by Workspace admins.sourcedS5S7S9

If you get blocked

ProblemApplication attempts to request broader scopes than strictly needed (e.g. requesting https://mail.google.com/ instead of gmail.readonly or gmail.send). sourcedS2S7
What to doDowngrade your requested scopes in Cloud Console to the minimum required permissions before submitting for review.
ProblemDemo video fails to clearly show the client ID in the browser address bar or omits demonstrations for all requested scopes. sourcedS7
What to doRe-record the demo video ensuring the browser address bar clearly shows the client ID and that each feature mapped to requested scopes is demonstrated.
ProblemPrivacy policy fails to explicitly disclose how Google user data is accessed, stored, or processed, or violates Limited Use rules. sourcedS7
What to doUpdate the privacy policy on your verified domain to comply strictly with the Google API Services User Data Policy.

What we could not verify

  • Current standard vendor fees and tier assignment criteria for CASA security assessment labs are not detailed in official Google developer documentation and must be confirmed directly with App Defense Alliance-approved assessors.
  • Specific handling of LLM fine-tuning or AI retention rules under the Limited Use Policy requires reviewing current Google Workspace API developer policy updates directly in the developer portal.

Evidence

Screenshot of https://accounts.google.com/v3/signin/identifier?continue=https://console.cloud.google.com/apis/credentials&followup=https://console.cloud.google.com/apis/credentials&osid=1&passive=1209600&service=cloudconsole&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S1074316656:1796487178556970
A1 · tested local Chrome (headless) · 2026-12-05

Opened https://console.cloud.google.com/apis/credentials → landed on https://accounts.google.com/v3/signin/identifier?continue=https://console.cloud.google.com/apis/credentials&followup=https://console.cloud.google.com/apis/credentials&osid=1&passive=1209600&service=cloudconsole&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S1074316656:1796487178556970 (“Google Cloud Platform”). A sign-in wall appeared; the agent stopped here (it never enters credentials). Headings: Sign in. Buttons/links: Next.

Screenshot of https://accounts.google.com/v3/signin/identifier?continue=https://console.cloud.google.com/apis/credentials/oauthclient&followup=https://console.cloud.google.com/apis/credentials/oauthclient&osid=1&passive=1209600&service=cloudconsole&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S269214296:1796487181703507
A2 · tested local Chrome (headless) · 2026-12-05

Opened https://console.cloud.google.com/apis/credentials/oauthclient → landed on https://accounts.google.com/v3/signin/identifier?continue=https://console.cloud.google.com/apis/credentials/oauthclient&followup=https://console.cloud.google.com/apis/credentials/oauthclient&osid=1&passive=1209600&service=cloudconsole&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S269214296:1796487181703507 (“Google Cloud Platform”). A sign-in wall appeared; the agent stopped here (it never enters credentials). Headings: Sign in. Buttons/links: Next.

What the checks changed
  • Spot-check: Confirmed on developers.google.com (restricted scope verification): restricted scopes “require additional verification and potentially a security assessment”.
  • Spot-check: Confirmed: apps accessing restricted data via a third-party server “must undergo an annual security assessment by a Google-approved third party”.
  • Spot-check: Not verified: total wait in weeks. Google states no SLA, so the wait range relies on third-party write-ups and is labelled accordingly.

Built with gemini-3.8-flash (search) + gemini-3.8-flash (writing). Labels are computed from the evidence each statement cites, never written by the model. How this works

Gmail OAuth app guide · Greenlight