Capabilities, not scopes: how LumoAuth bounds what an agent may do

An AI agent's capabilities are the actions that it may ever perform. Here is how capabilities differ from OAuth scopes, how LumoAuth stores and matches them, how wildcards work, and why nobody can grant an agent more than they hold.

Least privilege for an AI agent starts with a capability list: the actions that the agent may ever perform, written as names such as invoices:read. An OAuth scope only describes the access in one token. A capability list is stored on the agent’s record, and it limits every token, check and approval for that agent. In LumoAuth, capabilities are stored in one standard form, and * and prefix:* are the only wildcards. Nobody can grant an agent a permission that they do not hold themselves.

TL;DR

  • A capability names one action, such as invoices:read. An agent’s tokens carry a subset of its capabilities as their scope, never more.
  • LumoAuth stores every capability in lower case, with : between the parts. Invoices:Read and invoices:read are one capability, and invoices-read is another. LumoAuth rejects invoices.read: write invoices:read.
  • There are two wildcards. invoices:* covers every current and future action under invoices. A bare * covers everything, and nobody in your organization can grant it.
  • You cannot give an agent a LumoAuth permission that you do not hold, either by name or through a wildcard.
  • A just-in-time request outside the agent’s capabilities always goes to a person. Removing a capability revokes the agent’s live access tokens.

What is the difference between a scope and a capability?

OAuth scopes were designed for one situation: a person lets an app use their account. The app asks for scopes such as profile or calendar, the person agrees on a consent screen, and the token carries what was granted. A scope describes one grant. It does not limit what the app may ask for next time.

An AI agent needs a second layer. It chooses its next action at runtime, often after reading text that someone else wrote. Before the agent asks for anything, a person must set what it may ever do. That setting is the capability list.

  OAuth scope Agent capability
Where it is stored In one token, or in one user’s consent On the agent’s record
Who sets it The client asks for it, and a user or the server agrees A person who may create or edit the agent
Typical shape A broad area, such as profile or admin One action on one resource, such as invoices:read
How long it applies Until the token expires Until someone edits the agent
What it limits One token Every token, Ask API call and just-in-time request for the agent

The two layers work together. An agent can ask for a token with only some of its capabilities in scope, for example to do one task. LumoAuth never issues an agent token with a scope outside the capability list. If the request names no scope, the token carries every capability. A token can therefore be narrower than its agent, but never wider.

Why do AI agents need least privilege?

Least privilege means that each principal holds only the access that its job needs. The rule matters more for agents than for people, because of prompt injection.

An agent reads support tickets, web pages and documents. Any of them can contain instructions, and the agent may follow them. If the agent holds users:delete, an attacker needs only the right sentence in a ticket. If the agent holds tickets:read and tickets:reply, the same sentence produces a refused request and an entry in the audit log.

A capability list also turns a vague question, “what should this agent do?”, into a short list that a reviewer can read. Every later check compares against that same list: the token endpoint, the Ask API and just-in-time requests.

What does a capability look like?

A capability is a name in the form resource:action, such as invoices:read or tickets:reply. Names can have more parts, such as invoices:read:draft. Many OAuth scopes have the same shape, and an agent’s tokens carry its capabilities as their scope.

LumoAuth stores every capability in one standard form. It removes spaces at both ends and converts the name to lower case. It replaces repeated colons with one and removes colons at both ends. A - stays part of the name. Two names that differ only in case become one entry. A name with a . is not stored at all: LumoAuth rejects it and asks for the : form.

You enter LumoAuth stores
invoices:read invoices:read
Invoices:Read invoices:read
invoices::read invoices:read
invoices:* invoices:*
pull-requests:comment pull-requests:comment
invoices.read Nothing. LumoAuth rejects the name: write invoices:read

The Ask API, token exchange and just-in-time requests convert the requested name in the same way before they compare. A call to the Ask API for Invoices:Read therefore matches the stored invoices:read. An agent that asks the Ask API for invoices.read, or requests a token with scope=invoices.read, gets an error. Update code that still writes names with ..

Why does one form matter? Suppose that two parts of a system read spellings differently. A name such as users.* could then pass one check as a plain string, and match users:delete in another check as a wildcard. One stored form, with one set of matching rules, prevents that mismatch. Because LumoAuth rejects the dot form, : is the only separator in a name.

How do wildcards work?

LumoAuth has two wildcards:

  • * covers every action.
  • A name that ends in :* covers every action under that prefix, at any depth.
Capability Covers Does not cover
invoices:read invoices:read, in upper or lower case invoices:read:draft, invoices:write, invoices-read
invoices:* invoices:read, invoices:write, invoices:read:draft invoices, invoices-archive:read, payments:read
* Every action Nothing, but nobody in your organization can grant it

Three details follow from these rules:

  • invoices:* does not cover invoices itself. If a check asks for the bare resource name, list that name separately.
  • A * anywhere else is an ordinary character. *:read and invoices:re* are not wildcards. Each one matches only an action with exactly that name.
  • A - is part of a name, not a separator. invoices-archive is a resource of its own, so invoices:* does not cover invoices-archive:read. For the same reason, invoices-read does not match invoices:read.

Wildcards are also hard to review. invoices:* covers every invoice action that exists today, and every one that someone adds later. The agent’s page shows a wildcard as a warning and a bare * as critical. List the actions one by one when you can.

Who may grant a capability?

One rule applies, called creator containment: you cannot give an agent more authority than you hold yourself.

The rule protects LumoAuth’s permission catalogue. The catalogue holds LumoAuth’s built-in permissions, such as users.view and users.delete, and the permissions that your organization defines. As a capability, a permission takes the same form as any other name, so the permission users.delete is the capability users:delete. LumoAuth checks each capability that is new to the agent:

  • A permission from the catalogue. You must hold it. If you hold users.view but not users.delete, you can grant the first and not the second.
  • A wildcard. You must hold every catalogue permission that it covers. With users.view alone, you cannot grant users:*, because it covers the permission users.delete.
  • A bare *. Always refused, even for an administrator who holds every permission.
  • A name outside the catalogue, such as invoices:read when your organization has no permission named invoices.read. Allowed. It grants no authority inside LumoAuth, so there is nothing to protect. Your API checks it, through the Ask API or in its own code.

When someone edits an agent, LumoAuth checks only the capabilities that they add. A colleague with fewer permissions can still change the agent’s budget or remove a capability. They cannot add a catalogue permission back if they do not hold it.

The Admin API applies the same rule. A call made with an organization API key (lmk_…) is checked against the permissions of the person who created the key. When LumoAuth rejects a capability under this rule, the error names it:

You cannot grant an agent capabilities you do not hold yourself: users:delete. Remove them or ask an administrator who holds these permissions to create the agent.

Without this rule, an agent would be a way around your roles. Anyone who may edit agents could register one with users:delete, get a token for it, and delete users through it.

Where does LumoAuth check capabilities?

LumoAuth compares against the list whenever the agent asks for authority.

  • Token requests. An agent token’s scope is always inside the agent’s capabilities. This applies to the client credentials grant, token exchange, workload attestation and the AAuth platform bridge.
  • The Ask API. The agent sends the action name to POST /agents/ask before it runs a tool. If the agent’s token carries a narrower scope, the action must also be inside that scope.
  • Just-in-time permissions. An agent can ask for extra authority for one task. LumoAuth turns each action in the request into a name such as invoices:approve, and checks each name against the list. A request that names no action is checked as the bare type, such as invoices. A request inside the list may be approved without a person, depending on its risk. A request outside the list always goes to a person, and neither automatic approval nor an approval policy can release it.
  • Removing a capability. LumoAuth revokes the agent’s live OAuth access tokens, so the agent cannot keep using authority that it no longer has. Adding a capability revokes nothing.

Capabilities are not the only input. If your organization uses attribute rules or relationships, a policy can allow an action that the list does not cover. An explicit deny rule always overrides the list. The Ask API reports which source produced the answer in decided_by: capability, pdp or deny_override.

How does an agent check a capability before it acts?

The agent calls the Ask API with the action that it is about to take. In this example, an agent that holds tickets:read and tickets:reply asks whether it may issue a refund:

ORG=acme-corp
# AGENT_TOKEN holds an access token issued to the agent
curl -sS -X POST "https://app.lumoauth.dev/orgs/$ORG/api/v1/agents/ask" \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"action": "refunds:issue", "context": {"ticket": "T-1042"}}'
{
  "allowed": false,
  "action": "refunds:issue",
  "context": {"ticket": "T-1042"},
  "reason": "Agent lacks required capability for 'refunds:issue'.",
  "decided_by": "capability",
  "audit_id": "8f3a1b2c4d5e6f7a"
}

Each call to the Ask API counts against the agent’s budget, if it has one. Once the budget is spent, LumoAuth answers 429. Denials are written to the audit log as agent.capability_check_denied. Allowed calls are not, because agents call the Ask API at every step of their tool loop.

In Python, the lumoauth package wraps the Ask API in ask(). It also has a decorator, @require_capability, for methods that need a capability:

import requests
from lumoauth import LumoAuthAgent, require_capability

HELPDESK = "https://helpdesk.example.com/api"


class SupportAgent(LumoAuthAgent):
    @require_capability("tickets:read")
    def read_ticket(self, ticket_id: str) -> dict:
        return requests.get(f"{HELPDESK}/tickets/{ticket_id}", timeout=10).json()

    def issue_refund(self, ticket_id: str, amount_usd: int) -> dict:
        decision = self.ask("refunds:issue", {"ticket": ticket_id, "amount_usd": amount_usd})
        if not decision["allowed"]:
            return {"refused": decision["reason"], "audit_id": decision["audit_id"]}
        resp = requests.post(
            f"{HELPDESK}/tickets/{ticket_id}/refunds",
            json={"amount_usd": amount_usd},
            timeout=10,
        )
        return resp.json()


# Reads LUMOAUTH_ORG_ID, AGENT_CLIENT_ID and AGENT_CLIENT_SECRET from the environment
agent = SupportAgent()
agent.authenticate()
print(agent.issue_refund("T-1042", 40))

@require_capability fetches the agent’s capability list once. It raises PermissionError before the method runs if the agent does not hold the name. Write the name in its stored form, such as tickets:read, and grant that name to the agent. ask() is the check to rely on. It also applies the token’s scope and your policies, and LumoAuth records each refusal in the audit log.

How do you choose capabilities for an agent?

  1. List the tools that the agent calls, and give each one an action name, such as tickets:read or tickets:reply.
  2. Grant actions, not whole resources. tickets:read and tickets:reply are easier to review than tickets:*.
  3. Leave out actions that the agent needs only rarely. The agent can ask for them through a just-in-time request, and a person approves each one.
  4. Write each name in the form resource:action. LumoAuth rejects resource.action. A - stays part of a name, so pull-requests:* covers only actions on pull requests.
  5. Register separate agents for separate jobs. An agent that reads tickets and an agent that issues refunds should have two short lists, not one long list.
  6. Give every agent at least one capability. An agent with an empty list can authenticate, but LumoAuth rejects it wherever authority is checked, and the portal shows a warning.

How LumoAuth does it

In the Organization Portal, go to Agents (/portal/agents) and choose Register agent. Step 3, What it may do, holds the capability picker:

  • Allowed capabilities lists the permissions in the catalogue, grouped by resource, such as Users, OAuth clients and Audit logs. Each group ends with a wildcard row, such as users:*, marked Wildcard. A row that you cannot grant is disabled, with a note that explains why.
  • Custom capabilities takes your own names, one per line, in the form resource:action. Below the box, the page shows the stored form of each line as you type. A line with a . gets a warning, and saving it fails.

After registration, the agent’s page shows a posture line for its capabilities. No capabilities and Wildcard capabilities are warnings. Unbounded capabilities, for a bare *, is critical. A count such as 3 capabilities is OK. The Test this agent section has a Can this agent…? box. Enter an action, such as invoices:read, and the portal runs the same decision as the Ask API. Each test is audited as agent.test_run.

To change the list from a script, call the Admin API with an organization API key that has the admin:agents:write scope:

ORG=acme-corp
AGENT_ID=agt_42
curl -sS -X PUT "https://app.lumoauth.dev/orgs/$ORG/api/v1/admin/agents/$AGENT_ID/scopes" \
  -H "Authorization: ApiKey $LUMOAUTH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"scopes": ["tickets:read", "tickets:reply"]}'

The list in the body replaces the old list, and creator containment applies. Every change is recorded in the audit log as agent.updated, with the old and new lists.

The docs for the agent registry cover the capability rules and the wizard. The docs for the Ask API show the request and the SDK helpers. The docs for just-in-time permissions explain how requests are approved. This series starts with What is an AI agent identity?, and the previous post covers six ways an AI agent can prove who it is.

Standards involved

  • OAuth 2.0 access token scope, RFC 6749 section 3.3, which carries a subset of the agent’s capabilities in each token
  • OAuth 2.1 and the client credentials grant, for agent tokens
  • OAuth 2.0 token exchange, RFC 8693, where a requested scope can only narrow the agent’s capabilities
  • Rich authorization requests, RFC 9396, for the authorization_details of just-in-time requests

The full list is on the standards reference.

FAQ

What is the difference between an OAuth scope and an agent capability? A scope describes the access in one token, and it often names a broad area such as profile. A capability names one action, such as invoices:read, and is stored on the agent’s record. It is the upper limit for every token, check and approval for that agent. In LumoAuth, an agent token’s scope is always a subset of the agent’s capabilities.

Can I give an agent the * capability? No. LumoAuth rejects a bare * from anyone in your organization, even an administrator who holds every permission. Use a prefix wildcard such as invoices:*, or better, list the actions one by one.

Does invoices:* cover invoices? No. invoices:* covers invoices:read, invoices:write and invoices:read:draft, but not a capability named invoices. Only * and names that end in :* are wildcards. A * anywhere else is an ordinary character.

Can I write a capability as invoices.read? No. LumoAuth rejects invoices.read when you add a capability, when an agent requests a token for your organization’s API and when an agent calls the Ask API. Write invoices:read. LumoAuth’s own permission names, such as users.delete, and the scopes of your MCP servers keep their dots.

Do I have to define my own API’s actions as permissions first? No. Add them as custom capabilities, such as invoices:read. A name outside LumoAuth’s permission catalogue grants no authority inside LumoAuth, so anyone who may edit the agent can add it. Your API then checks the name, through the Ask API or in its own code.

What happens to live tokens when I remove a capability? LumoAuth revokes the agent’s live OAuth access tokens, so the agent cannot keep using authority that it has lost. Adding a capability revokes nothing, because the existing tokens are still inside the new list.


Related: AI agent identity and fine-grained authorization on the solutions pages, and six ways an AI agent can prove who it is on this blog.

Register your first agent at app.lumoauth.dev/register.

Last updated .

Ship passwordless sign-in this week. Put guardrails on your agents today.

The Developer plan is free for 10,000 monthly users and ten agents, with no card. Everything uses open standards, so moving in or out is a config change.