I’m working on setting up Azure OpenAI using Terraform and running into some problems with content filtering. The basic setup with azurerm_cognitive_account and azurerm_cognitive_deployment worked fine, but I’m having trouble with certain filter types when using azurerm_cognitive_account_rai_policy.
The standard filters like Violence, Hate, Sexual, and Self-harm work without issues. However, I keep getting errors when trying to set up advanced protection filters like Jailbreak prompt protection
, Indirect attack shields
, Text material protection
, and Code material safeguards
.
Here’s my configuration:
resource "azurerm_cognitive_account_rai_policy" "content_policy" {
name = "my-content-policy"
cognitive_account_id = azurerm_cognitive_account.openai_service.id
base_policy_name = "Microsoft.DefaultV2"
content_filter {
name = "Jailbreak prompt protection"
filter_enabled = true
block_enabled = true
source = "Prompt"
}
depends_on = [azurerm_cognitive_account.openai_service]
}
The error message I’m seeing:
Error: creating Rai Policy: unexpected status 400 (400 Bad Request) with error: Resource has invalid content filter: The content filter Jailbreak prompt protection in the policy is not supported.
Any ideas why these specific filter types aren’t working? Are there different naming conventions or additional requirements for these advanced filters?