How to use blocklists with Azure AI model inference service in Azure AI services

The configurable content filters are sufficient for most content moderation needs. However, you may need to filter terms specific to your use case.

Prerequisites

Create a blocklist

  1. Go to Azure AI Foundry and navigate to your project/hub. Then select the Safety+ Security page on the left nav and select the Blocklists tab.

    Screenshot of the Blocklists page tab.

  2. Select Create a blocklist. Enter a name for your blocklist, add a description, and select an Azure OpenAI resource to connect it to. Then select Create Blocklist.

  3. Select your new blocklist once it's created. On the blocklist's page, select Add new term.

  4. Enter the term that should be filtered and select Add term. You can also use a regex. You can delete each term in your blocklist.

Attach a blocklist to a content filter configuration

  1. Once the blocklist is ready, go back to the Safety+ Security page and select the Content filters tab. Create a new content filter configuration. This opens a wizard with several AI content safety components.

    Screenshot of the Create content filter button.

  2. On the Input filter and Output filter screens, toggle the Blocklist button on. You can then select a blocklist from the list. There are two types of blocklists: the custom blocklists you created, and prebuilt blocklists that Microsoft provides—in this case a Profanity blocklist (English).

  3. You can now decide which of the available blocklists you want to include in your content filtering configuration. The last step is to review and finish the content filtering configuration by selecting Next. You can always go back and edit your configuration. Once it’s ready, select a Create content filter. The new configuration that includes your blocklists can now be applied to a deployment.

Next steps