Assistants use OAuth 2.0 for secure email access

Tomas Reiner, Assistant builder (AI-assisted) ·

Assistants link with Gmail, Outlook, and calendar services by requesting access through the OAuth 2.0 protocol. This method is mandated by both Google and Microsoft and allows the assistant to retrieve or manage emails and events only after you grant explicit permission. In this article, we break down how OAuth works in practice, what permissions are actually granted, and where the boundaries are set by the providers’ documentation.

OAuth 2.0: The Required Standard for Gmail, Outlook and Calendars

Every modern assistant or third-party application that connects to Gmail or Outlook must use OAuth 2.0 for authentication and access delegation[1, 2, 3]. OAuth 2.0 is the protocol both Google and Microsoft require for their APIs, including those for email and calendar services[1, 2].

OAuth 2.0’s core advantage is that it issues access tokens to assistants, letting them use your data without ever seeing or storing your password[1]. Instead, you review and approve the specific permissions requested—such as reading your inbox or managing your calendar—during the connection process.

What Happens When You Connect: The OAuth Flow

When you ask an assistant to connect to your Gmail, Outlook, or calendar, it initiates an OAuth flow. Here’s what that looks like, according to the providers’ documentation[1, 2]:

  1. The assistant redirects you to the provider’s (Google or Microsoft) login and consent page.
  2. You log in directly with the provider (not the assistant) and see a list of permissions the assistant wants.
  3. You approve or deny the requested permissions.
  4. If approved, the provider gives the assistant an access token, which is used to make API calls.

At no point does the assistant receive your password. The access token is time-limited and can be revoked by you at any time through your account settings[1].

For example, a user connecting an assistant to their Gmail sees a Google screen explaining that the assistant is requesting access to read, send, delete, or manage emails. The user can choose which permissions to grant and can revoke them later from their Google account’s security settings[2].

Permissions and Boundaries: What Assistants Can and Cannot Do

OAuth 2.0’s permission system is granular. When connecting, the assistant must specify exactly what it needs—reading email, managing calendars, or both[2]. The provider’s consent screen lists these scopes, and you can approve or refuse.

Some typical permissions include:

  • Read your emails (Gmail)
  • Send email on your behalf
  • Access your calendar events
  • Create or edit events

The assistant cannot access anything you do not explicitly allow. If you only grant access to your calendar, the assistant cannot read your emails, even if it tries[2]. Revoking access is immediate: once you remove the assistant from your account’s third-party access settings, its token becomes invalid.

For Microsoft services, the process is nearly identical, with Microsoft Graph using OAuth 2.0 to connect and enforce permissions at the API level[3].

Security Considerations and Real-World Issues

OAuth 2.0 is built to keep assistants from ever seeing your password and to let you specify exactly which data is shared[1]. Even so, the protocol's security depends on the user’s actions at the moment of consent and on the real identity of the app requesting access:

  • Consent screen spoofing: Attackers have imitated OAuth consent dialogs to trick users into approving access for malicious apps. This risk is not theoretical; well-publicized incidents have forced Google and others to react quickly to shut down fraudulent apps. The core safeguard is still the manual check: confirm the app’s name, logo, and domain before you approve anything.
  • Revoking access: If you suspect a token has leaked, go straight to your Google or Microsoft security settings and revoke the assistant’s access. This action severs the connection immediately, without waiting for a password reset[1].
  • Scope overreach: Some integrations request broad access, such as the ability to read, send, and delete all emails. Scrutinize the list of requested permissions—deny or disconnect any integration that asks for more than the minimum needed for its tasks.

[1] OAuth - Wikipedia

A worked example: Connecting an AI assistant to Gmail and Google Calendar

This is a hypothetical scenario to show the OAuth 2.0 flow, not a tested workflow or a source-based case study.

Suppose you want your AI executive assistant to manage your Gmail inbox and Google Calendar. Here’s how the OAuth 2.0 process works, as specified by Google’s APIs[2]:

  • You start the connection in the assistant’s settings.
  • The assistant opens Google’s OAuth consent page, prompting you to sign in with your Google account.
  • The consent screen lists the permissions requested: “Read, send, delete, and manage your email” and “View and edit events on all your calendars.”
  • You approve both. The assistant receives an access token limited to these scopes.
  • With this token, the assistant can read and respond to emails, add meetings, and update calendar events—only as you instruct. It cannot touch your Drive files, photos, or other Google services unless you grant those permissions separately.
  • If you remove the assistant in your Google account’s security settings, its token is invalidated and access is immediately cut off.

This illustrates how OAuth 2.0 (as used by Google, Microsoft, and others[1,2]) keeps your password private, restricts access by scope, and lets you revoke access instantly.

Questions readers ask

Can an assistant access my password when connecting to Gmail or Outlook?

No. OAuth 2.0 ensures that your password is never shared with or seen by the assistant. Only access tokens are exchanged, and these can be revoked at any time[1].

What if an assistant asks for more permissions than I want to give?

You can deny the request or grant only the permissions you are comfortable with. Most providers display each requested permission and let you choose whether to proceed[2].

How do I remove an assistant’s access after connecting?

Go to your Google or Microsoft account’s security or third-party access settings. Find the assistant in the list and remove it; this revokes its access token and blocks further API calls[1, 2].

How the numbers work

These figures were computed for this article, not estimated by its writer. Inputs come from the numbered sources or are assumptions, labelled as such; change an assumption and the results change with it.

FigureValueWhere it comes from
OAuth support for Google APIs1 yes/nosource [2]
OAuth support for Microsoft Graph1 yes/nosource [3]
OAuth token exposes user password0 yes/nosource [1]
OAuth protocol version in use2source [2]
Assistant can connect to Gmail/Outlook using OAuth1 yes/nocomputed: min(OAuth support for Google APIs, OAuth support for Microsoft Graph)
User password shared with assistant during connection0 yes/nocomputed: OAuth token exposes user password
Protocol used for granting assistant permission2computed: OAuth protocol version in use

Sources

  1. OAuth - Wikipedia
  2. Google APIs - Wikipedia
  3. Microsoft Graph - Wikipedia

More articles