dify icon indicating copy to clipboard operation
dify copied to clipboard

Support Multiple Concurrent Moderation Types for Enhanced Content Filtering

Open yutingcaicyt opened this issue 2 weeks ago • 1 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report, otherwise it will be closed.
  • [x] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Problem Description Currently, the moderation system only supports enabling a single moderation type at a time. There's no ability to use multiple moderation mechanisms concurrently (e.g., using both external moderation like telecom and keyword-based moderation as a backup or supplementary layer). Current Behavior In the current implementation: Only one moderation type can be configured and activated via sensitive_word_avoidance.type When configuring moderation in AppModelConfig, users must choose a single moderation type from available options (keywords, openai_moderation, telecom, api) There's no mechanism to chain or combine multiple moderation types Expected Behavior Users should be able to configure multiple moderation types that work together: Primary moderation (e.g., external API like telecom) Secondary/fallback moderation (e.g., keyword filtering) Sequential processing where content passes through multiple moderation layers Configuration allowing multiple moderation types with priority ordering

Use Case A typical use case would be: First, use external AI moderation service (like telecom) for comprehensive content analysis Then, apply keyword filtering as an additional safety layer Content should be flagged if either moderation mechanism identifies issues

Benefits Enhanced content safety through layered moderation Redundancy in case primary moderation service fails Flexibility to combine different moderation approaches Better compliance with various regulatory requirements This enhancement would significantly improve the robustness of the content moderation system.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

yutingcaicyt avatar Dec 09 '25 08:12 yutingcaicyt

Hi! I'd like to take this issue.

RealElysidox avatar Dec 11 '25 07:12 RealElysidox