Set up the SDK in your agent
Two Collibra skills guide you from your agent's code to a working Guardian Agent. They are part of the Collibra MCP connection, so you don't install anything extra. The first skill sets up Guardian for your agent, and it hands over to the second skill when it is time to write the contract.
Start the skill
Start your AI tool in your agent's project folder and paste the following prompt:
Using the Collibra MCP server, set up Guardian for the agent in this folder.
The skill takes about 15 minutes, most of which is Collibra processing. Some steps, such as applying the rules, are slow, so a pause with no new output is normal. The skill asks before every change, shows you what it changes, and waits for your approval. It never runs or deploys your agent. Its steps, in order, are:
| Step | What happens | What you do |
|---|---|---|
| Start | It checks your Collibra connection, your folder, and which contracts exist. It asks how much explanation you want. | Choose an explanation level. Confirm how your agent runs, as the skill detected it, for example on a Model Serving endpoint. |
| 1. Prepare the agent | It installs the Guardian SDK in your project and wires it in. It adds two lines at the very top of your main agent file, a settings file called collibra-guardian.toml, and a vendor folder with the SDK files. It checks the Python version. |
Give the path of the folder with the Guardian SDK files that you got from your Collibra Account Team. It contains four .whl files and a file called INSTALL.md. Choose monitor (records only) or enforce (blocks actions). The SDK default is enforce, and monitor is a safe start. Answer yes to the changes. |
| 2. Add the agent to Collibra | It scans your agent to describe it, and shows you a preview of what it sends to Collibra. | If asked, provide details about where your agent runs, for example your Databricks workspace ID. Answer yes to send the description. |
| 3. Contracts | It hands over to the contract skill. For more information, go to Create your contract. | Create or choose your contract. |
| 4. AI use case (optional) | It can link your agent to an AI use case. Collibra can reject the link if the AI use case requires a value that you can't provide. If that happens, skip this optional step and continue. | Choose or skip. |
| 5. Apply the rules | It asks Collibra to compile your rules into a rules file, and reports which rules Guardian can enforce. | Answer yes. This takes a few minutes. |
| 6. Save the rules file | It downloads the rules file, checks it, saves it in your project, and adds the setting that points to it. It gives you the deploy steps. | Answer yes. Run the deploy steps yourself, as described in Deploy your agent and connect Collibra. |
| 7. Activity | It checks that Collibra can read your agent's activity. If it cannot, it writes a message for your Collibra admin. | Send the message if needed. For more information, go to Connect Collibra to your platform. |
| 8. Summary | It lists what is in place and what is missing, with links. | Read it. |
Run the agent with Guardian
After step 6 of the skill, your project holds the rules file and the setting that points to it. Run the agent.
Check the files
collibra-guardian/bundle.zipis the rules file. It holds your rules in readable form, so treat it like any other sensitive configuration file and keep it out of public repositories.collibra-guardian.tomlnames the rules file in thepolicy_bundleline and setsenforcement_modetomonitororenforce.- The first lines of your main agent file start Guardian. Keep them first. If your agent imports LangChain before them, Guardian does nothing and shows no error.
Test the rules
- Ask the agent something its contract allows. It answers normally, and the log shows nothing, because allowed actions are only logged at DEBUG level.
- Ask it something the contract forbids. In enforce mode, Guardian steps in. For a blocked message, you see a reply like "Blocked by Guardian, prompt not sent: denied by guard ..." with the rule's name.
In monitor mode, nothing is blocked, and Collibra shows what Guardian would have stopped. To change the mode, edit enforcement_mode in collibra-guardian.toml, or set the environment variable COLLIBRA_GUARDIAN_ENFORCEMENT_MODE to monitor or enforce.
Troubleshooting
If Guardian doesn't behave as you expect, check the following problems and solutions.
| Problem | Cause | Solution |
|---|---|---|
The log shows the guardian.no_policy_bundle warning. |
Guardian didn't find the rules file, so it allows every action. | Check the path in collibra-guardian.toml. |
A BundleError about spec.yaml appears. |
The rules file isn't the file that Collibra created, or it was repacked. | Download the rules file again with the skill. |
| A forbidden request isn't blocked. | The mode isn't enforce, the Guardian lines aren't at the top of your main file, or the rule isn't marked Enforceable. | Check that the mode is enforce, that the Guardian lines are at the top of your main file, and that the rule is marked Enforceable. |
- Deploy your agent and connect Collibra
- Update the rules later: Download the latest enforcement bundle.