Import
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
verification_keys | Optional[List[str]] | None | List of keys used to verify JWT signatures. For asymmetric algorithms (e.g. RS256), use public keys. For symmetric algorithms (e.g. HS256), use shared secrets. Each key is tried in order until one succeeds - useful for accepting tokens from multiple issuers. |
jwks_file | Optional[str] | None | Path to a static JWKS (JSON Web Key Set) file containing public keys. Keys are matched by kid (key ID) from the JWT header. Alternative to verification_keys for RSA key management. |
algorithm | Optional[str] | RS256 | JWT algorithm for token verification. Common options: RS256 (asymmetric), HS256 (symmetric). |
verify_audience | Optional[bool] | False | Whether to verify the audience claim of the JWT token. This should not be enabled for AgentOS Control Plane traffic. |
Usage
Algorithm Options
| Algorithm | Type | Key Format |
|---|---|---|
RS256 | Asymmetric (RSA) | Public key (PEM format) |
RS384 | Asymmetric (RSA) | Public key (PEM format) |
RS512 | Asymmetric (RSA) | Public key (PEM format) |
HS256 | Symmetric (HMAC) | Shared secret string |
HS384 | Symmetric (HMAC) | Shared secret string |
HS512 | Symmetric (HMAC) | Shared secret string |
ES256 | Asymmetric (ECDSA) | Public key (PEM format) |
ES384 | Asymmetric (ECDSA) | Public key (PEM format) |
ES512 | Asymmetric (ECDSA) | Public key (PEM format) |
Examples
Using RS256 (Asymmetric)
Using HS256 (Symmetric)
Using JWKS File
See Also
- Security Overview - AgentOS security overview
- RBAC Documentation - Complete RBAC scopes and permissions
- JWT Middleware - Advanced JWT configuration
- JWTMiddleware Reference - Middleware class reference