| Mode | When to use |
|---|---|
| Authorization (Recommended) | Production. JWTs prove identity and scopes control permissions. |
| Basic Authentication | Development. A shared key proves identity. |
Authorization
AgentOS validates JWT tokens and checks scopes against required permissions for each endpoint. Enable it withauthorization=True:
401 Unauthorized; requests with insufficient scopes return 403 Forbidden.
See Authorization for the full setup.
Basic Authentication
Set a shared secret in theOS_SECURITY_KEY environment variable:
Authorization: Bearer <key> header return 401 Unauthorized. This is the simplest path to a protected AgentOS, suitable for local development or single-team prototypes.
For production deployments, use Authorization instead.
Next Steps
Authorization
JWT validation, scopes, roles, and per-user data isolation.
JWT Middleware
Token sources, claim extraction, and parameter injection.