You can use this extension plugin to implement an API extension for content moderation, and you can customize keyword lists and separators, as well as strategies for keyword flagged.
Keyword-based content moderation extension for Dify.
This plugin exposes a moderation endpoint that Dify can call to inspect both app input and app output. It uses a configurable keyword list, a custom separator, and an API key to decide whether flagged content should be blocked or masked.
Existing configurations without retain behavior.
Copy the and from the previous step.
Matching is literal, case-sensitive substring matching. Keywords are trimmed,
empty entries discarded, and duplicates removed. The separator may contain multiple
characters but cannot be empty. Overlapping keyword occurrences are masked as one
span, independently of keyword order; adjacent occurrences each become .
All responses use JSON. Missing or malformed Bearer credentials return ;
an incorrect key returns . Authentication occurs before body parsing, and an
empty configured key cannot authenticate. Malformed JSON, unsupported , and
invalid payload field types return . Invalid moderation configuration returns
rather than silently approving content. Authenticated returns
without requiring moderation settings.
The supported points are , , and
. must be an object; must be an object,
and and must be strings when present. Omitted fields use empty defaults.
Create a file based on :
See CHANGELOG.md for the 0.0.3 release notes.
The following features are planned and are not available in 0.0.3. The milestones
indicate implementation order rather than fixed release dates; scope may change
based on Dify compatibility and benchmark results.
The 0.0.3 changes already cover independent input/output strategies, request and
configuration validation, authentication hardening, overlap-safe masking, and
publishing branch consistency with retry handling. See CHANGELOG.md
for implemented changes.
This plugin processes content locally for moderation without persisting it or sending it to third-party services. See PRIVACY.md for authentication, storage, and logging details.
See LICENSE.
No outbound calls found
Last checked 10/10/2026 10:50 AM · version 0.0.3