aicoolies logo
PurpleLlama Cybersecurity Benchmarks mark
PurpleLlama Cybersecurity Benchmarks mark

PurpleLlama

Meta's open-source LLM security suite with Llama Guard and CodeShield

open sourceupdated Aug 16, 2026

PurpleLlama is Meta's open-source suite of tools for evaluating and improving LLM safety. It includes Llama Guard models for input/output content safety classification, LlamaFirewall for multi-layer defense, CodeShield for insecure code detection, and CyberSecEval benchmarks for measuring LLM security. Llama Guard 4 supports multimodal safety across text and images. 4,100+ GitHub stars, backed by Meta AI with 44+ contributors.

Read our PurpleLlama review

A detailed review by the aicoolies team — click to read

PurpleLlama provides a comprehensive toolkit for LLM security that goes beyond simple content filtering. Llama Guard is a family of models purpose-trained for safety classification — they evaluate prompts and responses against configurable safety taxonomies and return structured verdicts. Unlike rule-based filters, Llama Guard understands context and nuance, reducing both false positives and bypasses. The latest Llama Guard 4 extends this to multimodal inputs.

LlamaFirewall implements defense-in-depth with multiple protection layers: prompt injection detection using PromptGuard, agent misalignment monitoring for tool-calling scenarios, and output content scanning. CodeShield specifically targets insecure code generation, detecting common vulnerabilities (SQL injection, XSS, buffer overflows) in LLM-generated code before it reaches production. CyberSecEval provides standardized benchmarks for measuring how well an LLM resists generating harmful content.

The suite is released under a custom open license with 4,100+ GitHub stars. All models run locally without external API calls, making them suitable for air-gapped and regulated environments. Compared to Guardrails AI (which validates structured outputs) or NeMo Guardrails (which controls conversation flows), PurpleLlama focuses specifically on safety classification and security evaluation with purpose-trained models rather than rule-based validation.

Pricing

Free and open-source (custom Meta license)

Platforms

Python, runs locally, models downloadable from HuggingFace

Categories

Tags

Use Cases

Guardrails AI logo

Guardrails AI

Validate and structure LLM outputs with composable Guards

Guardrails AI is an open-source Python and JavaScript framework for validating and structuring LLM outputs using composable Guards built from a Hub of pre-built validators. It handles structured data extraction with Pydantic models, content safety checks including toxicity, PII detection, competitor mentions, and bias filtering, plus automatic re-prompting when validation fails. The Guardrails Hub offers dozens of validators from regex matching to hallucination detection via LLM judges.

free
NVIDIA logo

NeMo Guardrails

Programmable safety rails for LLM applications

NeMo Guardrails is NVIDIA's open-source toolkit for adding programmable safety rails to LLM applications. It supports five guardrail types — input, dialog, retrieval, execution, and output rails — covering content safety, jailbreak detection, topic control, PII masking, hallucination detection, and fact-checking. The toolkit uses Colang, a domain-specific language for defining conversational constraints, and integrates with OpenAI, Azure, Anthropic, HuggingFace, and LangChain/LangGraph.

free
garak logo

garak

NVIDIA's LLM vulnerability scanner and red-teaming tool

garak is NVIDIA's open-source LLM vulnerability scanner for red-teaming AI models and applications. Probes for prompt injection, data leakage, hallucination, toxicity, encoding-based attacks, and dozens of other vulnerability categories. Runs automated attack sequences against any LLM endpoint and generates detailed vulnerability reports. Features a modular probe/detector architecture that is extensible with custom attack patterns. Named after the Star Trek character known for deception.

Open Source

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

ToolHive mascot logo

ToolHive

Run and govern MCP servers across desktop, CLI and Kubernetes

Open-source MCP runtime and governance platform that runs servers in isolated containers, curates registries, enforces access policies, and operates gateways across desktop, CLI, and Kubernetes.

Open Source
Anamorpher parent Trail of Bits mark

Anamorpher

Craft image-scaling prompt-injection payloads to red-team multimodal AI systems

Open-source red-team toolkit from Trail of Bits that generates image-scaling attack payloads — images that look benign at full resolution but reveal a hidden prompt injection after a multimodal system downsamples them.

freeOpen Source
cai

CAI (Cybersecurity AI)

AI agent framework for offensive security and penetration testing

Alias Robotics' agent framework for building AI-driven offensive-security workflows — reconnaissance, exploitation, privilege escalation, and lateral movement — with multi-agent handoffs and human-in-the-loop control. Source-available, but the core is licensed for non-commercial research use only.

freemiumTelemetry
MEDUSA logo

MEDUSA

AI-first security scanner for LLM, agent, MCP, and RAG codebases

MEDUSA is an AGPL-3.0 AI-first security scanner from Pantheon Security that checks AI and machine-learning applications, LLM agents, MCP workflows, RAG pipelines, repository-poisoning risks, secrets, and agent-specific compromise patterns.

Open Source
iFixAi logo

iFixAi

Open-source diagnostic for AI operational misalignment

iFixAi is an Apache-2.0 diagnostic tool for scoring AI agents and models against operational-misalignment risks such as hallucination, manipulation, sabotage, sandbagging, and oversight evasion.

Open Source
Inspect AI parent UK AISI mark

Inspect AI

UK AI Security Institute framework for LLM safety evaluations

Inspect AI is an MIT-licensed framework from the UK AI Security Institute for running large language model evaluations, including tool use, multi-turn dialogue, model-graded scoring, and reusable evaluation tasks.

Open Source

Used in Stacks

Comparisons

PurpleLlama vs Guardrails AI — Model-Based Safety Classification vs Rule-Based Output Validation

PurpleLlama (Llama Guard) and Guardrails AI both add safety layers to LLM applications, but use fundamentally different approaches. PurpleLlama deploys purpose-trained classifier models for content safety evaluation. Guardrails AI uses composable validators for structured output validation. This comparison clarifies when to use model-based classification versus rule-based validation in your LLM safety strategy.

PurpleLlamaGuardrails AI

FAQ

What is PurpleLlama?

PurpleLlama is Meta's open-source suite of tools for evaluating and improving LLM safety. It includes Llama Guard models for input/output content safety classification, LlamaFirewall for multi-layer defense, CodeShield for insecure code detection, and CyberSecEval benchmarks for measuring LLM security. Llama Guard 4 supports multimodal safety across text and images. 4,100+ GitHub stars, backed by Meta AI with 44+ contributors.

Is PurpleLlama free?

Yes — PurpleLlama is open source and free to use. Free and open-source (custom Meta license)

Is PurpleLlama open source?

Yes — PurpleLlama is open source.

What are the best PurpleLlama alternatives?

The top editor-verified PurpleLlama alternatives are Guardrails AI, NeMo Guardrails, garak.

How does PurpleLlama score in our review?

Our hands-on review scores PurpleLlama 81/100 overall, based on speed, privacy, and developer-experience testing.