Skip to main content
Use verified JWT claims to choose an Agent’s tools per request, keep client input out of authorization decisions, and map FactoryPermissionError to 403.
with_jwt_rbac.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as with_jwt_rbac.py, then run:
Full source: cookbook/05_agent_os/21_factories/03_with_jwt_rbac.py