Security
Moderation
Classify inputs and outputs against your content policy.
What it is and why it exists
Moderation classifiers flag hate, harassment, self-harm, sexual and violent content, plus custom categories for your product. They run on input (block or route) and output (block, rewrite or escalate), with thresholds tuned for your false-positive tolerance.
Quick prototype
Provider moderation endpoint on input.
In production, at scale
Input and output checks, custom policy categories, thresholds tuned on labelled data per locale, appeals or human review for edge cases, and metrics on trigger rates.
Vendors and tools
| OpenAI Moderation | Free moderation endpoint |
|---|---|
| Llama Guard / ShieldGemma | Open policy classifiers |
| Perspective API / Hive | Toxicity and content moderation |
On AWS: Bedrock Guardrails content filters and denied topics; Amazon Comprehend toxicity detection; Rekognition content moderation for images.
How it fails
- Over-blocking medical or security questions
- Output moderation after streaming has already shown the text
What the interviewer asks next
How do you moderate a streamed response?
Moderate in chunks as text accumulates (buffer a sentence or two), stop the stream and replace the message if it trips, and accept a small latency cost on high-risk surfaces.