Skip to main content
This example reads authorization decisions from ctx.trusted.claims while JWTMiddleware(validate=False) disables signature verification. A caller can forge the role or tier claim until validation is enabled.
02_tiered_workflow_factory.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Run PgVector

5

Enable JWT signature verification

Change validate=False to validate=True. Replace the hard-coded JWT_SECRET assignment with JWT_SECRET = os.environ["JWT_VERIFICATION_KEY"], add import os, and export a unique 32-byte secret before starting the server.
6

Run the example

Save the code above as 02_tiered_workflow_factory.py, then run:
Full source: cookbook/05_agent_os/factories/workflow/02_tiered_workflow_factory.py