Skip to main content
Use Llama Guard 4 to classify user-generated content for safety before it reaches your product. The model returns structured safety labels — no manual prompt engineering, no regex rules, no third-party moderation service.

Model

Llama Guard 4 evaluates text against a predefined taxonomy of unsafe content categories: violence, sexual content, hate speech, self-harm, criminal activity, and more. It returns a structured verdict you can use for automated decisions.

Classify a single message

The model responds with safe or unsafe followed by the violated category (e.g., unsafe\nS1 for violence-related content).

Moderation middleware

Build a reusable moderation function for your app:

Next steps