Skip to main content
cors_allowed_origins replaces AgentOS’s default allowed origins. AgnoAPISettings(os_security_key=...) protects the REST surface with a Bearer token. The client verifies an unauthenticated rejection, an authenticated discovery request, and an allowed CORS preflight.
cors_and_security_key.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 cors_and_security_key.py, then run:
Full source: cookbook/05_agent_os/06_customize/cors_and_security_key.py