Authorize agents with scopes and Rich Authorization Requests
Private Beta
Agent Identity is available as a Private Beta product, and the information contained in this document is subject to change. You acknowledge and agree that your use of Agent Identity is subject to the terms of the Services in Private Beta. Some features are not yet implemented and others may change before the product is declared as Generally Available. Private Beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Agent Identity represents what an agent is allowed to do with two primitives: OAuth scopes for coarse-grained, standing permissions, and Rich Authorization Requests (RAR) for structured, one-off actions.
Info
Agent Identity is a representation and approval layer, not an enforcement engine. Your resource servers and gateways stay responsible for enforcing the permissions carried in a token. This also offers the flexibility to map permissions into your existing authorization model.
Scopes are opaque strings that represent standing capabilities. Most API gateways and service meshes can authorize requests based on the scope claim in a JWT, so scopes are a portable way to enforce access with tools you likely already run.
Agent Identity supports the built-in OpenID Connect scopes (openid, email, profile, phone, and offline_access) and custom scopes you define.
Register your scopes with Agent Identity and give each one display metadata. We recommend following a resource:action naming convention, such as orders:read or payments:charge.
1{2"scope_definitions": [3{4"name": "orders:read",5"description": "View your order history and order details",6"contains": []7},8{9"name": "orders:admin",10"description": "Manage and modify all your orders",11"contains": ["orders:read"]12},13{14"name": "payments:charge",15"description": "Charge your saved payment methods",16"contains": []17}18]19}
Each definition has three required fields:
name: the scope string used in OAuth requests and tokens.description: human-readable text shown to users on the consent screen.contains: a list of scopes this scope implies. Use an empty array if this scope doesn't contain others.
The contains field defines a hierarchy between scopes. Agent Identity uses this hierarchy to validate scope configurations and to simplify the consent screen. For example, a request for orders:admin and orders:read shows the user a single line, "Manage and modify all your orders," rather than two overlapping permissions.
Agent Identity applies two layers of allowlists so a request can't exceed what either the user or the client is permitted to do.
- User allowlists: the scopes and authorization detail types a user may grant, passed in the user's Trusted Auth Token claims. At request time, Agent Identity filters out any scopes or types the user isn't allowed to grant.
- Client allowlists: the maximum scopes and authorization detail types a client may request, set when you register the client. At request time, Agent Identity filters out any scopes or types that exceed the client's allowlist.