Block content in predefined categoriesv3.7+

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

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

Add this section to your declarative configuration file:

_format_version: "3.0"
plugins:
  - name: ai-azure-content-safety
    config:
      content_safety_url: ${{ env "DECK_CONTENT_SAFETY_URL" }}
      content_safety_key: ${{ env "DECK_CONTENT_SAFETY_KEY" }}
      categories:
      - name: Hate
        rejection_level: 2
      - name: Violence
        rejection_level: 2
Copied to clipboard!

Did this doc help?

Something wrong?

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!