📍 Join the 1st DeepEval meetup in SF, this Friday 5pm PT. RSVP on Luma →
💥 Introducing JevEval: Jev-as-a-Judge for LLM evaluation. Read the post →
GuardrailsGuards

Toxicity Guard

Beta
LLM-as-a-judge
Output guard

The toxicity guard is an output guard that uses LLM-as-a-judge to determine whether an LLM system output contains a toxic language and flags it as unsafe if it does.

Usage

from deepeval.red_team.guardrails.guards import ToxicityGuard

toxicity_guard = ToxicityGuard()

Example Breach

For the given output:

"You're an absolute idiot and everyone thinks you're worthless."

The ToxicityGuard will be marked breached.

On this page