Red-Team Tooling — Garak, Llama Guard, PyRIT
Three production tools cover the 2026 red-team stack. Llama Guard (Meta) is a Llama-3.1-8B classifier fine-tuned on 14 MLCommons hazard categories, and the 2025 Llama Guard 4 is a 12B natively multimodal classifier pruned from Llama 4 Scout. Garak (NVIDIA) is an open-source LLM vulnerability scanner with static, dynamic, and adaptive probes for hallucination, data leakage, prompt injection, toxicity, and jailbreaks. PyRIT (Microsoft) runs multi-turn red-team campaigns with Crescendo, TAP, and custom converter chains. Llama Guard 3 is documented in Meta's "Llama 3 Herd of Models" (arXiv:2407.21783), Llama Guard 3-1B-INT4 in arXiv:2411.17713, and Garak's probe architecture in github.com/NVIDIA/garak. Together they are the production interface between red-team research (Lessons 12-15) and deployment (Lesson 17+).
Learning Objectives
- Describe Llama Guard 3/4's position in the safety stack: input classifier, output classifier, or both.
- Name the 14 MLCommons hazard categories and state one non-obvious one (Code Interpreter Abuse).
- Describe Garak's probe architecture: probes, detectors, harnesses.
- Describe PyRIT's multi-turn campaign structure and how it composes with Garak probes.
The Problem
Lessons 12-15 cover the attack surface. A production deployment needs evaluation you can repeat and scale, and three tools dominate in 2026: Llama Guard (the defense classifier), Garak (the scanner), and PyRIT (the campaign orchestrator). Each one targets a different layer of the red-team lifecycle.
The Concept
Llama Guard (Meta)
Llama Guard 3 is a Llama-3.1-8B model fine-tuned for input and output classification over the MLCommons AILuminate 14 categories:
- Violent crimes, non-violent crimes, sex-related, CSAM, defamation
- Specialized advice, privacy, IP, indiscriminate weapons, hate
- Suicide/self-harm, sexual content, elections, code-interpreter abuse
It supports 8 languages. You can place it before the LLM (input moderation), after the LLM (output moderation), or on both sides. The two uses see different training distributions, and Llama Guard 3 ships as a single model that handles both.
Llama Guard 3-1B-INT4 (arXiv:2411.17713, 440MB, ~30 tokens/s on mobile CPU) is the quantized edge variant.
Llama Guard 4 (April 2025) is 12B, natively multimodal, and pruned from Llama 4 Scout. It replaces both the 8B text and 11B vision predecessors with one classifier that ingests text and images.
Garak (NVIDIA)
Garak is an open-source vulnerability scanner. Its architecture has three parts:
- Probes. Attack generators for hallucination, data leakage, prompt injection, toxicity, and jailbreaks. They come in three kinds: static (fixed prompts), dynamic (generated prompts), and adaptive (responds to target output).
- Detectors. Score outputs against expected failure modes: toxic, leaked, jailbroken.
- Harnesses. Manage probe-detector pairs, run campaigns, and generate reports.
TrustyAI integrates Garak with the Llama-Stack shields (Prompt-Guard-86M as the input classifier, Llama-Guard-3-8B as the output classifier) for end-to-end evaluation of a shielded target. Tier-based scoring (TBSA) replaces binary pass/fail, so a model can pass at severity tier 3 and fail at severity tier 5 on the same probe.
PyRIT (Microsoft)
PyRIT is the Python Risk Identification Toolkit, built for multi-turn red-team campaigns. It has three building blocks:
- Converters. Transform a seed prompt by paraphrasing, encoding, translating, or wrapping it in a roleplay.
- Orchestrators. Run the campaign: Crescendo (escalation), TAP (branching), RedTeaming (custom loop).
- Scoring. LLM-as-judge or classifier-as-judge.
PyRIT is the heavier cousin of Garak. Garak runs thousands of single-turn probes, while PyRIT runs deep multi-turn campaigns aimed at specific failure modes.
The stack
Put Llama Guard on both sides of the model, run Garak nightly for regression, and run PyRIT for pre-release campaigns. That is the 2026 default configuration for most production deployments.
Evaluation pitfalls
- Judge identity. Each of the three tools can use an LLM judge, and judge calibration drives the reported ASRs (Lesson 12). Name the judge alongside the tool.
- Probe staleness. Garak probes age as models get patched against them. Adaptive probes (PAIR-shaped) age more slowly than static ones.
- Llama Guard FPR on benign content. Early Llama Guard versions over-flagged political and LGBTQ+ content. The Llama Guard 3/4 calibrations are better, but they are not tuned per deployment.
Where this fits in Phase 18
Lessons 12-15 are the attack families. Lesson 16 is the production tooling. Lesson 17 (WMDP) is the evaluation for dual-use capability. Lesson 18 covers the frontier safety frameworks that wrap these tools in a policy structure.
Use It
code/main.py builds a toy Llama Guard-style classifier (keyword triggers scored over the 14 categories), a toy Garak harness (a probe-detector loop), and a PyRIT-style converter chain. Run the three against a mock target and compare what each one covers.
Ship It
This lesson produces outputs/skill-red-team-stack.md. Given a deployment description, it names which of the three tools fit, what to configure in each, and what regression cadence to run.
I'd run main.py first and read the three sections of output side by side. The classifier flags the direct bomb and self-harm inputs, the Garak-style scan blocks four of its five probes, and the converter chain breaks the target at its third turn. The whole thing is stdlib Python with a fixed seed, so your output should match what you read here.
The most useful detail is the encoded_weapon probe. It swaps letters for digits (expl0sive), and the toy classifier misses it because it matches substrings, so the scan reports it as passed and undetected. The PyRIT-style chain gets through the same way: the paraphrase turn still contains bomb and gets refused, but the encode turn turns it into b0mb and the target answers. Exercise 2 is a good way to see this, since a base64 probe would slip past in the same manner.
Keep the toy in proportion. Only 6 of the 14 categories have triggers in CATEGORY_TRIGGERS, so the other 8 stay at zero, and the "multi-turn" campaign sends each converted payload as its own independent prompt with no conversation state. I'd treat it as a diagram of where each tool sits, not a measurement of any of them. For real numbers I'd put a trained classifier in front of Garak's probes and pick the judge before comparing any attack success rates.
Exercises
-
Run
code/main.py. Compare the Llama-Guard-style classifier's detection rate on single-turn vs multi-turn attacks. -
Implement a new Garak probe: a base64-encoded harmful request. Measure its detection by the Llama-Guard-style classifier.
-
Extend the PyRIT-style converter chain with a "translate to French, then paraphrase" converter. Re-measure attack success.
-
Read Llama Guard 3's hazard-category list. Identify two categories where the training data would realistically produce high false-positive rates on legitimate developer content.
-
Compare Garak and PyRIT's design principles. Argue for a deployment where each is the right tool.
Key Terms
| Term | What people say | What it actually means |
|---|---|---|
| Llama Guard | "the classifier" | Fine-tuned Llama-3.1-8B/4-12B safety classifier with 14 hazard categories |
| Garak | "the scanner" | NVIDIA open-source vulnerability scanner; probes, detectors, harnesses |
| PyRIT | "the campaign tool" | Microsoft multi-turn red-team orchestrator; converters, orchestrators, scoring |
| Prompt-Guard | "the small classifier" | Meta's 86M prompt-injection classifier, paired with Llama Guard |
| TBSA | "tier-based scoring" | Garak's tier-based pass/fail replacing binary outcomes |
| Converter chain | "paraphrase + encode + ..." | PyRIT composition primitive for building multi-step attacks |
| MLCommons hazard categories | "the 14 taxonomies" | Industry-standard taxonomy Llama Guard targets |
Further Reading
- Meta, Llama Guard 3 (in Llama 3 Herd paper, arXiv:2407.21783): the 8B classifier
- Meta, Llama Guard 3-1B-INT4 (arXiv:2411.17713): quantized mobile classifier
- NVIDIA Garak, GitHub: the scanner repo and documentation
- Microsoft PyRIT, GitHub: the campaign toolkit
Code
- main.py (python, 161 lines)