llamaguard

Classify and filter unsafe user and model content with LlamaGuard-7b.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/tadod12/fraud-detection-research --skill llamaguard-tadod12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llamaguard
Source: https://github.com/tadod12/fraud-detection-research/tree/main/.agent/skills/07-safety-alignment/llamaguard
Command: npx skills add https://github.com/tadod12/fraud-detection-research --skill llamaguard-tadod12

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LlamaGuard provides specialized moderation for LLM inputs and outputs, ensuring safer conversations by automatically classifying and filtering unsafe content across multiple categories.

Core Features & Use Cases

  • Category-based safety classification across violence, sexual content, weapons, substances, self-harm, and criminal planning.
  • Integration-ready workflows: input filtering, output moderation, vLLM deployment, API serving, and NeMo Guardrails.
  • Real-world use: deploy in chat apps to prevent unsafe prompts and responses.

Quick Start

Install transformers and torch, login to HuggingFace, load the LlamaGuard-7b model, and run moderation on user messages to filter unsafe content.

Frequently Asked Questions about llamaguard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I filter unsafe LLM prompts before they reach the model?

To filter unsafe LLM prompts, you can apply input filtering using LlamaGuard-7b to classify text across categories like violence and self-harm, blocking inappropriate messages before processing.

Can I use LlamaGuard with NeMo Guardrails for content moderation?

Yes, LlamaGuard integrates directly with NeMo Guardrails to enforce content safety, providing category-based classification and filtering for both user inputs and model outputs.

How do I deploy LlamaGuard for API serving in production?

You can deploy LlamaGuard for production API serving using vLLM, loading the LlamaGuard-7b model from the HuggingFace repository to moderate chat app conversations at scale.

What are the prerequisites to run LlamaGuard locally?

Running LlamaGuard locally requires installing the transformers and torch stack, authenticating with the HuggingFace model repository to download LlamaGuard-7b, and configuring your local environment.

How does LlamaGuard classify unsafe content categories?

LlamaGuard classifies unsafe content by evaluating text against specific categories including violence, sexual content, weapons, substances, self-harm, and criminal planning to enforce safety.

Does LlamaGuard support output moderation for LLM responses?

Yes, LlamaGuard supports output moderation by evaluating model-generated responses against its safety categories, filtering unsafe LLM outputs before they are returned to the user.