Skip to main content
Turn on AuthorizationConfig(user_isolation=True) so every knowledge content row is owned by the JWT subject, and a row with no owner is shared, org-wide content. The smoke proves the read scope, the 403 on shared content, the 404 on another user’s content, and the admin bypass. Rows are seeded straight into the contents db because the ingest run by POST /knowledge/content has no vector db.
user_isolation_knowledge.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 user_isolation_knowledge.py, then run:
Full source: cookbook/05_agent_os/07_security/user_isolation_knowledge.py