Roles and scopes
Authorization
JWT validation, scope-based permissions, managed roles, and custom authorization for AgentOS endpoints.
With authorization=True, AgentOS validates JWTs on protected requests and checks their scopes against endpoint requirements. This controls who can access and run your agents, teams, and workflows. Discovery, self-authenticating webhooks, and MCP OAuth have surface-specific policies.
Pass an Authorization object as AgentOS(authorization=...) to configure verification keys, managed roles, or a custom decision provider. Per-user isolation is configured separately with AgentOS(user_isolation=True). These are open-source runtime features. Custom roles in the hosted control plane have separate plan requirements.
Enable authorization when initializing AgentOS:
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS
agent = Agent(
id="my-agent",
model=OpenAIResponses(id="gpt-5.2"),
)
agent_os = AgentOS(
id="my-agent-os",
agents=[agent],
authorization=True,
)
app = agent_os.get_app()Key Concepts
| Concept | Description |
|---|---|
| Tokens | JWTs signed by the control plane or your own backend, sent as Authorization: Bearer <token> |
| Scopes | Permission strings in the JWT scopes claim or managed-role policy, like agents:read or agents:my-agent:run |
| Roles | Named bundles of scopes managed in your runtime database or in the hosted control plane; the two stores are configured separately |
| User directory | User profiles and an account-disable flag managed by AgentOS(user_directory=...); authentication remains with your application or identity provider |
| Providers | Decision strategies for scope-based, role-based, relationship-based, or application-specific access rules |
| Isolation | Opt-in per-user scoping for built-in user-owned data and resources with user_isolation=True |
| Service accounts | Opaque agno_pat_ tokens for machine callers, with scopes stored in your database |
Team Access vs End-User Access
AgentOS has two separate role systems, one for your team and one for your application's end users. Both can be managed from os.agno.com, but they are stored and configured separately.
| Your team | Your end users | |
|---|---|---|
| Who | Members of your Agno organization who use os.agno.com | People using your application |
| Tokens | Minted by os.agno.com | Minted by your backend or identity provider |
| Roles stored in | The AgentOS control plane | Your AgentOS database |
| Managed in | os.agno.com → Settings | Code, the /authz and /users APIs, or os.agno.com → Manage OS |
| Guide | Organization Roles | AgentOS Roles, User Management |
Learn How To
Quickstart
Enable authorization, set a verification key, and make your first authenticated request.
JSON Web Tokens (JWT)
JWT claim structure, example tokens, and how AgentOS reads them.
Self-Hosted (BYO Token)
Run AgentOS without the control plane by issuing and verifying your own JWTs.
Scopes
Scope format and the full permission reference for every AgentOS endpoint.
Organization Roles
Default and custom roles for your team in the control plane.
AgentOS Roles
Define roles in your AgentOS database, typically for end users, or resolve them from identity-provider JWTs.
User Management
Maintain user profiles, provision from JWT claims, disable accounts, and use the admin API.
Custom Authorization
Integrate your own policy provider or replace the managed-role backend.
Per-User Data Isolation
Scope user-owned AgentOS data and resources to the caller's user ID.
Service Accounts
Mint, scope, and revoke opaque machine tokens.
Examples
Basic Authorization (Symmetric)
Enable authorization with a shared-secret JWT (HS256).
Basic Authorization (Asymmetric)
Sign with a private key, verify with the public key (RS256).
Per-Agent Permissions
Grant specific permissions to specific agents.
Per-User Data Isolation
Scope user-owned data and resources throughout AgentOS with user_isolation=True.