Skip to content

Commit 3229145

Browse files
committed
content filter update
1 parent 5aa22af commit 3229145

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed

articles/ai-foundry/includes/create-content-filter.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.reviewer: pafarley
66
ms.author: pafarley
77
ms.service: azure-ai-foundry
88
ms.topic: include
9-
ms.date: 11/25/2024
9+
ms.date: 03/05/2025
1010
ms.custom: include
1111
---
1212

@@ -74,3 +74,5 @@ Follow these steps to apply a content filter to a deployment:
7474

7575
Now, you can go to the playground to test whether the content filter works as expected.
7676

77+
> [!TIP]
78+
> You can also create and update content filters using the REST APIs. For more information, see the [API reference](/rest/api/aiservices/accountmanagement/rai-policies/create-or-update).

articles/ai-services/openai/how-to/content-filters.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: 'Use content filters (preview) with Azure AI Foundry'
2+
title: 'Use content filters (preview)'
33
titleSuffix: Azure OpenAI
44
description: Learn how to use and configure the content filters that come with Azure AI Foundry, including getting approval for gated modifications.
55
#services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-openai
88
ms.topic: how-to
9-
ms.date: 12/05/2024
9+
ms.date: 03/05/2025
1010
author: mrbullwinkle
1111
ms.author: mbullwin
1212
recommendations: false
1313
ms.custom: FY25Q1-Linter
1414
# customer intent: As a developer, I want to learn how to configure content filters with Azure AI Foundry so that I can ensure that my applications comply with our Code of Conduct.
1515
---
1616

17-
# How to configure content filters with Azure AI Foundry
17+
# How to configure content filters
1818

1919
The content filtering system integrated into Azure AI Foundry runs alongside the core models, including DALL-E image generation models. It uses an ensemble of multi-class classification models to detect four categories of harmful content (violence, hate, sexual, and self-harm) at four severity levels respectively (safe, low, medium, and high), and optional binary classifiers for detecting jailbreak risk, existing text, and code in public repositories.
2020

@@ -49,6 +49,42 @@ You can configure the following filter categories in addition to the default har
4949

5050
[!INCLUDE [create-content-filter](../../../ai-foundry/includes/create-content-filter.md)]
5151

52+
## Specify a content filtering configuration at request time (preview)
53+
54+
In addition to the deployment-level content filtering configuration, we also provide a request header that allows you specify your custom configuration at request time for every API call.
55+
56+
```curl
57+
curl --request POST \
58+
--url 'URL' \
59+
--header 'Content-Type: application/json' \
60+
--header 'api-key: API_KEY' \
61+
--header 'x-policy-id: CUSTOM_CONTENT_FILTER_NAME' \
62+
--data '{
63+
"messages": [
64+
{
65+
"role": "system",
66+
"content": "You are a creative assistant."
67+
},
68+
{
69+
"role": "user",
70+
"content": "Write a poem about the beauty of nature."
71+
}
72+
]
73+
}'
74+
```
75+
76+
The request-level content filtering configuration will override the deployment-level configuration, for the specific API call. If a configuration is specified that does not exist, the following error message will be returned.
77+
78+
```json
79+
{
80+
"error":
81+
{
82+
"code": "InvalidContentFilterPolicy",
83+
"message": "Your request contains invalid content filter policy. Please provide a valid policy."
84+
}
85+
}
86+
```
87+
5288
## Report content filtering feedback
5389

5490
If you are encountering a content filtering issue, select the **Filters Feedback** button at the top of the playground. This is enabled in the **Images, Chat, and Completions** playground once you submit a prompt.
@@ -66,3 +102,4 @@ We recommend informing your content filtering configuration decisions through an
66102
- Learn more about Responsible AI practices for Azure OpenAI: [Overview of Responsible AI practices for Azure OpenAI models](/legal/cognitive-services/openai/overview?context=/azure/ai-services/openai/context/context).
67103
- Read more about [content filtering categories and severity levels](../concepts/content-filter.md) with Azure AI Foundry.
68104
- Learn more about red teaming from our: [Introduction to red teaming large language models (LLMs) article](../concepts/red-teaming.md).
105+
- Learn how to [configure content filters using the API](/rest/api/aiservices/accountmanagement/rai-policies/create-or-update)

articles/ai-services/openai/whats-new.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ ms.custom:
1111
- references_regions
1212
- ignite-2024
1313
ms.topic: whats-new
14-
ms.date: 2/27/2025
14+
ms.date: 03/05/2025
1515
recommendations: false
1616
---
1717

1818
# What's new in Azure OpenAI Service
1919

2020
This article provides a summary of the latest releases and major documentation updates for Azure OpenAI Service.
2121

22+
## March 2025
23+
24+
### Content Filtering
25+
26+
In addition to the deployment-level content filtering configuration, we now also provide a request header that allows you specify your custom configuration at request time for every API call. For more information, see [Use content filters (preview)](./how-to/content-filters.md#specify-a-content-filtering-configuration-at-request-time-preview).
27+
2228
## February 2025
2329

2430
### GPT-4.5 Preview

0 commit comments

Comments
 (0)