OAuth scope
A named permission a token carries, such as tasks:read or tasks:write, limiting what the token may be used for.
In more detail
Separate read from write, keep names stable and narrow, and have the resource server check them at the operation boundary. A valid token without the required scope gets 403 Forbidden. More scopes mean more damage if the token leaks.
Related terms
- access token — A generated string that proves who you are to a service, used instead of a password and revocable on its own.
- least privilege — Giving every program and person only the access they need, and nothing more.
- 403 Forbidden — The HTTP status meaning the server knows who the caller is but that identity is not allowed to do this.
- resource server — In OAuth, the API that holds the protected data and accepts access tokens.
Taught in
- Designing Tools A Model Can Use — AI Engineering: LLM Apps, RAG & Agents
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents
- Excessive Agency — AI Engineering: LLM Apps, RAG & Agents
- Guardrails, Privacy And Governance — AI Engineering: LLM Apps, RAG & Agents
- Basic Auth, Tokens And Sessions — Modern API Architecture: REST, GraphQL & gRPC
- OAuth Two And OpenID Connect — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
References
- RFC 6749: The OAuth 2.0 Authorization Framework
- RFC 9700: Best Current Practice for OAuth 2.0 Security