CYBERBLOG
OAuth Consent & Delegated Tokens in Enterprise AI Assistants

Review OAuth app consent, delegated scopes, RFC 8707 audience limits, and revocation boundaries before connecting enterprise AI assistants to SaaS data.
By Harpreet Singh, CISSP, CCSP · Published December 3, 2026 · Enterprise AI & SaaS Boundary Watch
Connecting an enterprise AI assistant to corporate email, cloud storage, or issue trackers rarely requires a new network firewall rule. Instead, it happens through a single OAuth 2.0 consent prompt. Once a user or administrator approves that connector, the AI platform receives a delegated access token—and often a long-lived refresh token—that lets its backend act as that user across Software as a Service (SaaS) APIs. Unlike an interactive human clicking through one document at a time, an AI assistant can retrieve, summarize, and chain actions across thousands of records at machine speed, and untrusted text inside those records can steer what it calls next.
This guide examines the trust boundary created by OAuth app consent and delegated tokens in enterprise AI deployments. It separates confirmed protocol specifications and vendor controls—specifically IETF RFC 8707, IETF RFC 9700, Microsoft Entra ID, Google Workspace, and OWASP GenAI guidance—from architectural inference and clearly labelled hypothetical scenarios. It also provides read-only inventory checks, failure modes, and rollback steps so identity and security teams can bound AI connector authority before broad rollout.
In this guide
The OAuth trust boundary in enterprise AI workflows
In standard OAuth 2.0 (RFC 6749), four roles interact: the resource owner (the employee), the authorization server (your identity provider such as Microsoft Entra ID or Google Auth Platform), the client (the AI assistant or its SaaS connector service), and the resource server (Microsoft Graph, Google Workspace APIs, Salesforce, or an internal API). The security boundary sits at the authorization server and the resource server, not inside the language model.
When an employee approves an AI connector, the identity provider evaluates the user's authentication and consent policy, then issues tokens to the AI vendor's backend. From that moment forward, the resource server trusts any request carrying a valid bearer token within its granted scopes and audience. The resource server cannot tell whether a request originated from an explicit human click, an autonomous background loop, or an indirect prompt injection hidden inside an incoming email. As we detailed in MCP and Agent Tool Security, putting the enforcement boundary outside the model is the only reliable way to constrain impact.
Delegated permissions versus application permissions
Identity platforms distinguish two fundamentally different grant models, and confusing them is one of the fastest ways to create a tenant-wide exposure:
| Dimension | Delegated Permissions (On-Behalf-Of User) | Application Permissions (App-Only / Daemon) |
|---|---|---|
| Effective authority | Intersection of the signed-in user's permissions and the scopes granted to the AI app | Tenant-wide or resource-wide access across all matching objects without a signed-in user |
| Typical AI use case | Interactive personal or team assistant summarizing the user's own email, calendar, or accessible files | Background indexing pipelines, automated security triage, or organization-wide knowledge ingestion |
| Consent requirement | May allow self-service user consent unless restricted by tenant app consent policies | Requires explicit administrator consent (such as Global or Privileged Role Administrator in Entra ID) |
| Primary blast radius | Everything the consenting user can read or modify within the granted scopes—including over-shared SharePoint or Drive folders | Every mailbox, site, or repository in scope across the tenant if the connector service or its client secret is compromised |
| Revocation boundary | Revoking user refresh tokens and removing the user's delegated grant | Disabling the enterprise service principal, rotating/revoking app credentials, and removing app role assignments |
A common misconception is that delegated permissions are automatically safe because the AI assistant only sees what the user can see. In practice, two factors undermine that assumption. First, many employees have inherited read access to broad internal sites, archived channels, or shared drives they rarely open manually; an AI assistant indexes and surfaces those paths immediately. Second, when a user consents to broad write scopes such as sending mail or modifying files, the assistant gains ambient authority to perform consequential actions without re-prompting for Multi-Factor Authentication (MFA). OWASP categorizes this architectural gap under Excessive Agency (LLM06:2025 / LLM03:2026) and Agentic Identity and Privilege Abuse (ASI03).
Protocol and identity controls that narrow token reach
Confirmed protocol standards and enterprise identity controls give defenders concrete levers to shrink OAuth token blast radius:
- Audience-restricted tokens with RFC 8707: RFC 8707 (Resource Indicators for OAuth 2.0) defines the
resourcerequest parameter so an OAuth client explicitly names the target resource server during authorization and token requests. The authorization server can then bind the issued access token's audience (audclaim) to that single API. If an AI connector holds a token intended for a low-sensitivity knowledge API, a properly configured downstream SaaS API rejects that token if it is replayed against a higher-sensitivity endpoint. - Modern OAuth security baseline (RFC 9700): RFC 9700 (Best Current Practice for OAuth 2.0 Security, BCP 240, published January 2025) updates RFC 6749, 6750, and 6819. It requires Proof Key for Code Exchange (PKCE) for authorization code flows, strict exact-match redirect URI validation, deprecation of the implicit and resource owner password credentials grants, and sender-constraining or refresh-token rotation for public clients. When evaluating a third-party AI vendor's SaaS connector, confirm its OAuth client follows RFC 9700 rather than legacy static-redirect or non-rotating token flows.
- Microsoft Entra ID admin consent workflow and app consent policies: Microsoft documents two complementary controls: app consent policies restrict whether users can self-consent (for example, blocking all user consent or restricting it to verified publishers and low-impact permissions), while the admin consent workflow routes blocked requests to designated reviewers (such as Application Administrators) with a business justification rather than pushing users toward shadow accounts.
- Google Workspace API controls: Under Google Workspace App access control (Admin console > Security > Access and data control > API controls), administrators can classify third-party OAuth apps by Client ID as Trusted, Limited, or Blocked, and restrict unconfigured apps so users cannot silently authorize AI assistants to read Gmail or Google Drive.
- Separate read authority from write actions: Grant read-only scopes (such as mail or file read scopes limited to specific folders or sites where supported) to general research assistants. Require a separate, narrowly scoped workflow and an explicit human approval gate before any AI connector can send external communications, change permissions, or delete records.
For broader governance on categorizing approved versus unapproved AI tools before consent policies are tightened, see our Shadow Agentic AI Governance guide and the AI Security hub.
Hypothetical failure: broad consent meets indirect prompt injection
Labelled hypothetical example (illustrative scenario, not a reported breach): Consider a mid-sized organization where user consent remains enabled by default for verified-publisher apps. A project manager connects a third-party AI meeting assistant to Microsoft 365 using delegated scopes that include Mail.ReadWrite, Mail.Send, Files.Read.All, and offline_access. The user has legitimate read access to a finance SharePoint library that is shared with all managers.
Later, an external sender emails a vendor proposal containing hidden text instructing an AI summarizer to locate recent quarterly forecast spreadsheets and forward a summary to an external address. Because the assistant holds a valid delegated token with both Files.Read.All and Mail.Send, and no human-in-the-loop approval gate sits between reading documents and sending outbound email, the SaaS API honors both calls as authentic requests from the project manager. MFA is not re-triggered because the refresh token was already issued during initial consent. Removing Mail.Send from the assistant's granted scopes and restricting user consent to reviewed read-only integrations breaks this chain even if the model follows the injected text.
Read-only and synthetic verification workflow
Validation status notice: The commands and checks below are documentation-derived read-only reference examples prepared from official Microsoft Graph PowerShell and OAuth 2.0 specifications. They were not executed against a live production tenant during authoring of this article. Test them first in a non-production or authorized read-only session using least-privilege audit roles.
1. Inventory delegated OAuth grants in Microsoft Entra ID (read-only)
Purpose: Identify active delegated permission grants (OAuth2PermissionGrant) across your tenant so you can spot AI assistants holding write, send, or broad read scopes. Required permission: Directory.Read.All (read-only) in Microsoft Graph PowerShell.
# Read-only Microsoft Graph PowerShell inventory (requires Microsoft.Graph.Identity.SignIns)
Connect-MgGraph -Scopes "Directory.Read.All"
$grants = Get-MgOauth2PermissionGrant -All
$grants | ForEach-Object {
$sp = Get-MgServicePrincipal -ServicePrincipalId $_.ClientId -ErrorAction SilentlyContinue
[PSCustomObject]@{
AppDisplayName = $sp.DisplayName
ClientId = $_.ClientId
ConsentType = $_.ConsentType # AllPrincipals (tenant-wide) vs Principal (single user)
Scope = $_.Scope
}
} | Where-Object { $_.Scope -match "Mail\.|Files\.|Sites\.|offline_access" } |
Sort-Object ConsentType, AppDisplayName |
Format-Table -AutoSize
Expected evidence: A table distinguishing AllPrincipals (tenant-wide admin consent) from Principal (individual user consent) alongside exact scopes. Flag any AI assistant holding Mail.Send, Mail.ReadWrite, Files.ReadWrite.All, or unreviewed offline_access grants for scope reduction or revocation.
2. Audit third-party OAuth apps in Google Workspace (read-only)
Purpose: Verify whether unconfigured third-party AI connectors are blocked from accessing sensitive Workspace scopes. Required privilege: Google Workspace administrator with Service Settings read/view access.
- In the Google Admin console, open Security > Access and data control > API controls > Manage Third-Party App Access.
- Export or review the configured apps list and filter for unreviewed AI assistants, note-takers, and workflow connectors requesting Gmail, Drive, or Calendar scopes.
- Inspect the Unconfigured third-party apps policy setting and verify that access to sensitive or restricted Google Workspace services is restricted rather than open by default.
3. Synthetic JWT audience and scope boundary check
Purpose: Confirm that a custom internal AI connector or MCP gateway validates both the aud (audience) and scp (scope) claims on incoming bearer tokens before calling a backend service. Below is a synthetic decoded token payload illustrating a properly bounded read-only grant (non-production example; never paste real production tokens into public decoders):
{
"iss": "https://login.example.com/tenant-id/v2.0",
"sub": "user-synthetic-1042",
"aud": "https://kb-api.internal.example.com",
"scp": "kb.articles.read",
"exp": 1796310000,
"iat": 1796306400
}
Verification test: Present a synthetic test token whose aud is https://kb-api.internal.example.com to a separate staging API (such as https://mail-gateway.internal.example.com). The staging API must return HTTP 401/403 and log an audience mismatch. If the second API accepts the token, RFC 8707 audience enforcement is missing or misconfigured.
Failure modes, operational impact, and rollback steps
Tightening OAuth consent policies and revoking over-broad tokens can disrupt legitimate business tools if rolled out abruptly. Plan for four common failure modes:
- Password resets do not always revoke delegated refresh tokens: Resetting a user's password after a suspected connector compromise does not automatically invalidate existing OAuth refresh tokens or third-party app grants across every platform. Always revoke sign-in sessions and delete the specific OAuth grant; see our session revocation verification guide for confirming that active tokens actually stop working.
- Sudden user-consent lockouts drive shadow AI adoption: Disabling user consent without enabling the admin consent workflow leaves employees hitting opaque error screens, which often pushes them to upload corporate files manually into personal consumer AI accounts. Enable the approval workflow and publish a clear turnaround SLA before tightening default user consent.
- Breaking legitimate SaaS integrations during cleanup: Revoking a tenant-wide grant (
AllPrincipals) immediately disconnects every user relying on that app. Before revoking a high-usage connector, check sign-in logs for active users, notify the business owner, and stage a narrower replacement permission set or scoped test group first. - Clean rollback path: Record the exact service principal ID, Client ID, original scope list, and assigned user groups before removing or narrowing a grant. If a critical workflow breaks, administrators can restore the specific app to a pilot security group with documented compensating monitoring rather than re-enabling tenant-wide self-service consent.
Enterprise AI OAuth boundary checklist
- Inventory all existing third-party AI assistants and SaaS connectors holding delegated or application OAuth grants in Entra ID and Google Workspace.
- Restrict default user consent for unverified or high-impact scopes and enable the admin consent review workflow with named reviewers.
- Separate read-only AI research connectors from write-capable or outbound-messaging tools, requiring explicit human approval for consequential actions.
- Verify RFC 8707 audience binding (
aud) and RFC 9700 controls (PKCE, exact redirect URIs, refresh-token rotation) on custom and vendor AI connectors. - Test token and grant revocation end-to-end with a synthetic test account so incident responders know how quickly an AI connector loses access.
- Document approved AI connectors, scope justifications, owners, and review dates in your risk register alongside the CyberInsights GRC playbook and AI Security Questions guide.
Reviewed December 3, 2026. Educational technical guidance grounded in IETF RFC 8707, IETF RFC 9700, Microsoft Entra ID, Google Workspace, and OWASP GenAI documentation. Verify platform-specific licensing and API behavior in your own authorized test environment before changing production consent policies.
Sources and further reading
- IETF RFC 8707: Resource Indicators for OAuth 2.0
- IETF RFC 9700: Best Current Practice for OAuth 2.0 Security (BCP 240)
- IETF RFC 6749: The OAuth 2.0 Authorization Framework
- Microsoft Entra ID: Configure the admin consent workflow
- Microsoft Entra ID: Manage app consent policies
- Google Workspace Admin Help: Control which third-party & internal apps access Google Workspace data
- OWASP GenAI Security Project (LLM Top 10 & Agentic Applications)