You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/content-safety/quickstart-jailbreak.md
+41-4Lines changed: 41 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Quickstart: Prompt Shields (preview)"
2
+
title: "Quickstart: Prompt Shields "
3
3
titleSuffix: Azure AI services
4
4
description: Learn how to detect large language model input attack risks and mitigate risk with Azure AI Content Safety.
5
5
services: ai-services
@@ -13,10 +13,47 @@ ms.author: pafarley
13
13
14
14
# Quickstart: Prompt Shields (preview)
15
15
16
-
Follow this guide to use Azure AI Content Safety Prompt Shields to check your large language model (LLM) inputs for both User Prompt and Document attacks.
16
+
## Introduction
17
+
"Prompt Shields" in Azure AI Content Safety are specifically designed to safeguard generative AI systems from generating harmful or inappropriate content. These shields detect and mitigate risks associated with both User Prompt Attacks (malicious or harmful user-generated inputs) and Document Attacks (inputs containing harmful content embedded within documents). The use of "Prompt Shields" is crucial in environments where GenAI is employed, ensuring that AI outputs remain safe, compliant, and trustworthy.
18
+
19
+
The primary objectives of the "Prompt Shields" feature for GenAI applications are:
20
+
21
+
- To detect and block harmful or policy-violating user prompts that could lead to unsafe AI outputs.
22
+
- To identify and mitigate document attacks where harmful content is embedded within user-provided documents.
23
+
- To maintain the integrity, safety, and compliance of AI-generated content, thereby preventing misuse of GenAI systems.
17
24
18
25
For more information on Prompt Shields, see the [Prompt Shields concept page](./concepts/jailbreak-detection.md). For API input limits, see the [Input requirements](./overview.md#input-requirements) section of the Overview.
19
26
27
+
28
+
29
+
30
+
## User Scenarios
31
+
### 1. AI Content Creation Platforms: Detecting Harmful Prompts
32
+
- Scenario: An AI content creation platform uses generative AI models to produce marketing copy, social media posts, and articles based on user-provided prompts. To prevent the generation of harmful or inappropriate content, the platform integrates "Prompt Shields."
33
+
- User: Content creators, platform administrators, and compliance officers.
34
+
- Action: The platform uses Azure AI Content Safety's "Prompt Shields" to analyze user prompts before generating content. If a prompt is detected as potentially harmful or likely to lead to policy-violating outputs (e.g., prompts asking for defamatory content or hate speech), the shield blocks the prompt and alerts the user to modify their input.
35
+
- Outcome: The platform ensures all AI-generated content is safe, ethical, and compliant with community guidelines, enhancing user trust and protecting the platform's reputation.
36
+
### 2. AI-Powered Chatbots: Mitigating Risk from User Prompt Attacks
37
+
- Scenario: A customer service provider uses AI-powered chatbots for automated support. To safeguard against user prompts that could lead the AI to generate inappropriate or unsafe responses, the provider uses "Prompt Shields."
38
+
- User: Customer service agents, chatbot developers, and compliance teams.
39
+
- Action: The chatbot system integrates "Prompt Shields" to monitor and evaluate user inputs in real-time. If a user prompt is identified as potentially harmful or designed to exploit the AI (e.g., attempting to provoke inappropriate responses or extract sensitive information), the shield intervenes by blocking the response or redirecting the query to a human agent.
40
+
- Outcome: The customer service provider maintains high standards of interaction safety and compliance, preventing the chatbot from generating responses that could harm users or breach policies.
- Scenario: An e-learning platform employs GenAI to generate personalized educational content based on student inputs and reference documents. To avoid generating inappropriate or misleading educational content, the platform utilizes "Prompt Shields."
43
+
- User: Educators, content developers, and compliance officers.
44
+
- Action: The platform uses "Prompt Shields" to analyze both user prompts and uploaded documents for content that could lead to unsafe or policy-violating AI outputs. If a prompt or document is detected as likely to generate inappropriate educational content, the shield blocks it and suggests alternative, safe inputs.
45
+
- Outcome: The platform ensures that all AI-generated educational materials are appropriate and compliant with academic standards, fostering a safe and effective learning environment.
46
+
### 4. Healthcare AI Assistants: Blocking Unsafe Prompts and Document Inputs
47
+
- Scenario: A healthcare provider uses AI assistants to offer preliminary medical advice based on user inputs and uploaded medical documents. To ensure the AI does not generate unsafe or misleading medical advice, the provider implements "Prompt Shields."
48
+
- User: Healthcare providers, AI developers, and compliance teams.
49
+
Action: The AI assistant employs "Prompt Shields" to analyze patient prompts and uploaded medical documents for harmful or misleading content. If a prompt or document is identified as potentially leading to unsafe medical advice, the shield prevents the AI from generating a response and redirects the patient to a human healthcare professional.
50
+
- Outcome: The healthcare provider ensures that AI-generated medical advice remains safe and accurate, protecting patient safety and maintaining compliance with healthcare regulations.
51
+
### 5. Generative AI for Creative Writing: Protecting Against Prompt Manipulation
52
+
- Scenario: A creative writing platform uses GenAI to assist writers in generating stories, poetry, and scripts based on user inputs. To prevent the generation of inappropriate or offensive content, the platform incorporates "Prompt Shields."
53
+
- User: Writers, platform moderators, and content reviewers.
54
+
- Action: The platform integrates "Prompt Shields" to evaluate user prompts for creative writing. If a prompt is detected as likely to produce offensive, defamatory, or otherwise inappropriate content, the shield blocks the AI from generating such content and suggests revisions to the user.
55
+
56
+
20
57
## Prerequisites
21
58
22
59
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
@@ -33,7 +70,7 @@ This section walks through a sample request with cURL. Paste the command below i
33
70
1. Optionally, replace the `"userPrompt"` or `"documents"` fields in the body with your own text you'd like to analyze.
34
71
35
72
```shell
36
-
curl --location --request POST '<endpoint>/contentsafety/text:shieldPrompt?api-version=2024-02-15-preview' \
73
+
curl --location --request POST '<endpoint>/contentsafety/text:shieldPrompt?api-version=2024-09-01' \
@@ -48,7 +85,7 @@ The following fields must be included in the URL:
48
85
49
86
| Name | Required? | Description | Type |
50
87
| :-- | :-- | :----- | :----- |
51
-
|**API Version**| Required | This is the API version to be used. The current version is: api-version=2024-02-15-preview. Example: `<endpoint>/contentsafety/text:shieldPrompt?api-version=2024-02-15-preview`| String |
88
+
|**API Version**| Required | This is the API version to be used. The current version is: api-version=2024-09-01. Example: `<endpoint>/contentsafety/text:shieldPrompt?api-version=2024-09-01`| String |
52
89
53
90
The parameters in the request body are defined in this table:
0 commit comments