Skip to content

[TAN-7583] Check content against tenant-defined moderation guidelines#14288

Open
kogre wants to merge 2 commits into
masterfrom
TAN-7583-custom-moderation-guidelines
Open

[TAN-7583] Check content against tenant-defined moderation guidelines#14288
kogre wants to merge 2 commits into
masterfrom
TAN-7583-custom-moderation-guidelines

Conversation

@kogre

@kogre kogre commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Allows a tenant's own moderation policy to be enforced by the AI inappropriate-content detection.

The guidelines are plain text stored in a new custom_guidelines setting on the flag_inappropriate_content feature and injected into a delimited section of the detection prompt, so the prompt scaffolding and output contract stay under our control.

Changelog

Added

  • The AI inappropriate content detection can now check posts and comments against platform-specific moderation guidelines. Guidelines are configured as plain text in the new custom_guidelines setting of the "Flag Inappropriate Content" feature (via Admin HQ; there is no in-product UI yet). Content that violates them shows up in the moderation queue as flagged with the new guideline_violation label, alongside the AI's reason.

Changed

  • Toxicity detection now selects its model through the per-tenant AI provider settings (the existing but previously unused toxicity_detection use case), defaulting to Claude Haiku 4.5, instead of a hardcoded Claude 3 Haiku.

kogre and others added 2 commits July 13, 2026 17:22
Adds an optional custom_guidelines plain-text setting to the
flag_inappropriate_content feature. When present, the guidelines are
injected into the toxicity detection prompt as an extra category, and
violations are flagged with the new guideline_violation toxicity label.

The detection model is now selected through LLMSelector's
toxicity_detection use case (Claude Haiku 4.5 by default) instead of a
hardcoded Claude 3 Haiku client, and the response is parsed from
structured output instead of assistant-prefill prefix matching, since
the RubyLLM-based model classes don't support prefills. The prompt
template loses its claude_ prefix as it is no longer model-specific.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… switch

Toxicity detection was the only consumer of the Bedrock converse client
and its Claude 3 Haiku subclass. The aws-sdk-bedrockruntime gem stays,
as CohereMultilingualEmbeddings still uses it directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@notion-workspace

Copy link
Copy Markdown

@kogre kogre requested a review from AchrafGoVocal July 13, 2026 15:26
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