A scope is a string identifier that defines the specific permissions granted to an access token in OAuth 2.0 and OpenID Connect. During the authorization request, a client application requests one or more scopes, which the resource owner (user) consents to. The resulting access token is only valid for the operations and resources explicitly defined by these granted scopes, enforcing the principle of least privilege. This granular control is fundamental to secure API authentication flows.
Glossary
Scope

What is Scope?
In OAuth 2.0 and OpenID Connect, a scope is a mechanism that limits an application's access to a user's account, representing a specific permission or set of permissions (e.g., read, write) that the access token will grant.
Scopes are defined by the resource server (the API) and published in its documentation or metadata. Common examples include read:data for view-only access and write:data for modification rights. The authorization server validates requested scopes and includes them in the issued token. The resource server must then verify the token's scopes match the required permissions for each API endpoint. This mechanism is distinct from, but often used alongside, role-based access control (RBAC) systems.
Key Characteristics of OAuth Scopes
In OAuth 2.0 and OpenID Connect, a scope is a string that defines the specific permissions granted to an access token. These characteristics govern how access is delegated and controlled between applications, users, and resources.
Granular Permission Definition
A scope is a space-separated list of case-sensitive strings that represent discrete permissions. Each string corresponds to a specific access right the client application requests. Common examples include:
read:userfor viewing a user's profile.write:repofor committing code to a repository.openidandemailfor identity claims in OpenID Connect. The authorization server validates requested scopes against those registered for the client and those the resource owner is authorized to grant.
User Consent & Authorization
During the authorization flow, requested scopes are presented to the resource owner (the user) in a human-readable format as part of the consent screen. The user can approve or deny the entire request or, if supported, selectively approve individual scopes. The final set of granted scopes is encoded into the resulting access token, typically within the scope claim of a JWT. The resource server must validate that the token's scopes permit the requested action.
Dynamic vs. Static Scope Assignment
Scopes can be assigned dynamically or statically:
- Dynamic Scopes: Requested at runtime by the client application. The authorization server evaluates these per authorization request.
- Static Scopes: Pre-configured and associated with a client's registration. The client may only request from this pre-approved list. This distinction is crucial for security governance, as static scopes limit the potential damage from a compromised client, while dynamic scopes offer greater flexibility for user-centric applications.
Hierarchical and Custom Scopes
While the OAuth 2.0 framework does not define a formal hierarchy, scope design often implies one for API design clarity. For example, admin:write may be considered a superset of user:write. Authorization server logic must enforce these implied relationships.
Organizations also define custom, domain-specific scopes for their APIs (e.g., process:invoice, launch:rocket). These must be documented in the API's authorization server and clearly communicated to integrating developers.
Scope vs. Role-Based Access Control (RBAC)
Scopes and RBAC are complementary but distinct authorization models:
- Scopes answer "what can this token do?" They are attached to the access token and define permissible actions on APIs.
- RBAC answers "what is this user allowed to do?" It is a system of user roles and permissions managed within the application or identity provider. In a common pattern, a user's RBAC roles are evaluated during authentication, and the resulting permissions are mapped to OAuth scopes issued in the token. The resource server then authorizes based solely on the token's scopes.
Security and Implementation Best Practices
Proper scope implementation is critical for the principle of least privilege. Key practices include:
- Use precise, action-oriented scope names (e.g.,
files:readnot justaccess). - Validate scopes on both the authorization and resource servers.
- Implement incremental authorization, allowing users to grant additional scopes in future sessions without re-consenting to previously granted ones.
- Document all available scopes and their semantics for API consumers.
- Limit the lifetime and use of refresh tokens to control the duration of granted scopes.
How Scopes Work in the OAuth 2.0 Flow
A scope is a core OAuth 2.0 mechanism that defines the specific permissions an access token grants, enabling fine-grained authorization control for AI agents and applications.
In the OAuth 2.0 authorization framework, a scope is a string that represents a specific permission or set of permissions an application requests to access a user's resources. During the initial authorization request, the client application includes a scope parameter listing desired permissions, such as read:contacts or write:files. The authorization server presents these scopes to the resource owner (user) for consent, and the resulting access token is issued with these authorized permissions embedded, typically within a JWT (JSON Web Token). The resource server then validates the token and its scopes before granting access to the protected API endpoint.
Scopes enforce the principle of least privilege, ensuring AI agents and applications only receive the minimum access necessary. They are distinct from role-based access control (RBAC), as scopes are tied to the token and API, not the user's organizational role. For machine-to-machine flows like the Client Credentials grant, scopes define what backend services the client can call. Effective scope management is critical for security, requiring clear naming conventions, documentation, and validation via token introspection to prevent privilege escalation in autonomous systems.
Frequently Asked Questions
Common questions about OAuth 2.0 and OpenID Connect scopes, the permission strings that define what an access token allows an application to do.
In OAuth 2.0 and OpenID Connect, a scope is a string that represents a specific permission or set of permissions that an application requests to access a user's resources. It acts as a fine-grained authorization mechanism, limiting the access token's power to only the operations and data explicitly granted by the user during consent. For example, an application might request the read:contacts scope to only read a user's address book, not modify it. Scopes are defined by the resource server (the API) and are validated when the access token is used, ensuring the client cannot exceed its authorized privileges.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Scopes are a core component of modern authorization frameworks. Understanding related concepts is essential for designing secure access controls for AI agents and backend integrations.
Access Token
An access token is a credential used in OAuth 2.0 to access protected resources on behalf of a user or client. It is a bearer token that contains authorization information, such as the client identity, user identity, granted scopes, and an expiration time. The resource server validates the token's signature and checks that the token's scopes permit the requested action before granting access.
- Bearer Credential: Possession of the token grants access; it must be kept secret.
- Limited Lifetime: Short-lived to minimize risk if compromised.
- Scope Enforcement: The token is only valid for the specific permissions (scopes) it was issued for.
OAuth 2.0
OAuth 2.0 is the industry-standard authorization framework upon which the scope mechanism is defined. It enables a third-party application to obtain limited access to a user's resources on an HTTP service without sharing the user's credentials. Scopes are the primary vehicle for expressing this limited access.
- Delegated Authorization: Allows users to grant limited access to their data to another application.
- Flow-Based: Defines several grant types (e.g., Authorization Code, Client Credentials) for different client types.
- Scope-Centric: All access tokens issued under OAuth 2.0 are associated with a set of scopes defining the token's authority.
OpenID Connect (OIDC)
OpenID Connect is an identity layer built on top of OAuth 2.0. While OAuth scopes control access ("what can you do?"), OIDC introduces standard scopes to control identity information ("who are you?").
- Standard Identity Scopes: Defines scopes like
openid,profile,email, andaddressto request specific user claim sets. - ID Token: Returns a signed JWT containing user identity claims, separate from the OAuth access token.
- Hybrid Use: An AI agent might use OAuth scopes for API access and OIDC scopes to retrieve the user's basic profile for personalization.
Role-Based Access Control (RBAC)
Role-Based Access Control is a complementary authorization model often used in conjunction with OAuth scopes. RBAC assigns permissions to roles (e.g., 'admin', 'viewer'), and users are assigned to roles. In enterprise systems, the OAuth scope requested or granted might be derived from a user's RBAC role.
- Coarse-Grained vs. Fine-Grained: RBAC roles are typically broader, while OAuth scopes can be more granular.
- System-Level Enforcement: RBAC is often enforced inside the resource server after the OAuth token (with its scopes) has been validated.
- Example: A user with the 'Editor' RBAC role might be granted the
content.readandcontent.writeOAuth scopes automatically.
Token Introspection
Token introspection is an OAuth 2.0 extension (RFC 7662) that allows a resource server to query the authorization server to check the active state of an access token and retrieve its metadata. This is a critical mechanism for scope validation in distributed systems.
- Active State Check: Confirms the token has not been revoked or expired.
- Metadata Retrieval: Returns a JSON response containing the token's
scope,client_id,username, and expiration. - Security Posture: Allows resource servers to defer to the central authorization server for the definitive truth about a token's permissions, ensuring consistent scope enforcement.
Consent Screen
The consent screen is the user interface presented by the authorization server during the OAuth flow where the user reviews and approves the scopes being requested by the client application. It is the user's point of control for delegated permissions.
- Informed Consent: Clearly lists the scopes (e.g., "Read your email," "Update your profile") in human-readable language.
- Security Best Practice: A key defense against malicious applications requesting excessive permissions.
- Auditability: The user's grant of specific scopes is logged by the authorization server, creating an audit trail.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us