RBAC Authentication (Recommended)
When RBAC is enabled, include a JWT token with scopes in your requests:JWT Token Structure
Your JWT tokens should include scopes and audience claims:Required Claims
| Claim | Description |
|---|---|
aud | Must match your AgentOS id |
scopes | Array of permission scopes |
Common Scopes
| Scope | Description |
|---|---|
agents:read | List and view agents |
agents:run | Run any agent |
agents:<id>:run | Run a specific agent |
sessions:read | View session data |
sessions:write | Create/update sessions |
agent_os:admin | Full admin access |
Error Responses
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid JWT token |
401 Unauthorized | Invalid audience (wrong AgentOS ID) |
403 Forbidden | Insufficient scopes |
Developer Resources
AgentOS Security
Enable RBAC and configure authorization.
RBAC
Complete scope reference and endpoint mappings.
JWT Middleware
JWT configuration and parameter injection.
Security Key Authentication (Deprecated)
Legacy authentication using theOS_SECURITY_KEY environment variable: