authorization_quickstart.py:
authorization_quickstart.py
authorization=True enables JWT verification. AgentOS also needs a public key to verify tokens against. Generate one from the control plane and wire it in.
Generate a Verification Key from the Control Plane
1
Toggle JWT authorization
Enable JWT authorization when connecting a new AgentOS, or later from the OS Settings page.
2
Copy the public key
Copy the public key for your AgentOS from the modal.
3
Set the verification key
Set the Or, if you manage keys via a JWKS file, point AgentOS at it instead:
JWT_VERIFICATION_KEY environment variable to your public key in your .env file or export it directly in your terminal:4
Install dependencies
5
Start AgentOS
The control plane only issues RS256 keys, which is also the default. See authorization troubleshooting for common setup issues.
Sending Authenticated Requests
Authenticated requests carry a verified caller identity and scopes. AgentOS uses the scopes to enforce per-endpoint permissions. Per-user data scoping is opt-in. Enableuser_isolation=True as described in Per-User Data Isolation.
Send the JWT in the Authorization: Bearer <token> header:
- Control plane: minted by
os.agno.comand copied from the OS Settings page. - Self-hosted: minted by your backend or a third-party IDP. See Self-Hosted for setup.
401 Unauthorized. Requests whose JWT lacks the scopes the endpoint requires return 403 Forbidden.
Configurable Options
Configure JWT verification usingAuthorizationConfig:
Environment Variables
Env vars work alongside
AuthorizationConfig. Pass keys in code, env vars, or both.
Excluded Routes
These routes are excluded from authorization checks by default:/, /health, /info, /docs, /redoc, /openapi.json, /docs/oauth2-redirect