Custom content filters and blocklists for GPT 4o in Azure OpenAI

Mayank Sharma 5 Reputation points
2024-06-15T03:39:54.1933333+00:00

I have GPT 4o deployed in North Central US region in my Azure OpenAI resource. I have created a custom content filter with custom blocklists (using instructions from https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/use-blocklists) via the Azure OpenAI Studio. I am able to see content filtering work when using GPT 35 Turbo. But it is not working with GPT4o.

Can you please confirm if there are any limitations in using custom content filters/blocklists with different GPT models.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,646 questions
Azure AI Content Safety
Azure AI Content Safety
An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.
32 questions
{count} vote

2 answers

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 35,926 Reputation points
    2024-06-21T09:33:46.07+00:00

    Mayank Sharma Apologies for the delayed response and thanks for your time and patience. I have further checked and did not find any limitations on using blocklist for GPT-4o model.

    Could you share any specific error details which helps in finding the root cause?


  2. Ahmed Youssef 0 Reputation points
    2025-02-11T06:40:38.8866667+00:00

    I am facing the same issue. Deployed gpt-4o-mini model:

    • When using the DefaultV2 content filter, the content filter works.
    • When using custom content filter, the content filter does not work at all

    Here is the bicep used to create the custom content filter

    param location string = 'australiaeast'
    param openAiServiceName string = 'openai-service'
    param raiPolicyName string = 'content-filtering'
    param blocklistName string = 'blocklist'
    
    // Resources
    resource openAiService 'Microsoft.CognitiveServices/accounts@2024-10-01' existing = {
      name: openAiServiceName
    }
    
    resource raiPolicy 'Microsoft.CognitiveServices/accounts/raiPolicies@2024-10-01' = {
      parent: openAiService
      name: raiPolicyName
      location: location
      properties: {
        basePolicyName: 'Microsoft.DefaultV2'
        contentFilters: [
          {
            name: 'Violence'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
    
          {
            name: 'Violence'
            blocking: true
            enabled: true
            severityThreshold: 'Medium'
            source: 'Completion'
          }
          {
            name: 'Hate'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
          {
            name: 'Hate'
            blocking: true
            enabled: true
            severityThreshold: 'Medium'
            source: 'Completion'
          }
          {
            name: 'Sexual'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
          {
            name: 'Sexual'
            blocking: true
            enabled: true
            severityThreshold: 'Medium'
            source: 'Completion'
          }
          {
            name: 'Selfharm'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
          {
            name: 'Selfharm'
            blocking: true
            enabled: true
            severityThreshold: 'Medium'
            source: 'Completion'
          }
          {
            name: 'Jailbreak'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
          {
            name: 'Indirect Attack'
            blocking: true
            enabled: true
            severityThreshold: 'Low'
            source: 'Prompt'
          }
        ]
        customBlocklists: [
          {
            blocking: true
            blocklistName: blocklistName
            source: 'Prompt'
          }
        ]
        mode: 'Default'
      }
    }
    
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.