Skip to main content
AgentOS supports two security mechanisms:

Basic Authentication

Set the OS_SECURITY_KEY environment variable in your .env file or export it directly in your terminal:
Requests without a valid Authorization: Bearer <key> header return 401 Unauthorized.

Role-Based Access Control (RBAC)

RBAC validates JWT tokens and checks scopes against required permissions for each endpoint. Enable it with authorization=True:
Set the JWT_VERIFICATION_KEY environment variable to your public key in your .env file or export it directly in your terminal:
Requests without a valid JWT return 401 Unauthorized. Requests with insufficient scopes return 403 Forbidden. See the RBAC documentation for the full setup flow, scope reference, and endpoint mappings.

RBAC Documentation

Complete scopes, permissions, and access control configuration.

JWT Middleware

JWT authentication with parameter injection and claims extraction.