Your LiteLLM proxy can ask Data & More to check each chat before the model sees it. You already run the proxy. This article is the part you do in Data & More.
You need the Manage DLP permission. The proxy must be able to reach the guardrail address on the setup card, over HTTPS.
1. Open the AI gateway source
In the workspace, open DLP in the sidebar. That opens DLP Policies.
If DLP enabled at the top of the page is off, turn it on and choose Save workspace.
In the source list, select AI gateway (LiteLLM).
Choose Source setup. The dialog title is AI gateway (LiteLLM) setup.
2. Create the guardrail key
The key is how the proxy proves which workspace a chat belongs to. There is one key per workspace.
Choose Generate key.
Copy the key in the dialog that follows. It starts with
dgmg_.Store it where you keep the proxy's other secrets.
Data & More stores only a fingerprint of the key and cannot show it again. If you close the dialog without copying it, rotate the key and copy the new one.
Rotate key stops the current key at once. Chats are refused until the proxy has the new key. Revoke does the same until you create a new key, or until you remove Data & More from the proxy config.
The setup card also holds the config to copy, the reply check, and the call counts.
3. Give the key to the proxy
On the proxy, set an environment variable named DGM_GUARDRAIL_KEY to the key you copied. Do not paste the key into config.yaml. Restart the proxy after you change the variable.
4. Paste the config
On the same setup card, under Add DGM to your LiteLLM config, choose Copy.
Paste that block into the proxy config file. The file is usually config.yaml. Some installs name it config.yml. Both are the same file.
guardrails: starts at the left edge, with no spaces in front of it. It sits on the same level as model_list: and litellm_settings:. Leave your models and your other settings where they are. The new section can go above or below them.
model_list:
- model_name: your-model
litellm_params:
model: openai/your-model
api_key: os.environ/OPENAI_API_KEY
litellm_settings:
# your existing settings stay here
guardrails:
- guardrail_name: dgm-dlp
litellm_params:
guardrail: generic_guardrail_api
# the rest is the block you copied from the setup card
If the file already has a guardrails: list, add the copied item to that list. A second guardrails: key later in the file replaces the first one.
Keep the block flush left. If you indent it under litellm_settings:, current LiteLLM versions refuse to start.
Use the copy from your setup card. The guardrail URL in api_base is the address of your deployment, and it is not the same on every deployment.
The snippet tells LiteLLM to send every chat to Data & More, with the key read from DGM_GUARDRAIL_KEY. If Data & More cannot be reached, chats continue. A rejected key still stops the chat.
5. Choose whether to check replies
Check model replies is off until you turn it on. Turn it on when you also want the model's answer checked, for example personal data the model pulled from a document or a tool. Then choose Save.
With that switch on, the user sees each answer only once it is complete. There is no typing effect while the model writes. Leave streaming_buffer_until_moderated: true in the snippet you pasted. Without it, part of a reply can appear before Data & More blocks it.
On a reply, a Mask policy blocks instead of hiding the values. A held reply cannot be partly rewritten.
6. Add a policy
The source does not check chats until it has an enabled policy.
With AI gateway (LiteLLM) still selected, choose New policy.
Name it, choose who it applies to, and pick the document classes.
Choose an action.
Log writes an audit entry and lets the chat through. Alert does the same and notifies the user. Block stops the chat. The user sees the class name, such as a national ID, and never the value itself. Mask hides the matched values in the prompt and lets the chat continue. Mask is only available on this source.
Save the policy and leave it enabled. If several policies match, the one higher in the list decides.
7. Confirm it is receiving calls
Send one chat through the proxy. On the setup card, Checks, 24 h should move off zero, and the line next to Guardrail key should change from No calls in 24 h to Receiving calls.
A blocked, masked, or alerted chat appears on the DLP audit log with the source AI gateway (LiteLLM).