Overview
Cato AI Security lets you inspect and enforce policy for AI traffic that flows through your existing LiteLLM AI Gateway. Instead of configuring each application separately, you connect the gateway to a Cato Guard and apply centralized monitoring, data protection, and policy enforcement to gateway traffic.
This article explains how to configure a LiteLLM AI Gateway integration, map homegrown apps, and validate policy enforcement in Guard Logging.
Prerequisites
Before you start, make sure these requirements are met:
AI Security license that supports AI Gateway Guards
Admin permissions for AI Security > Guards and AI Security > Guards Interaction Policy
Deployed and working LiteLLM AI Gateway
Access to edit the LiteLLM
config.yamlfilePermission to restart or reload the LiteLLM AI Gateway
LiteLLM Virtual Key and Key Alias for each homegrown app you want to map
Test app or client that sends traffic through the LiteLLM AI Gateway
Network access from LiteLLM to
https://api.aisec.catonetworks.com
Configuration Workflow
The integration includes these stages:
Stage | Task | Result |
|---|---|---|
1 | Create an AI Gateway Guard | Cato creates the Guard and provides connection details for LiteLLM |
2 | Configure LiteLLM | LiteLLM sends AI traffic to Cato for inspection |
3 | Map a homegrown app | Cato attributes gateway traffic to a specific homegrown app |
4 | Configure policy enforcement | Cato applies AI Security policy rules to matching traffic |
Create the AI Gateway Guard
Create an AI Gateway Guard to define the Cato enforcement point for LiteLLM traffic.

To create the Guard:
From the navigation menu, select AI Security > Guards
Click New
In Guard Name, enter a name for the Guard
Example:
LiteLLM TestIn Type, select AI Gateway
In AI Gateway Integration Type, select LiteLLM
In Guard's Host, select Cato's Cloud
Leave Homegrown Agent Mapping empty
Click Save
After you save the Guard, it is ready to receive traffic from the LiteLLM AI Gateway. The Guard is active, but it does not enforce rules until you configure a policy rule.
Map homegrown apps after validating the gateway integration.
Configure LiteLLM
Configure LiteLLM with the Guard connection details so the AI Gateway can send traffic to Cato for inspection.
Retrieve the Guard Connection Details
To retrieve the Guard connection details:
From the navigation menu, select AI Security > Guards
Select the AI Gateway Guard
Copy the connection details from the Guard configuration
The Guard connection details include:
API keys
LiteLLM guardrails configuration snippet
Cato API base URL
The LiteLLM guardrails configuration uses this structure:
guardrails:
- guardrail_name: cato_networks
litellm_params:
guardrail: cato_networks
mode: [pre_call, post_call]
api_key: <AI_GATEWAY_API_KEY>
api_base: "https://api.aisec.catonetworks.com"
default_on: trueThe key fields are:
Field | Description |
|---|---|
| Sends prompts to Cato before the LLM request and responses to Cato after the LLM response |
| Authenticates LiteLLM to the Cato Guard |
| Enables the Guard by default for the traffic covered by this LiteLLM configuration |
Store the API key securely and avoid committing it to source control. If your deployment supports environment variables or a secrets manager, use that method instead of storing the key directly in config.yaml.
Update the LiteLLM Configuration
You can configure the Cato guardrail globally for all LiteLLM traffic or apply it to specific model definitions, depending on your LiteLLM deployment. The example below applies the guardrail to the travel-bot-model.
To update the LiteLLM configuration:
Open the LiteLLM
config.yamlfileAdd the Cato guardrails configuration to the relevant model definition
Replace the placeholder API key with the API key from the Guard
Save the file
Restart or reload the AI Gateway if required for your LiteLLM deployment
Example LiteLLM configuration:
model_list:
- model_name: travel-bot-model
litellm_params:
model: openai/openai.gpt-oss-120b
api_base: "https://bedrock-mantle.eu-north-1.api.aws/v1"
api_key: "[LLM_API_KEY]"
ssl_verify: false
guardrails:
- guardrail_name: travel-bot-model
litellm_params:
guardrail: cato_networks
mode: [pre_call, post_call]
api_key: "cato-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
api_base: "https://api.aisec.catonetworks.com"
default_on: trueVerify Gateway Traffic in Cato (Optional)
Use Guard Logging to confirm that LiteLLM traffic reaches Cato.

To verify gateway traffic in Cato:
Generate a test prompt from your app.
From the navigation menu, select AI Security > Interaction Explorer
From the Guard dropdown, filter the selection by your Guard.
Confirm that the log entry shows the Guard name
At this point, the Homegrown Agent column shows a dash (-) for each entry. This is expected because no homegrown apps are mapped to the Guard yet.
In this stage, Cato logs gateway traffic. After app mapping, Cato also attributes traffic to the specific homegrown app.
Verify Gateway Traffic in LiteLLM (Optional)
Use LiteLLM logs to confirm that requests are processed end-to-end by the AI Gateway and the Cato Guard.
To verify the integration in LiteLLM:
Send a test request through the LiteLLM AI Gateway
Open the LiteLLM logs
Confirm that the request includes the expected model and provider routing
Confirm that the request completed successfully
The logs can include:
Model and provider routing
Token counts
Request duration
Success status
Use both Cato Guard Logging and LiteLLM logs to confirm that requests are processed end-to-end.
Map a Homegrown App to the Guard
Map a homegrown app so Cato Networks can attribute AI Gateway traffic to the correct app.
In LiteLLM, create a Virtual Key for each application that you want Cato to identify separately.
In LiteLLM, navigate to Virtual Keys
Copy the Key Alias for each homegrown app you want to add to your Guard
In Cato, map the app using the LiteLLM Key Alias. You can map a homegrown app from the Guard configuration or from the homegrown app configuration. This procedure uses the Guard configuration.
To map a homegrown app to the Guard:
From the navigation menu, select AI Security > Guards
Select the AI Gateway Guard
In Homegrown Agent Mapping, click Add Mapping
In Homegrown Agent, select the homegrown app
Example:
TravelBotIn Virtual Key Alias, enter the LiteLLM Key Alias for the app
Click Save
Verify App Attribution
Verify that Cato attributes gateway traffic to the mapped homegrown app.
To verify app attribution:
Send a test request from the mapped homegrown app through LiteLLM
From the navigation menu, select AI Security > Interaction Explorer
Filter the view by the mapped Homegrown Agent
Example:
TravelBotConfirm that the Homegrown Agent column shows the mapped app
When the app is mapped correctly, Guard Logging shows the app name instead of a dash (-).
Configure a Guards Interaction Policy Rule
Configure a Guards Interaction Policy rule to enforce AI Security controls on matching LiteLLM traffic.
Before you create a rule, understand how scope affects enforcement:
Scope | Enforcement behavior |
|---|---|
Guard only | Applies to all traffic through the selected AI Gateway Guard |
Specific Homegrown Agents | Applies only to traffic from the selected homegrown apps |
To configure a Guards Interaction Policy rule:
From the navigation menu, select AI Security > Guards Interaction Policy
Click New
In Name, enter a name for the rule
Example:
Block PIIUse the Enabled toggle to enable the rule
The toggle is green when enabled.
In Guards, select the AI Gateway Guard
Example:
LiteLLM TestIn Agents, select the mapped homegrown app
Example:
TravelBotIn Engine Profile, select the profile used to detect the relevant content
Example: Personal Identifier
In Action, select the enforcement action
Example: Anonymize & Monitor
Click Save
Click Publish
After the policy is published and propagated, the rule is enforced on matching traffic.
Verify Policy Enforcement
Verify policy enforcement by sending test traffic that matches the rule scope and engine profile.
To verify policy enforcement:
Send a test request from the mapped homegrown app through LiteLLM
Include content that matches the selected Engine Profile
From the navigation menu, select AI Security > Guards
Select the AI Gateway Guard
Open Guard Logging
Filter the logs by the mapped Homegrown Agent
Confirm that Violated Rules shows the policy rule
Example:
Block PII
Traffic that does not match the selected Engine Profile shows no violated rules and passes through normally.