AI Custom Guardrail

AI License Required

Block request and response content using Azure Content Safetyv3.14+

Configure the plugin to block request and response content matching the Hate and Violence categories defined by Azure.

In this example, we create a category_names function to parse the category object, and a check_response function to parse the response returned by Azure Content Safety.

Prerequisites

  • You have an Azure subscription and access to Azure AI Content Safety.

  • You have enabled an AI Proxy or AI Proxy Advanced plugin.

Environment variables

  • CONTENT_SAFETY_URL: The full URL of the Azure AI Content Safety instance.

  • CONTENT_SAFETY_KEY: The API key to access the Azure AI Content Safety instance.

Set up the plugin

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!