Example: Deploy to Databricks and connect Collibra

This topic is an example of how to deploy an agent that uses the Guardian SDK, and how to connect Collibra to the platform that it runs on. The example uses Databricks Model Serving, so the commands, names, and settings in this topic are specific to Databricks. If you deploy to another platform, use the steps as a pattern and ask your AI tool to adapt them. For what applies to every platform, go to Deploy your agent and connect Collibra.

Deploy the agent

A Databricks agent is deployed with deterministic rules only, so the rules file is small and no model files are needed. This topic doesn't cover Databricks Apps step by step. Apps run Python 3.11 by default, and the Guardian SDK needs Python 3.12 or newer, so an App needs a uv setup that requests Python 3.12. If you deploy as an App, the App also needs the MLflow experiment attached as a resource before it can write Guardian traces. Create the experiment, open the app, select Edit app > Resources > Add resource > Experiment, and attach the experiment before you deploy. It is the same experiment that Collibra needs CAN_READ on. To deploy as an App, contact the Collibra Account Team.

Before you deploy

In the Databricks example, check the following:

  • You have installed the Databricks command line tool. For installation steps, go to the install page in the Databricks documentation for your computer.
  • You are signed in to Databricks: databricks auth login --host [WORKSPACE ADDRESS] --profile [NAME]. A browser window opens. To check, run databricks current-user me --profile [NAME].
  • You have a Unity Catalog catalog and schema for the model. A new workspace may have none. If the command line can't create a catalog, run CREATE CATALOG IF NOT EXISTS [NAME] on a SQL warehouse, or create it in the Databricks interface with default storage.
  • You have the name of a language model endpoint that exists in your workspace. To list the endpoints, run databricks serving-endpoints list --profile [NAME]. The names differ between workspaces.
  • Your workspace has enough serving capacity. A free workspace has only a small serving limit.
  • If your agent queries data, you have a SQL warehouse ID. To list the warehouses, run databricks warehouses list --profile [NAME].

Ask your AI tool to deploy

The skill gives you the deploy steps, but it doesn't deploy the agent for you. Paste the following prompt, entering the relevant information in the brackets. This prompt is set up for our Databricks example, but you can adjust it to fit your platform.

The deployment takes 15 to 30 minutes while Databricks builds the endpoint, so a long wait is normal. Don't cancel the rollout, because Databricks refuses a second update while one is running.

Deploy this agent to Databricks Model Serving, using the Databricks profile [NAME].
Register it in Unity Catalog as [CATALOG.SCHEMA.AGENT_NAME].
Log it with MLflow from the agent's main file and deploy it with the databricks-agents package, with scale to zero on.
Make sure of the following.
(1) The agent is wrapped in MLflow's ResponsesAgent, because Databricks rejects other output formats.
(2) The Collibra wheel files that the skill copied into the vendor folder, and collibra-guardian/bundle.zip, are logged in code_paths, and the pip requirements name the wheels as ./code/[WHEEL NAME] with the extras guardian-langchain, guardian-injection and mlflow on collibra-sdk.
(3) The agent finds bundle.zip from its own file location and looks in two places, beside the file and in a folder called code beside the file, because the endpoint puts the files from code_paths in a folder called code and its working folder is not the code folder.
(4) Every other package is pinned to an exact version from my environment, because the endpoint can fail to resolve version ranges.
(5) The model declares every Databricks resource it uses: the language model endpoint [ENDPOINT], the SQL warehouse [WAREHOUSE ID] if there is one, and each table the agent reads.
(6) The endpoint runs MLflow 3.15 or later, because the Guardian writes its decisions on MLflow traces only from that version, and it has the environment variable ENABLE_MLFLOW_TRACING set to true.
(7) The Guardian lines stay at the top of the main file.
(8) The model is logged from Python 3.12 or newer, because the endpoint uses the Python version the model was logged with and the Guardian SDK needs 3.12 or newer.
(9) The endpoint has the environment variable COLLIBRA_GUARDIAN_ENFORCEMENT_MODE set to [monitor or enforce], because the settings file collibra-guardian.toml is not deployed with the model, and without the variable the endpoint can run in enforce mode and block requests.
(10) An MLflow experiment is active before agents.deploy is called, for example with mlflow.set_experiment, so that the Guardian's traces have somewhere to go.
Do not cancel a rollout that is in progress.
Note A free Databricks workspace has a small limit on serving capacity (provisioned concurrency). If a rollout fails with "Quota Exceeded", delete serving endpoints you no longer need, for example with databricks serving-endpoints delete [ENDPOINT NAME] --profile [NAME], and deploy again. An update to an existing endpoint needs spare capacity while the old and new versions run side by side, so deleting the endpoint first and deploying fresh is the reliable way. Only delete endpoints that you created yourself.

The prompt asks your AI tool to meet the following requirements. Each one prevents a known deployment problem.

Requirement Why it matters
ResponsesAgent Without it, the deploy stops with "output schema must be ChatCompletionResponse or StringResponse".
Wheels and bundle in code_paths The Guardian packages aren't on a public package index, and without the rules file, Guardian allows every action.
Path from the file location A wrong path fails quietly. Guardian starts, logs the warning guardian.no_policy_bundle, and allows every action. On the endpoint the file is in a folder called code beside your agent file.
Exact pins Version ranges can make the install on the endpoint fail.
Declared resources Without them, the first real call fails with a permission error.
Mode and experiment Without the mode variable, the endpoint can run in enforce mode, because the settings file is not deployed. Without an active MLflow experiment, Guardian's traces have nowhere to go.
Python 3.12 or newer The Guardian SDK requires it. Databricks Apps run Python 3.11 by default, so this topic deploys to Model Serving.

Try it

Open the endpoint in your platform and ask it a question. For example, in Databricks, use the endpoint's Review App or its chat. Repeat the allowed and forbidden requests from Run the agent with Guardian. A blocked request returns the text "Blocked by Guardian, prompt not sent" and the name of the rule. In Databricks, the endpoint scales down to zero when idle, so the first question after a pause can take a minute or two.

You can also call the endpoint from a terminal. For example, for the Databricks example:

databricks api post /serving-endpoints/[ENDPOINT NAME]/invocations --profile [NAME] --json '{
  "input": [
    {
      "role": "user",
      "content": "[YOUR QUESTION]"
    }
  ]
}'

If a forbidden request is answered normally, the rules file was not found on the endpoint. Open the endpoint logs in your platform and look for guardian.no_policy_bundle.

Note A new rules file means a new model version, so log and deploy again. A new model version alone doesn't require a new scan.

Connect Collibra to your platform

Collibra reads your agent's Guardian activity from your platform. In our Databricks example, Collibra reads the activity from MLflow in your Databricks workspace, which requires a Databricks Workspace connection. This section creates that connection as an example. You create the connection once per workspace, at any time after you deploy the agent. Without it, Collibra has no Guardian activity to show, even though Guardian blocks actions correctly in your agent.

The steps in this section follow Create a Databricks Workspace connection to an Edge or Collibra Cloud site. Open that topic for screenshots and for the full list of options.

Before you connect

  1. You have an Edge site in your Collibra organization with the status Healthy, or a Collibra Cloud site. If you don't have one, contact the Collibra Account Team before you continue.
  2. The Manage connections and capabilities global permission. If you don't have it, send this section to the person who does.
  3. You have the address of your Databricks workspace. Copy it from your browser while you are in the workspace, up to and including .com, with no path after it. For example: https://dbc-1234abcd-5678.cloud.databricks.com.
  4. You have a Databricks identity for Collibra to sign in with. You prepare it in the next step.

Prepare the Databricks sign-in

Collibra supports three ways to sign in: OAuth, a Personal Access Token, and Microsoft Entra ID. Collibra recommends OAuth with a service principal. For more information, go to Databricks OAuth for service principals. A scoped personal access token is also accepted and is the quicker choice in a personal workspace. For more information, go to Databricks scoped personal access tokens.

What What to grant
Token scopes (personal access token) unity-catalog, mlflow, model-serving, knowledge-assistants, supervisor-agents, and genie. With OAuth, Collibra asks for all-apis. To let Collibra read AI monitoring data, the sql scope is also needed.
Unity Catalog BROWSE on the catalog that holds your agent's model, USE CATALOG on the catalog, USE SCHEMA on the schema, and EXECUTE or READ METADATA on the registered model.
Your agent's serving endpoint CAN_VIEW
Your agent's MLflow experiment CAN_READ. This is the experiment that holds the Guardian traces, so Collibra must be able to open it.
AI agents in Databricks CAN_MANAGE, which Collibra needs to read the agent configuration. CAN_QUERY and CAN_VIEW are not enough.

Permissions on the endpoint and the experiment aren't inherited. Grant them for each object, or make the identity a workspace admin, which covers all of them. Keep the client secret or the token ready for the next step, and don't put it in your code or in a chat.

Create the connection in Collibra

  1. In Collibra, open Settings, then the Edge tab.
  2. Click your site with the status Healthy.
  3. In the Connections section, click Create connection.
  4. Select Databricks Workspace.
  5. Enter the required information. Name: A name that you recognize. Workspace URL: The address from above. Authentication Type: OAuth, Personal Access Token, or Microsoft Entra ID. Then enter the Client ID and Client Secret for OAuth, or the Access Token for a token. Microsoft Entra ID also asks for a Tenant ID. If your site uses a vault, choose it and set the value type to Vault Key.
  6. Click Create. Collibra does not check the credentials when you click Create. It validates them when it first uses the connection, so a typo shows up later.

Check that it works

Send at least one message to your deployed agent, so that it writes a trace. Then ask your AI tool: Using the Collibra MCP server, check Guardian for my agent. The skill reports whether Collibra can read your agent's activity. If it says it cannot, check the Workspace URL, the credentials, and the permissions on the experiment in the table above, and then try again.

Note The Databricks topic continues with adding the Databricks Unity Catalog capability to the connection and synchronizing it. That brings your catalog assets into Collibra. For more information, go to Steps: Integrate Databricks Unity Catalog via Edge for AI.

What's next