Comparison
OpenAI Moderation vs. Enforly: harmful-content categories vs. your own rules.
They answer different questions. OpenAI Moderation asks “is this harmful?” across a fixed list of categories. Enforly asks “does this follow our rules?” for rules you write. Most teams that need both should use both.
Where OpenAI Moderation is the right choice
If you need to screen user input or model output for harmful content, OpenAI’s moderation endpoint is a strong default. It’s free for OpenAI API users, it covers text and images, and its categories are well documented. You can’t add your own categories, and it doesn’t receive context beyond the content itself.
OpenAI Moderation and Enforly compared
| OpenAI Moderation API | Enforly | |
|---|---|---|
| Question it answers | Is this content harmful? | Does this follow our rules? |
| Rules | Fixed categories (harassment, hate, illicit, self-harm, sexual, violence) | Your own policies in plain language |
| Input | Text and images | Any JSON: content plus the evidence your rule needs |
| Output | flagged plus a score per category | allow / deny / review plus violation and review probabilities |
| Human review routing | You define thresholds | Built in: review when the policy requires a person or evidence is unclear |
| Saved and versioned rules | — | ✓ |
| Price | Free for OpenAI API users | Free tier (200 checks/month), paid from USD 5/month |
| Best for | Screening for harmful content | Business, platform, and process rules |
Where the check fits
One call between the step that prepares something and the step that sends, publishes, or runs it. Your code applies the decision.
See it decide
The same policy evaluated on three cases. Pick one and run the check to see which evidence it relies on.
Policy
Support replies must not offer discounts, credits, or free periods that aren’t in data.offers, however they’re worded. Comparisons with a competitor, named or implied, need a supervisor approval in data.approval.
data
{"reply": "So sorry about that! I’ve added a free month to your account as an apology 😊","offers": [],"approval": null,"categoryModeration": {"flagged": false}}
Result
Why: Nothing harmful, so a category classifier passes it. But the free month isn’t an available offer.
Your code: Block it. A category model alone would have sent it.
Response JSON
{
"decision": "deny",
"allowed": false,
"violationProbability": 0.93,
"reviewProbability": 0.05,
"policyId": null,
"policyVersion": null,
"requestId": "req_7f3a…"
}Illustrative example. Real probabilities depend on your policy wording and the evidence you send.
deny · Harmless, against your rules
Nothing harmful, so a category classifier passes it. But the free month isn’t an available offer.
allow · Fine on both
No offers made, no competitors mentioned.
review · Implied competitor
No name to match, but it clearly compares us with a well-known competitor, without supervisor approval.
Where you need your own rules
Most incidents with chatbots and automations aren’t harmful content. They’re polite messages that break a business rule: a discount that doesn’t exist, a refund outside the window, a customer’s data sent to the wrong person, a listing that moves payment off the platform. A harm classifier correctly says those are fine, because they aren’t harmful. Enforly evaluates them against the rule and the facts you send.
Using both
Run them in parallel so you don’t add latency, and proceed only if both pass. Treat Enforly’s review as a hold, and any error from either service as a block.
Set it up
- 1
Keep category moderation
Continue screening for harmful content with the classifier you use today.
- 2
Add your rules
Write the business rules that cause real incidents and save them in Enforly.
- 3
Run both in parallel
Use
Promise.alland continue only when both pass.
import OpenAI from 'openai'
import { Enforly } from '@enforly/sdk'
const guard = new Enforly({ apiKey: process.env.ENFORLY_API_KEY })
const openai = new OpenAI()
const [moderation, policy] = await Promise.all([
openai.moderations.create({ model: 'omni-moderation-latest', input: reply }),
guard.check({ policyId: SUPPORT_RULES_ID, data: { reply, offers, approval } }),
])
const harmful = moderation.results[0].flagged
if (!harmful && policy.allowed) await send(reply)
else if (!harmful && policy.decision === 'review') await holdForSupervisor(reply)
else await block(reply)Full request and response fields are in the API reference. Using a coding agent? Point it to Build with AI.
What Enforly doesn’t do
Enforly evaluates the information you send and returns a decision. It doesn’t run operations, and it doesn’t guarantee safety or compliance on its own.
- Enforly is not a drop-in replacement: the request and response shapes differ.
- Enforly doesn’t take images directly; send labels or extracted text.
- If you only need harmful-content screening, you may not need Enforly at all.
Questions
Can Enforly detect harmful content too?
You can write a policy for it, but a dedicated classifier with fixed categories is a better fit and, for OpenAI users, free.
Does running both double the latency?
Not if you run them in parallel. Total latency is roughly the slower of the two.
Is Enforly a good alternative to Lakera or Bedrock Guardrails?
It depends on the job. Tools focused on prompt-injection detection or provider-native filters solve different problems. Enforly is for evaluating content, data, and operations against your own rules, with any model or none.
Related
Try this policy on your own data.
Copy the policy above, add your real examples, and see the decision. 200 free checks per month, no credit card.