Skip to content

feat: configurable Content Safety violation messages - #1079

Merged
paullizer merged 3 commits into
Developmentfrom
feature/989-custom-content-safety-message
Jul 27, 2026
Merged

feat: configurable Content Safety violation messages#1079
paullizer merged 3 commits into
Developmentfrom
feature/989-custom-content-safety-message

Conversation

@paullizer

@paullizer paullizer commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an Admin Settings Markdown editor for the Content Safety violation message, using the existing local SimpleMDE toolbar.
  • Persist a configurable message and an Include Trigger Information switch; the switch controls whether reasons, categories/severities, and blocklist matches are appended.
  • Consolidate normal and streaming Content Safety response formatting in a shared helper, preserving the previous detailed default behavior.
  • Stabilize the hidden Safety-tab editor: it refreshes after visible layout settles, Markdown-only edits enable Save Settings, and the editor synchronizes into the submitted form field.
  • Add seeded defaults, regression coverage, feature documentation, release notes, and the 0.250.061 application version bump.

Design Note

The implementation uses an explicit trigger-information toggle rather than template placeholders. This gives administrators the requested choice to include or omit violation details without interpolating dynamic values into the Markdown template.

Validation

  • python -m pytest -q functional_tests/test_content_safety_violation_message.py - 5 passed
  • python scripts/check_swagger_routes.py application/single_app/route_backend_chats.py application/single_app/route_frontend_admin_settings.py - passed
  • Route policy suites - 12 passed
  • python scripts/check_xss_sinks.py --base-sha origin/Development --head-sha HEAD ... - passed
  • python scripts/check_broken_access_control.py --base-sha origin/Development --head-sha HEAD ... - passed
  • Python compilation, JavaScript editor-script syntax, and full branch whitespace checks - passed
  • Live browser validation as an administrator:
    • Safety Violation Message shows the standard 12-control Markdown toolbar.
    • Markdown-only edits activate Save Settings and persist after a full reload.
    • A policy-blocked chat rendered the configured Markdown message, omitted trigger details when disabled, and retained the Safety Violations link.
    • The original local Admin Settings value was restored after the test.

Fixes #989

@paullizer
paullizer marked this pull request as ready for review July 27, 2026 19:13
@paullizer
paullizer merged commit 4f0a15d into Development Jul 27, 2026
12 checks passed
@paullizer
paullizer deleted the feature/989-custom-content-safety-message branch July 27, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant