Your AI Agent’s Real Boss Is Its OAuth Token
A calendar assistant may be told to touch one meeting, while its token permits access to every event. Scope the credential, not just the prompt.
December 3, 2026 · 7 min read

Consider a calendar assistant assigned one ordinary job: reschedule the quarterly review, post the new time in Slack, and remove the obsolete calendar hold. The agent reads the invitation, checks attendees’ availability, updates the meeting, sends a channel message, then deletes the hold.
That workflow sounds bounded because the instruction is bounded. The credentials may tell a different story.
If the assistant holds a Google Calendar scope that permits it to view and edit all events available to the user, the quarterly review is only the event it was asked to change. The same token may authorize changes to interviews, medical appointments, customer calls, or an executive meeting the user can edit. A prompt saying “only modify the quarterly review” is guidance interpreted by the model and application. The Calendar API does not see that sentence.
It sees a valid token and an authorized request.
This is the practical permission boundary for many workplace agents: OAuth scopes, which are named permissions an application requests when a user connects an account. They decide which API operations a token can authorize. The agent’s prose instructions sit several layers above them.
Four scope classes become concrete actions
A read scope lets the quarterly-review assistant retrieve information without changing the source system. In Google Calendar, for example, `calendar.events.readonly` permits viewing events, while narrower scopes can limit access to events on calendars the application created or owns.
Microsoft Graph similarly separates delegated permissions such as `Calendars.Read` from `Calendars.ReadWrite`.
Read access is not harmless. An agent that can inspect calendars may collect meeting titles, attendees, locations, conferencing links, and descriptions, depending on the API response and the user’s access. It can place that material in a model context, a trace, or an application database. The absence of write permission stops an API update; it does not prevent disclosure through the agent’s own output or storage path.
Write scopes cross a different line. Google’s `calendar.events` scope permits viewing and editing events on calendars the user can access, while Microsoft’s delegated `Calendars.ReadWrite` permission allows an application to create, read, update, and delete events in user calendars.
“Write” often includes deletion rather than reserving it for a separate delete scope. Anyone reviewing an integration should verify the operations covered by the exact vendor permission instead of inferring them from its short label.
For the quarterly-review workflow, write access lets the agent move the event and alter its attendee list, description, conferencing details, or reminders if those fields are exposed through the tool. The application can present the model with a narrow function such as `reschedule_quarterly_review`, but if that function ultimately sends arbitrary event identifiers and updates through a broad token, its real limit depends on server-side validation around the function call.
Delete access deserves a separate check even when the vendor bundles it into write permission. Removing the obsolete hold is a delete operation, and the API may treat it differently from permanently erasing data. Calendar systems can notify attendees when an event is canceled; mail systems may distinguish moving a message to trash from permanent deletion. Google’s Gmail documentation, for example, describes `gmail.
modify` as allowing reading, composing, sending, and modifying messages while excluding immediate permanent deletion. The broad `mail.google.com` scope includes permanent deletion that bypasses trash.
Delegated access adds the user’s identity to the calculation. A delegated permission means the application acts on behalf of a signed-in user, so its effective reach generally depends on both the granted permission and what that user may access. Microsoft distinguishes delegated permissions from application permissions, under which software can act without a signed-in user. Google and Microsoft also support refresh mechanisms that let an application obtain new access tokens after the short-lived token expires; Microsoft requests this through the `offline_access` scope in its identity platform.
That persistence matters. The assistant does not need a user sitting at the consent screen each time it runs the quarterly-review workflow. A stored refresh token can keep the connection alive until access is revoked, the credential expires under the provider’s policies, or another administrative control intervenes.
The prompt is policy, not enforcement
A system prompt can tell the assistant to read only one calendar, ask before deleting an event, or never send a message outside a named Slack channel. Those rules remain useful. They shape model behavior and can reduce accidental calls.
They do not change the token.
The distinction becomes visible when the agent makes a bad plan. It may select the wrong event because two meetings have similar titles, carry an identifier from an earlier tool result, or treat an untrusted event description as an instruction. If the resulting API call is authorized by the token, the provider normally evaluates the credential, requested operation, resource, and applicable account policy. It does not evaluate whether the call obeyed the agent’s system prompt.
Tool design can enforce a narrower boundary, provided the restriction lives in code outside the model. The calendar tool could reject every event ID except the one selected by a deterministic lookup, allow time changes while blocking attendee and description edits, and require a human approval record before accepting a delete call. A backend service can hold the OAuth token so the model never receives it directly, then validate each requested operation before contacting the vendor API.
That arrangement does not make broad scopes desirable. It creates another control that can contain them when the provider lacks a sufficiently narrow permission. The cost is engineering work, additional failure paths, and a policy layer that must stay aligned with the vendor API. A newly added tool route or an overlooked optional field can reopen access the wrapper was meant to close.
Audit the calls, not the assistant’s description
The useful review unit is the full path from instruction to API request. Start with the quarterly review and write down the minimum operations: retrieve one event, inspect free-and-busy information, update its start and end times, post one Slack message, and delete one known hold after approval. Then match each operation to a vendor-documented scope.
Do not begin with every capability the product might need later. OAuth consent tends to accumulate permissions because adding a broad scope once is easier than prompting users again when a feature expands. That convenience raises the impact of a model error, compromised integration, or stolen refresh token.
The consent screen is only one source of truth. Inspect the application registration in the identity provider, the scopes attached to issued tokens, and the tool code that turns model output into HTTP requests. For Slack, a message-posting tool commonly relies on a scope such as `chat:write`; history access uses separate scopes tied to conversation type. An agent that only posts a scheduling notice does not necessarily need permission to read the channel’s message history.
Run a negative test next. Ask the staging agent to change an unrelated event, delete a different hold, post to an unapproved channel, or fetch an email it does not need. The correct result is a rejection enforced by the tool backend or provider, not a polite model refusal. A model refusal shows that the instruction worked on that attempt.
An authorization failure shows that the operation remains blocked when the model does not cooperate.
Logging should capture the user or service identity, tool name, target resource, requested action, approval state, and vendor response without copying sensitive payloads by default. The log needs to connect one agent run to the resulting API calls, because a transcript that says “calendar updated” cannot establish which event changed or whether the agent attempted another operation first.
Finally, plan revocation. Remove unused scopes, invalidate stored refresh tokens when an employee leaves or disables the integration, and separate credentials for workflows with different risk. The assistant that proposes meeting times can run with read access. A second path can perform the update after approval.
That split adds a step, but it keeps routine reasoning away from the credential that can alter records.
For the quarterly review, the defensible setup is visible in the failed calls: the assistant can inspect the required scheduling data, cannot alter unrelated events, cannot post outside the approved destination, and cannot delete the old hold until the application records approval. The system prompt still explains the job. The token and the code decide where it stops.
Questions people ask
Can an
AI agent exceed the permissions in its OAuth token?
Not through the API authorized by that token. It may still reach data through another connected tool, cached content, or a separate credential, which is why reviewers must inventory every identity and integration used during the run rather than checking one consent screen.
Does a read-only scope make an agent safe?
It prevents covered write operations, but the agent may still retrieve sensitive material and expose it through responses, logs, model context, or downstream tools. Read-only access lowers integrity risk; it does not remove confidentiality or data-retention risk.
Should every delete action require human approval?
Not necessarily. Approval is most useful when deletion is difficult to reverse, affects other people, or rests on ambiguous model judgment. A deterministic cleanup job may use narrow server-side rules instead, but the backend should enforce the eligible resources rather than relying on a prompt.
How can I tell whether a scope is too broad?
List the exact API calls needed for one successful workflow, then compare them with the operations each vendor-documented scope permits. If the credential authorizes unrelated resources or actions, narrow the scope where possible or add server-side resource checks before deployment.
One story a day
The story of the day, in your inbox
One real story about AI each morning — no hype, no alarm, just company for the road.



