This article outlines how to configure policies for controlling and monitoring AI traffic. The AI Gateway evaluates policies in a specific sequence, processing sections in the following order.
- Access Control
- DLP
- AI Security Guardrails
Evaluation Logic:
- Top-Down: Within each section, policies are processed sequentially from top to bottom.
- First-Match Enforcement: If traffic matches a policy with a terminating action (e.g., Block or Replace), evaluation stops immediately, and the action is applied.
If no policy matches the criteria, the AI Gateway defaults to an Allow action.
Custom Metadata
Before you configure any policies, you can create custom metadata by clicking on Manage Custom Metadata. You can create up to three tags and use them in the AI Agent request headers as x-ns-aig-custom-${tagName}. These can be used as part of policies criteria.


