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
Moderation(action="redact") only replaces profanity. Toxicity matches are classified (classification="toxicity", score 0.95) but left in the text, and transformed_text stays None. The pipeline then forwards the original toxic string unchanged. The sibling PII guard defines redact as replacing matches with [REDACTED:label], and the pipeline chains transformed_text from REDACT results.
Reproduction
fromopenlit.guard.moderationimportModerationresult=Moderation(action="redact").evaluate("kill yourself")
# action=REDACT, classification="toxicity", transformed_text=None# -> toxic phrase is still forwarded downstream
Expected
Redaction applies to toxicity patterns as well, producing a populated transformed_text with no toxic phrase.
Proposed fix
Compile the existing toxicity patterns once and substitute [REDACTED:toxicity] into the text alongside profanity; keep classification/score and other actions unchanged.
Activity