Authorization

JWT validation and scope-based permissions 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.

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 scopes claim, like agents:read or agents:my-agent:run
RolesNamed bundles of scopes assigned to users (Owner, Administrator, Member, or custom)
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

Learn How To

Examples

Developer Resources