Guardian SDK settings and supported frameworks
The Collibra SDK is the Python package that attaches Guardian to an AI agent. This topic describes the SDK's settings, where it looks for the enforcement bundle, and the agent frameworks that it supports.
Where the SDK reads its settings
The SDK reads its settings from two places:
- The
collibra-guardian.tomlfile in the working directory of your program. The SDK doesn't search parent folders. - Environment variables named
COLLIBRA_GUARDIAN_<SETTING>, for exampleCOLLIBRA_GUARDIAN_ENFORCEMENT_MODE. They override the file. An empty variable counts as not set.
If you start your program with the CLI's run command, the SDK reads the settings in the same way. The CLI itself doesn't read them, and it doesn't pass any Collibra credentials to your program. The SDK warns about, and skips, any setting that it doesn't recognize.
Settings
| Setting | Default | Description |
|---|---|---|
enforcement_mode
|
enforce
|
enforce applies Guardian's verdicts. monitor records every decision but doesn't apply Block, Escalate, or Rewrite. For details, go to Enforce and monitor modes. |
policy_bundle
|
bundle.zip in the working directory |
The path to the enforcement bundle. For details, go to Where the SDK finds the enforcement bundle. |
framework_version_policy
|
strict
|
strict stops the program before any of your agent's code runs when a framework version is outside the tested range. permissive only logs a warning. For the tested ranges, go to Supported frameworks. |
Where the SDK finds the enforcement bundle
The SDK looks for the enforcement bundle in the following places:
- The path in the
policy_bundlesetting. If that file doesn't exist, the program stops with a configuration error. - If the setting isn't set, the
bundle.zipfile in the working directory. This is the default file that the CLI's sync command writes, so run both commands from the same folder.
If the SDK finds no bundle, it isn't an error. Guardian allows every action, so nothing governs the agent. If logging is set up in your program, Guardian logs the warning guardian.no_policy_bundle. Otherwise, the program gives no sign that nothing is governed, so check that the bundle exists before you start.
Supported frameworks
Guardian supports the following versions of the AI agent frameworks, on Python 3.12 or newer. Install the SDK with the extras for the framework that your program uses. If a framework version is outside these ranges, a program doesn't start with the default strict policy.
| Framework | Tested versions | SDK extra |
|---|---|---|
| LangChain | 1.4 up to, but not including, 2.0 | guardian-langchain, which also covers LangGraph
|
| LangGraph | 1.1 up to, but not including, 2.0 | guardian-langgraph, only for a LangGraph agent without LangChain
|
| Deep Agents | 0.7 up to, but not including, 0.8 | guardian-deepagents
|
When you start a program with the CLI's run command, Guardian covers every agent that the program creates with LangChain's create_agent function, and the graphs that it compiles. It doesn't cover a LangGraph graph that you build by hand. For those, you need to add Guardian's model node and tool node wrappers to your code instead.
SDK extras
The setup skill installs the SDK for you. To install it yourself, use the wheel files from your Collibra Account Team, and install them together from the folder that holds them. For example:
pip install --find-links . "collibra-sdk[guardian-auto,guardian-langchain]==<version>"
Replace <version> with the version of the package that you received. The version changes with every build.
Choose the extras that match your agent:
| Extra | Add it when |
|---|---|
guardian-langchain
|
Your agent is built with LangChain. It also covers LangGraph. |
guardian-langgraph
|
Your agent is built with LangGraph alone, without LangChain. |
guardian-deepagents
|
Your agent is built with Deep Agents. |
guardian-auto
|
You want Guardian to attach to your agent automatically, without changing its code. It also installs guardian-injection. |
mlflow
|
Your agent runs outside Databricks and you want Guardian's decisions recorded on MLflow traces. Databricks already includes MLflow, so on Databricks add import collibra_sdk.guardian.mlflow to your code instead. |