AI Safety
How to Moderate AI-Generated Text
Catch unsafe completions before users see them.
Pre-screen prompts and post-screen outputs in real time.
What it detects
- • Hate speech in completions
- • PII leakage
- • Policy violations
- • Jailbreak success indicators
- • Hallucinated unsafe content
- • Custom rules
Why developers choose Vettly
- • Streaming SDK for real-time output screening
- • Pre-built llm-output policy
- • Same API works on inputs and outputs
- • Audit trail for every blocked completion
Example request
bashimport { createStreamingClient } from '@vettly/sdk';
const streaming = createStreamingClient('YOUR_KEY');
const ws = streaming.connectRealtime({
policyId: 'chat-policy',
onResult: (result) => {
if (result.safe) showMessage(result);
else logBlocked(result);
}
});
await ws.connect();
const result = await ws.moderate(message);Example response
json{
"safe": true,
"action": "allow",
"categories": {
"harassment": 0.02,
"spam": 0.01
},
"latency_ms": 47
}Compared to relying on model safety alone
Model-side guardrails are routinely evaded. An independent check after generation closes that gap.
Keep exploring
AI Chatbot Moderation API
Moderate inputs and LLM outputs in real time. Block prompt injection, NSFW content, and policy violations before users see them.
Vettly vs OpenAI Moderation
Multi-modal coverage, dashboards, and provider freedom vs text-only checks.
Content Moderation API
One endpoint for text, image, and video moderation.
Content Moderation in Next.js
Add content moderation to a Next.js App Router project in minutes. Route Handlers, Server Actions, edge runtime, policy setup, and safe error handling.