Download the latest enforcement bundle
Use the collibra ai-gov guardian sync command to synchronize the enforcement bundle on your computer with the latest version that Guardian compiled for an AI agent. The enforcement bundle contains the compiled rules, built from the AI agent's Agent Contracts, that Guardian enforces at runtime.
The command only downloads the bundle when needed. If the bundle on your computer is already the latest, nothing is downloaded. Because bundles can be large, this makes it safe to run the command often. For example, you can run it every time before you start an AI agent, and periodically while the agent runs, so that the agent always uses the latest rules.
You only give the command the ID of the AI agent. Guardian works out which version of the AI agent is active, so you don't need to know the version ID.
Prerequisites
- You have installed and set up the CLI, and you're signed in or have set the environment variables for your authentication method.
- Guardian has compiled an enforcement bundle for the AI agent. If it hasn't, the command returns an error. To compile the latest rules, click Apply changes on the Contract tab of the AI Agent asset page.
- Your credentials give access to the Collibra environment. The command uses the same credentials as other CLI commands, and returns an access denied error if your token doesn't cover the environment. The command authenticates with OAuth 2.0 and needs the
aigovernance.guardian.enforcement-readscope. - You know the UUID of the AI agent, which is the ID of the AI Agent asset. Guardian returns an error for an ID that it doesn't recognize.
Syntax
collibra ai-gov guardian sync --agent-id <UUID> [--output <PATH>]
| Flag | Required | Default | Description |
|---|---|---|---|
--agent-id
|
Yes | None | The UUID of the AI agent to download the enforcement bundle for. |
--output
|
No | bundle.zip
|
The path to write the downloaded bundle ZIP file to. |
Note The command also writes a small file, bundle.manifest.yaml, in the same folder as the ZIP file. The command uses it to tell whether your bundle is up to date, so don't edit it.
Steps
- Open your terminal or command prompt.
- Run the following command, and replace the placeholder with your AI agent's UUID:
collibra ai-gov guardian sync --agent-id <UUID>
To save the bundle somewhere other than the current folder, add the--outputflag, for example--output ./bundles/agent.zip.
Results
The result depends on whether the bundle on your computer is up to date.
- The bundle is already up to date. The CLI doesn't download anything, and shows
Enforcement bundle is already up to date (version 3)., with your version number. - The bundle is downloaded. The CLI downloads the new bundle, checks that the download is intact, and writes the ZIP file and the manifest file. It shows the version and size, followed by the paths of both files:
Downloading enforcement bundle version 3 (1048576 bytes)...Enforcement bundle downloaded and verified.
The CLI downloads a new bundle when the ZIP file or the manifest file is missing, when they belong to a different AI agent, or when a newer bundle is available.
Note The default output file, bundle.zip, is the file that the SDK looks for by default in its working directory. To use the bundle with the run command, run both commands from the same folder, or set the policy_bundle SDK setting. The sync command doesn't start your program, and the run command doesn't download a bundle.
For the errors that the command can return, go to Guardian CLI error codes.
- Run a Python program with Guardian attached.
- Learn how to enable Guardian for an agent.
- Go to Guardian CLI error codes if the command returns an error.