Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 2.29 KB

CUSTOMIZATIONS_CONTENT_FILTERING.md

File metadata and controls

60 lines (50 loc) · 2.29 KB

Configuring AOAI content filters

Azd automatically creates content filters profile with default severity threshold (Medium) for all content harms categories (Hate, Violence, Sexual, Self-Harm) and assignes it to provisioned AOAI model through post deployment script. However, if you want to customize them to be more or less restrictive, you can make changes to raipolicies.json file.

Example: Changing filters threshold for violence (prompt) and self-harm (completion) categories

    {
        "name": "violence",
        "blocking": true,
        "enabled": true,
        "allowedContentLevel": "high",
        "source": "prompt"
    },
    {
        "name": "selfharm",
        "blocking": true,
        "enabled": true,
        "allowedContentLevel": "low",
        "source": "completion"
    }

(Optional) Content filters also support additional safety models (Jailbreak, Material Protection for Text or Code) that can be run on top of the main content filters.

Example: Enabling Jailbreak and Text Material protection

{
    
    "name": "jailbreak",
    "blocking": true,
    "source": "prompt",
    "enabled": true
},
{
    "name": "protected_material_text",
    "blocking": true,
    "source": "completion",
    "enabled": true
},
{
    "name": "protected_material_code",
    "blocking": false,
    "source": "completion",
    "enabled": false
}

Then, follow regular installation & deployment process.

Note: You need to make changes in raipolicies.json file before executting azd up command, if you want to provision and deploy all in once.

In order you update content filters policies for already deployed model, run the following command.

azd provision