What you will learn
- Explain how a permission, a role and a scope in a token relate to each other
- Name the four default roles and tell two of them apart by what they may do
- Read a route's required permission and decide whether a role passes
- Say why deploying to production needs two permissions
Before you start
- JWT, JWKS, issuer, audience and scope Not started In progress Done
- What happens to a request inside AMS Not started In progress Done
On this page
You meet a scope in two places. A route says “I need amp:agent:build”, and your token says “I carry these scopes”. This lesson explains where the scopes in the token come from and how the two sides meet.
Three layers
Permissions are listed in a catalog
The Agent Manager service defines 103 permissions. Each is written
resource:action, for exampleagent:create. In a token it becomes the ScopeA named permission carried in a token. In Agent Manager it has the form amp:resource:action, for example amp:agent:create.Analogy:One key on a key ring. Each door checks for the one key it needs.See it in the glossaryamp:agent:create. They belong to one Resource serverIn OAuth, what a token is meant for and the owner of a set of scopes. Agent Manager's API is urn:wso2:amp. An MCP proxy using agent identity is one too.See it in the glossary,urn:wso2:amp.Roles bundle permissions
Four default roles are created in ThunderID by the bootstrap files of the Agent Manager install, each bound to a list of scopes on that resource server. The service’s code keeps a matching copy of the four lists, and a test checks that the two agree. A person is given roles, and the RBAC (role based access control)Giving people permissions through roles instead of one by one. In Agent Manager each route names the permission it needs and the token's scopes decide the answer.See it in the glossary that results lives in the identity provider, not in an AMS user table.
The token carries the result
When you sign in, your roles’ permissions arrive in the
scopeclaim of your token. Each route in AMS names the permission it needs, and the scope gate compares the two.
The four default roles
| Role | Permissions | Worth knowing |
|---|---|---|
| Agent Manager Admin | 103 | All of them |
| Platform Engineer | 69 | Has amp:agent:env-production, not amp:agent:create |
| Developer | 56 | Has amp:agent:create, not amp:agent:env-production |
| AI Lead | 51 | The smallest of the four. No amp:agent:create |
All four hold amp:agent:build and amp:agent:env-non-production. These are the roles as shipped.
The route side
A route declares what it needs when it is registered. Most routes need one permission. A few accept any one of a list, and a few need all of a list.
| Route | Needs |
|---|---|
GET /orgs | amp:org:view |
POST an agent’s builds | amp:agent:build |
POST an agent’s deployments | amp:agent:env-non-production |
POST an agent’s deployments/state | amp:agent:suspend and amp:agent:env-non-production |
Registering a gated route with an empty permission list makes the service panic at startup, so a gate cannot be left empty by accident. A few routes deliberately have no scope check, such as the static list of build options.
Two permissions for production
Environments add a second axis. amp:agent:env-non-production is the floor needed to act on environments at all. When the environment is flagged production, amp:agent:env-production is needed too. With the default roles, a Developer can deploy to a non-production environment but cannot act on one flagged production.
Your turn
Under Try it, open Who can call what. Choose a role from the first table and a route from the second, decide the answer yourself, and then read the verdict: does the role’s scope list cover the route? The lens checks only the permissions a route declares, so it does not show the extra production check. In the token inspector, find the scope claim. Finish with the two matchers.
Recap
- A permission such as
agent:createbecomes a scope with theamp:prefix, hereamp:agent:create, in your token. - Roles bundle permissions. The four defaults are Admin (103), Platform Engineer (69), Developer (56) and AI Lead (51), as shipped.
- Your roles’ permissions arrive in the
scopeclaim, and each route names the one it needs. - Production needs
amp:agent:env-productionon top ofamp:agent:env-non-production.
Wrap up
Recap
Tick each one when you could explain it to a colleague.
Finished?
Chapter complete. Every lesson in this chapter is done.
Progress cannot be saved in this browser, so it will be forgotten when you leave this page.
Quick check
Spotted something wrong or unclear in this lesson? Report an inaccuracy (opens GitHub in a new tab)