Skip to content

Back to the catalog

meta-llama/PurpleLlama
github.comrepo

meta-llama/PurpleLlama

Purple Llama is Meta's umbrella repo of tools and evals for building safely with generative AI, bundling Llama Guard (input/output content moderation fine-tuned on Llama 3.1/3.2), Prompt Guard (detects prompt injection and jailbreak attempts), Code Shield (inference-time filtering of insecure LLM-generated code and code-interpreter abuse prevention), and the CyberSec Eval benchmark suite (CWE/MITRE ATT&CK-based tests now spanning insecure code generation, offensive cyber capability, spear-phishing, and visual prompt injection). It matters as one of the first industry-wide, MIT-licensed benchmark and safeguard sets specifically for LLM cybersecurity risk.

TL;DR Meta's Purple Llama bundles Llama Guard, Prompt Guard, Code Shield, and CyberSec Eval benchmarks for evaluating and safeguarding LLMs against prompt injection, jailbreaks, and insecure code generation.
Document

What it is

Purple Llama is Meta's umbrella project for safety tooling around open generative AI models. It combines safeguards (Llama Guard 3, Prompt Guard, Code Shield) with the CyberSec Eval benchmark suite. Meta frames it as purple teaming: red-team evals plus blue-team defences.

Licensing split

The catalog summary calls the whole set MIT-licensed, but the page splits it. Evals and benchmarks are MIT. Any models, such as Llama Guard, fall under the corresponding Llama Community license. An engineer shipping a commercial product should read that license for the guard models before adopting them.

What each piece adds

  • Llama Guard 3: input and output moderation models fine-tuned from Meta-Llama 3.1 and 3.2. They target the MLCommons standard hazards taxonomy. The 3.2-based release supports 7 new languages, a 128k context window and image reasoning. They are also tuned to flag helpful cyberattack responses and to stop malicious code from being executed in code-interpreter hosting environments.
  • Prompt Guard: separates two attack classes. Prompt injection is untrusted third-party data in the context window that makes the model run unintended instructions. Jailbreaks are instructions meant to override the model's built-in safety features.
  • Code Shield: filters insecure LLM code at inference time. The page lists three uses: insecure code suggestion mitigation, code interpreter abuse prevention and secure command execution. An example notebook is linked.

CyberSec Eval versions

  • v1: insecure code suggestion frequency and compliance with malicious requests, based on CWE and MITRE ATT&CK.
  • v2: adds code interpreter abuse, offensive cyber capability and prompt injection susceptibility.
  • v3: adds visual prompt injection, spear phishing capability and autonomous offensive cyber operations.

A Hugging Face leaderboard is linked for comparing models.

What to do

Meta recommends checking all LLM inputs and outputs against content guidelines suited to the application, citing Llama 3's Responsible Use Guide. Getting-started resources for the safeguards are in the Llama-recipes GitHub repository, as part of a safety layer in the Llama reference system.

Caveats

The page gives no install commands, thresholds or benchmark scores. Meta's only stated result is that its initial evals found meaningful risks, both in recommending insecure code and in complying with malicious requests. Details are in the CyberSec Eval and Llama Guard papers.

Organisations named here

  • CyberSec Eval

Technologies named here

  • Meta-Llama 3.1
  • Llama Guard 3
  • Meta-Llama 3.2
  • Prompt Guard
  • Code Shield
  • Llama 3
  • CyberSec Eval v1
  • CyberSecEval2
  • CyberSecEval 3
  • Llama-recipe GitHub repository
  • LLaMa
  • Hugging Face
  • MITRE ATT&CK
  • Llama Guard

Techniques named here

  • Prompt Injection
  • Jailbreaking
  • Code interpreter abuse
  • Visual prompt injection
  • Spear phishing capability
  • Autonomous offensive cyber operations