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
{{ message }}
Repository navigation
Commit 4f0a15d
Browse filesBrowse the repository at this point in the historyBrowse files
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Show the reason, detected categories and severities, and blocklist matches below the safety message."></i>
9093
+
</div>
9094
+
<p class="form-text text-muted mb-3">Disable this option to show only the configured message.</p>
Related config.py version update: `application/single_app/config.py` is **0.250.061** for this implementation.
6
+
7
+
## Overview
8
+
9
+
Administrators can configure the Markdown message shown when Azure Content Safety blocks a chat message. They can also choose whether the response includes trigger information such as block reasons, detected categories with severity, and blocklist matches.
10
+
11
+
## Dependencies
12
+
13
+
- Content Safety must be enabled in Admin Settings.
14
+
- The existing local `marked` and `DOMPurify` assets render and sanitize the saved Markdown in chat.
15
+
16
+
## Technical Specifications
17
+
18
+
-`content_safety_violation_message` stores the administrator-authored Markdown template.
19
+
-`content_safety_include_trigger_information` controls whether Content Safety details are appended to the message.
20
+
- The default message is `Your message was blocked by Content Safety.` and trigger information is enabled by default, preserving previous behavior.
21
+
- Blank or missing templates fall back to the default message, and saved templates are limited to 3,000 characters.
22
+
- Normal and streaming chat requests call the same backend formatter before persisting and returning a `safety` message.
23
+
- The chat UI renders safety messages through `DOMPurify.sanitize(marked.parse(...))`; no remote browser assets are added.
24
+
- The editor refreshes after the hidden Safety tab becomes visible, and Markdown-only edits enable Save Settings and synchronize to the submitted form value.
25
+
26
+
## Usage Instructions
27
+
28
+
1. Open **Admin Settings** and enable Content Safety.
29
+
2. Use the standard Markdown toolbar in **Safety Violation Message** to format the desired text.
30
+
3. Keep **Include Trigger Information** selected to append the block reason, categories, severities, and blocklist matches. Clear it to show only the configured message.
31
+
4. Save the settings. Newly blocked chat messages use the saved configuration.
32
+
33
+
## Testing and Validation
34
+
35
+
-`functional_tests/test_content_safety_violation_message.py` validates the Markdown editor toolbar, default output, Markdown template preservation, trigger-information suppression, and blank-template fallback.
36
+
- Admin Settings validation verifies message normalization, seed defaults, and the form controls.
37
+
- Version was updated in `application/single_app/config.py` to `0.250.061` for traceability.
38
+
39
+
## Known Limitations
40
+
41
+
- The setting applies to text-chat Content Safety blocks. Image-generation moderation messages continue to use their existing dedicated copy.
42
+
- Saved messages affect newly created safety messages; historical conversation messages retain the text stored when they were created.
Copy file name to clipboardExpand all lines: docs/explanation/release_notes.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,16 @@
2
2
3
3
For feature-focused and fix-focused drill-downs by version, see [Features by Version](/explanation/features/) and [Fixes by Version](/explanation/fixes/).
0 commit comments