Safety classifier
A safety classifier is a model that checks content going into or coming out of an AI system and flags or blocks material that breaks a safety policy.
A safety classifier sits beside the main AI model rather than inside it. It reads a user's prompt, the model's response or both, and assigns them to categories such as hate, self-harm or weapons, usually with a score for each. The surrounding system then decides what to do: let the content through, block it, have the model refuse, or log it for review. Because it is separate, it can be updated without retraining the main model, and it adds a second line of defence if the model's own refusal training is bypassed.
Meta's Llama Guard, described in a December 2023 paper, is a well-known open example. It is a Llama 2 7B model fine-tuned to classify both prompts and responses against a taxonomy of safety risks and to output a safe or unsafe judgement, and users can change the categories to fit their own policy. OpenAI offers a moderation endpoint built on its omni-moderation-latest model, which checks text against 13 categories, including harassment, hate, illicit activity, self-harm, sexual content and violence, checks images against six of them, and returns a flag plus a score from 0 to 1 for each. As of December 2026 OpenAI's documentation lists the endpoint as free to use.
Classifiers can also be trained for a narrow, high-stakes purpose. In January 2025 Anthropic described Constitutional Classifiers, trained on synthetic data generated by prompting language models with a written set of rules about allowed and restricted content. Against an early version, red teamers spent more than 3,000 estimated hours without finding a universal jailbreak. Anthropic used this approach to screen for a narrow class of weapons information when it launched Claude Opus 4 under its ASL-3 protections in May 2025.
Every classifier involves a threshold and a trade-off. Set it strictly and it blocks more harmful content but also more legitimate requests, a problem known as over-refusal. Set it loosely and more gets through. Running a second model also costs money and time: Anthropic's classifiers added about 23.7% to inference costs and raised refusals of real traffic by 0.38 percentage points. Classifiers can themselves be fooled by cleverly worded inputs, which is why they are one layer among several.
For businesses building on AI models, a safety classifier is often the simplest way to enforce their own content rules, for example screening user posts on a platform or keeping a customer service bot on topic. The key decisions are which categories matter, where to set the thresholds and what happens to borderline cases.
It is a separate model that labels content going into or out of an AI system as safe or unsafe, usually by category, so the system can block or handle it. Examples include Meta's Llama Guard, OpenAI's moderation endpoint and Anthropic's Constitutional Classifiers. Refusals are behaviour trained into the main model, which jailbreaks sometimes get round. A classifier is an independent check that inspects the input or output and can stop it regardless of what the main model decided. Using both gives two chances to catch a problem. Sometimes. Classifiers are models too, and carefully crafted inputs can slip past them or trigger false alarms. Developers retrain them on new attack examples and combine them with monitoring and enforcement, so that one missed case does not mean an unchecked system. As of December 2026, OpenAI's documentation says the moderation endpoint is free to use. It runs the omni-moderation-latest model, which accepts text and images and returns per-category flags and confidence scores.Common questions
What is a safety classifier in AI?
How is a safety classifier different from a model's own refusals?
Can safety classifiers be bypassed?
Is OpenAI's moderation API free?
Search for "Llama Guard", "moderation API", "Constitutional Classifiers" or "input output safety classifier" to compare the main approaches. Developer documentation gives the categories and output formats, and research papers on arXiv report how well classifiers perform and how they were attacked. Accuracy figures depend heavily on the test data, so compare classifiers on examples that resemble your own content.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.