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.

JWT verification flow

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

ConceptDescription
TokensJWTs signed by the control plane or your own backend, sent as Authorization: Bearer <token>
ScopesPermission strings in the JWT scopes claim or managed-role policy, like agents:read or agents:my-agent:run
RolesNamed bundles of scopes managed in your runtime database or in the hosted control plane; the two stores are configured separately
User directoryUser profiles and an account-disable flag managed by AgentOS(user_directory=...); authentication remains with your application or identity provider
ProvidersDecision strategies for scope-based, role-based, relationship-based, or application-specific access rules
IsolationOpt-in per-user scoping for built-in user-owned data and resources with user_isolation=True
Service accountsOpaque 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 teamYour end users
WhoMembers of your Agno organization who use os.agno.comPeople using your application
TokensMinted by os.agno.comMinted by your backend or identity provider
Roles stored inThe AgentOS control planeYour AgentOS database
Managed inos.agno.com → SettingsCode, the /authz and /users APIs, or os.agno.com → Manage OS
GuideOrganization RolesAgentOS Roles, User Management

Learn How To

Examples

Developer Resources