This article provides information about integrating an AI Gateway with Cato AI Security to provide you with monitoring and enforcement capabilities for your homegrown agents.
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 agents, and validate policy enforcement in Guard Logging.
Prerequisites
Before you start, make sure these requirements are met:
- AI Security for Applications license
- Admin permissions for AI Security > Guards and AI Security > Guards Interaction Policy
- Deployed and working LiteLLM AI Gateway
- Access to edit the LiteLLM
config.yamlfile - Permission 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.
.png?sv=2026-02-06&spr=https&st=2026-08-10T03%3A51%3A29Z&se=2026-08-10T04%3A06%3A29Z&sr=c&sp=r&sig=8crcXuKWoPKPgOviINSX2iwfSc3LzmcDDB96Wjp8epM%3D)
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 Test - In Type, select AI Gateway
- In AI Gateway Integration Type, select LiteLLM
- In Guard's Host, select Cato's Cloud
- You can map the homegrown agents using Homegrown Agent Mapping. This creates the connection between the specific virtual key in LiteLLM and a homegrown agent in the CMA. You can also leave the guard without any mapping at this stage and include the mapping after you've verified that AI Gateway traffic is sent to the Guard.
- 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.
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: true
The key fields are:
| Field | Description |
|---|---|
mode: [pre_call, post_call] |
Sends prompts to Cato before the LLM request and responses to Cato after the LLM response |
api_key |
Authenticates LiteLLM to the Cato Guard |
default_on: true |
Enables the Guard by default for the traffic covered by this LiteLLM configuration |
We recommend that you store the API key securely and avoid committing it to source control. If your deployment supports environment variables or a secret manager, use that method instead of storing the key directly in config.yaml.
Update the LiteLLM Configuration
Configure the Cato guardrail in your LiteLLM tenant using the LiteLLM documentation. Guardrail is the LiteLLM terminology for implementing guards.
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: true
Verify Gateway Traffic in Cato
Use the Interaction Explorer to confirm that LiteLLM traffic reaches Cato.
.png?sv=2026-02-06&spr=https&st=2026-08-10T03%3A51%3A29Z&se=2026-08-10T04%3A06%3A29Z&sr=c&sp=r&sig=8crcXuKWoPKPgOviINSX2iwfSc3LzmcDDB96Wjp8epM%3D)
To verify gateway traffic in Cato:
- Generate a session by sending a test prompt from an app behind the LiteLLM gateway.
- From the navigation menu, select AI Security > Interaction Explorer
- From the Guard dropdown, filter the selection by your Guard.
- Confirm that the session you generated in Step 1 appears in the table.
At this point, the Homegrown Agent column shows a dash (-) for each entry. This is expected because in our example, no homegrown agents have been mapped to the Guard yet.
In this stage, Cato logs gateway traffic. After agent mapping, Cato also attributes traffic to the specific homegrown agent.
If you don't see any traffic after approximately one minute, troubleshoot the connection in LiteLLM.
Map a Homegrown Agent to the Guard
Map a homegrown agent so Cato Networks can attribute AI Gateway traffic to the correct agent.
In LiteLLM, create a Virtual Key for each agent that you want Cato to identify separately.
- In LiteLLM, navigate to Virtual Keys
- Copy the Key Alias (might also be called Key Name) for each homegrown agent you want to add to your Guard
In the CMA, map the agent using the LiteLLM Key Alias. To map a homegrown agent 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 agent from the list, or create a new agent
- In Virtual Key Alias, enter the LiteLLM Key Alias for the agent
- Click Save
Verify Agent Attribution
Verify that Cato attributes gateway traffic to the mapped homegrown agent.
To verify agent attribution:
- Generate traffic using a test request from the mapped homegrown agent through LiteLLM
- From the navigation menu, select AI Security > Interaction Explorer
- Filter the view by the mapped Homegrown Agent
- Confirm that the Homegrown Agent column shows the mapped agent
When the agent is mapped correctly, Interaction Explorer shows the app name instead of a dash (-).
Troubleshooting Gateway Traffic in LiteLLM
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.