Skip to content

OAuth and AI Agents: Which Scopes to Grant, Tool by Tool ​

Published on November 6, 2026 by Adrien Crovetto

A robot assistant holding a single small key while a person sets the permissions

An AI agent asks you to connect your Gmail. A Google window opens, with a list of permissions and an "Allow" button. You click, like everyone does.

What you may have just granted: reading, writing, sending and permanently deleting all your emails. For an agent that only needs to summarize your inbox on Mondays, that's far too much.

The problem isn't OAuth, which is a good mechanism. The problem is the scope you accept without reading it. This article tells you which ones to choose, tool by tool.

In one sentence: an OAuth scope is a precise permission you grant to an application, and granting the minimum scope limits what an agent can do, even if it makes a mistake or gets manipulated.

Part of our series on AI agents

Access is an agent's first risk. For the full picture of the risks, read AI Agents: What They Are, How They Work, and the Risks.

At a glance ​

#SectionWhat it changes
1OAuth and scopes in 2 minutesYou understand what you're really authorizing
2The read, write, send testA simple rule for choosing a scope
3GmailYou avoid the scope that gives everything away
4Calendar, Drive and SheetsYou limit access to what the task needs
5Recipes by taskYou copy the minimum for 7 common tasks
6Check and revokeYou stay in control over time

OAuth and scopes in 2 minutes ​

Why it matters ​

Giving your password to an agent means giving it every key, forever. You should never do that.

OAuth works differently, like a valet key: it opens the door and starts the car, but the trunk stays locked. You've probably used it by clicking a Sign in with Google button.

Here's what happens when you connect a tool:

  1. The agent redirects you to Google (or Notion, Slack...)
  2. You see the list of requested permissions: these are the scopes
  3. If you accept, Google gives the agent a token limited to those scopes. The agent never sees your password
  4. You can remove access at any time, without changing your password

The classic scopes: read, write, send ​

Before accepting a scope, ask three questions.

  1. Read: does the agent need to read? Everything, one folder, or only the headers?
  2. Write: does it need to create or modify something? Are drafts enough?
  3. Send, share, delete: does it really need to? If so, you approve every action.
VerbIf the agent gets it wrongExample
ReadData is read for nothingSummarize your emails
WriteData is modifiedFix a spreadsheet
Send, share, deleteIt can't be undoneSend an email, delete a file

The rule: start with read-only. You add write access later, if the results are worth it.

Gmail: the most sensitive ​

Your inbox holds contracts, invoices, password reset emails. It's the first place to reduce permissions.

ScopeWhat Google saysVerdict
gmail.metadataView your email labels and headers, but not the email body✅ Enough to sort by sender
gmail.readonlyView your email messages and settings✅ Summaries, search
gmail.labelsSee and edit your email labels⚠️ For organizing
gmail.composeManage drafts and send emails⚠️ Can send
gmail.sendSend email on your behalf⚠️ Only with approval
gmail.modifyRead, compose, and send emails⚠️ Can send
https://mail.google.com/Read, compose, send, and permanently delete all your email❌ Almost never justified

Two rows deserve a second read: according to Google's descriptions, gmail.compose and gmail.modify can also send. So there is no "drafts only" scope in this list.

The consequence: the "I approve before sending" rule can't rely on the scope. It has to live in the agent, which must ask for your approval before sending anything.

For a weekly inbox summary, a single scope is enough: https://www.googleapis.com/auth/gmail.readonly

Warning

An agent that reads your emails AND can freely send emails is the riskiest combination. If you must give it gmail.compose or gmail.modify, keep human approval on sending.

Calendar ​

ScopeWhat Google saysVerdict
calendar.freebusyView your availability✅ Suggest time slots without seeing your meetings
calendar.events.readonlyView events on all your calendars✅ Prepare your week
calendar.events.ownedSee, create, change, and delete events on calendars you own⚠️ Create meetings
calendarSee, edit, share, and permanently delete all your calendars❌ Too broad

Drive and Sheets ​

ScopeWhat Google saysVerdict
drive.fileSee, edit, create, and delete only the specific files you use with the app✅ The best choice for dropping off a report
drive.readonlySee and download all your files⚠️ Read-only, but the whole Drive
driveSee, edit, create, and delete all your files❌ Too broad
spreadsheets.readonlySee all your spreadsheets✅ Read a tracking spreadsheet
spreadsheetsSee, edit, create, and delete all your spreadsheets⚠️ Only if the agent needs to write

drive.file is the scope to remember: the agent only sees the files you show it, not your whole Drive.

7 common tasks, as examples ​

TaskMinimum scopesAvoid
Summarize Monday's emailsgmail.readonly (or gmail.metadata if sender and subject are enough)gmail.modify, https://mail.google.com/
Prepare reply draftsgmail.readonly and gmail.compose, with approval before any sendgmail.modify
Suggest meeting slotscalendar.freebusycalendar
Prepare your weekcalendar.events.readonlycalendar
Create a meetingcalendar.events.ownedcalendar
Read a tracking spreadsheetspreadsheets.readonlyspreadsheets
Drop a report into a folderdrive.filedrive

List checked on November 3, 2026 against Google's official documentation. Scopes change: check before relying on them.

When the tool has no fine-grained scope ​

Not every tool offers permissions this precise. Some CRMs and smaller tools work on an "all or nothing" basis. In that case, limit access another way:

  • A dedicated account for the agent, with a viewer role when possible
  • A limited space: a folder or project shared only with the agent
  • A dry run: first connect an account that holds no sensitive data

In Google Workspace, the administrator can also control which third-party apps are allowed to connect. For a small business or a startup, it's a good habit before opening access to the whole team.

Check and revoke ​

Access granted six months ago for a test is still open today, unless you remove it. Once a month, take 10 minutes:

Removing an app's access doesn't require changing your password. That's the whole point of OAuth.

With Haloon Agent

In Haloon, access is limited tool by tool, and the agent never sees your OAuth keys. You choose which tools you connect and which ones the agent can use. Sensitive actions wait for your approval. Discover Haloon Agent.

Mistakes to avoid ​

Clicking "Allow" without reading ​

The list of permissions is there to be read. If you don't understand a line, don't grant it.

Using your main account for a trial ​

Test first with a test account or folder. You'll widen access later.

Forgetting old connections ​

Every forgotten integration is an open door. The monthly cleanup is enough.

Thinking the scope replaces human approval ​

A scope limits what the agent can do. It doesn't decide what it should do. Keep your approval on anything irreversible.

Frequently asked questions ​

What is an OAuth scope? ​

A scope is a precise permission you grant to an application, for example "read your emails" or "see your availability". It limits what the application can do with your account.

Does the agent see my password? ​

No. With OAuth, you sign in with the provider (Google, for example). The agent receives a token limited to the scopes you accepted. With a good harness, like Haloon's, the agent doesn't even see your OAuth tokens, which reduces security risks even further.

How do I remove an agent's access? ​

In your account's security settings, under connected apps, you can remove access for an entire application or for one specific agent. You don't need to change your password.

Is read-only access enough for a useful agent? ​

Yes, for many tasks: summaries, monitoring, reports, preparing drafts. Only add write and send access if the task requires it.

Summary ​

#Key pointWhy
1OAuth gives limited, revocable accessThe agent never sees your password
2The scope decides what the agent can doChoose the narrowest one
3Read, write, sendStart with read-only
4gmail.compose and gmail.modify can sendApproval before sending must live in the agent
5drive.file rather than driveThe agent only sees the files you show it
6A dedicated account or folder if the tool is "all or nothing"You limit the possible damage
7A 10-minute monthly checkOld access doesn't stay open

The right habit fits in one sentence: give the agent the valet key, not the key to the safe. The full context is in the guide to AI agents, and to learn how to write the procedures the agent will follow, read How to Write Good Skills for Your AI Agents.

Ready to delegate your first task? Create your first agent on Haloon: you describe what you want, Haloon takes care of the tools, the access and the guardrails.