Red-team tooling: garak, PyRIT, promptfoo and MITRE ATLAS
The open-source tools practitioners use to attack LLM applications at scale: garak for broad model scanning, promptfoo for app-level red-teaming in CI, PyRIT for scripted multi-turn campaigns, and MITRE ATLAS for describing findings in a shared language. When to use each, how to point them at your own app, and how to read their results without fooling yourself.
By Sandip Maity, Applied AI Engineer
The red-team lab had you write your own attack harness, which is the best way to understand what these tools do. In practice you combine your own app-specific tests with open-source tools that bring thousands of known attacks, attack generators and graders. This lesson covers the four you will hear about most, how to point them at your application rather than a bare model, and how to read their results honestly.
#Which tool for which job
| Tool | From | Best at | Target |
|---|---|---|---|
| garak | NVIDIA (open source) | Broad scanning of a model or endpoint with many probe families: injection, jailbreaks, encoding tricks, data leakage, toxicity, package hallucination | A model or an HTTP endpoint |
| promptfoo (red-team mode) | Open source, with a commercial cloud | App-level red-teaming from a description of your app's purpose; plugins for agent risks (excessive agency, access control, SSRF, SQL injection); CI integration and reports | Your app, through a provider (HTTP, Python, JS) |
| PyRIT | Microsoft (open source) | Scripted, multi-turn campaigns where one model attacks another, with converters (encodings, translations) and scorers | Any target you wrap in code |
| MITRE ATLAS | MITRE | Shared names for adversary tactics and techniques against AI systems, with case studies | Your report, not your app |
A typical programme uses garak once per model choice, promptfoo in CI against the application, PyRIT or hand-written scripts for deep multi-turn scenarios, and ATLAS IDs in every report.
Scope. Run these only against systems you own or are authorised to test, with fake data. Many tools also call a hosted model to generate or grade attacks: check what data leaves your environment and use a local model for that role if needed.
#garak: scan the model
garak sends probes (attack prompts grouped by family) to a generator (the thing being tested) and runs detectors on the responses. It is most useful when choosing or upgrading a model: it tells you how a model behaves against known attack families before you build on it.
python3 -m venv .venv && source .venv/bin/activate
pip install garak
python -m garak --list_probes | head -40
python -m garak --target_type ollama --target_name llama3.1:8b \
--probes promptinject,encoding,dan --report_prefix llama31-baselineOlder garak versions call the options --model_type and --model_name; run python -m garak --help to see which yours uses. garak can also test any HTTP endpoint through its REST generator with a small JSON config, which is how you scan your own API rather than the model behind it.
The run writes a JSONL report and an HTML summary with a pass rate per probe and detector. Read it as: "against this family of known attacks, this model failed N% of the time". Then open the report and read actual failing prompts and responses: detectors are heuristics and misfire both ways.
Pro content
Keep reading with Inference Academy Pro
Unlock the rest of this lesson, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.
Still to come in this lesson
- promptfoo: red-team the application
- PyRIT: scripted multi-turn campaigns
- MITRE ATLAS: a shared language for findings
- Reading results without fooling yourself
- A practical setup
- Common mistakes
- Exercises
You will be able to answer
- You want to know whether your RAG support bot leaks other customers' data. Which target should the tool attack?
- A scanner reports a 3% attack success rate on 100 attempts. What should you do before acting on it?
- What is MITRE ATLAS mainly used for in a red-team report?
- Why should automated red-teaming complement, not replace, manual testing?
- Where does a promptfoo red-team run fit best in a delivery pipeline?