The three best known open source LLM red teaming tools are garak, promptfoo and PyRIT. All three send adversarial inputs to a model or app and check the responses, but they're built for different jobs: garak scans models, promptfoo tests applications with a config file, and PyRIT is a Python framework for building your own attacks.
Everything below comes from each project's own docs. We haven't run a head-to-head comparison, so there's no winner here, just what each tool is for.
garak: a scanner for models
garak stands for Generative AI Red-teaming and Assessment Kit. Its README compares it to nmap or Metasploit, but for LLMs (garak README). It's maintained under NVIDIA's GitHub and licensed Apache 2.0.
It's built from plugins:
- Probes generate the adversarial inputs.
- Detectors decide whether a response shows a failure.
- Generators connect to the model you're testing.
- Harnesses organize the run, and evaluators report results.
You install it with pip and point it at a target from the command line. The README lists Hugging Face, OpenAI, Bedrock, NVIDIA NIM, LiteLLM and generic REST endpoints among supported targets. There's a promptinject probe family for prompt injection specifically. Each run writes a JSONL report and a hit log of the attempts that worked, with a pass or fail rate per detector.
Good fit: you want a broad sweep of a model or endpoint for many failure types at once.
promptfoo: tests for your app
promptfoo calls itself open source and focuses on testing the application, not just the model (promptfoo docs). It breaks failure modes into plugins, which generate hostile inputs for a risk area, and strategies, which wrap those inputs in attack patterns.
The quickstart flow is short (promptfoo quickstart):
npx promptfoo@latest redteam setup # web UI that builds your config
npx promptfoo@latest redteam run # generate attacks and run them
npx promptfoo@latest redteam report # review failures
Your settings live in promptfooconfig.yaml, and generated test cases are saved to redteam.yaml. Because it's config driven, it fits neatly into CI. We cover that in Automated Prompt Injection Testing in CI.
Good fit: you have a chatbot, RAG app or agent and want repeatable tests you can rerun on every change.
PyRIT: a framework for red teamers
PyRIT, the Python Risk Identification Tool, came out of the Microsoft AI Red Team in February 2024 (Microsoft Security blog). Its current docs describe three ways to use it: a command line scanner, a web GUI, and a Python framework (PyRIT docs).
The main building blocks are:
- Targets, which connect to model APIs, HTTP or WebSocket endpoints, or web apps through Playwright.
- Converters, which transform prompts.
- Scorers, which judge responses with an LLM, a classifier or your own logic.
- Attacks, single turn or multi turn.
- Memory, which stores conversations and scores in SQLite or Azure SQL.
Microsoft is clear about its role: "PyRIT is not a replacement for manual red teaming of generative AI systems." It automates the routine parts so a human can focus on strategy.
Good fit: a security team that wants to script multi turn attacks and keep a record of every conversation.
Side by side
| garak | promptfoo | PyRIT | |
|---|---|---|---|
| Main unit | Probes and detectors | Plugins and strategies | Targets, converters, scorers |
| How you drive it | CLI | CLI plus YAML config | CLI, GUI or Python |
| Install | pip | npx, npm or brew | pip |
| Output | JSONL report, hit log | Web report, JSON, JUnit | Stored in a database |
Which one to start with
- Testing a raw model or endpoint for many issues at once: start with garak.
- Testing your own app in CI: start with promptfoo.
- Building custom, multi step attacks as a red team: start with PyRIT.
Whatever you pick, keep the tests harmless. A test that asks the model to print a marker word tells you just as much as a damaging one, and it can't hurt anyone if it leaks into logs or reports. Our canary payloads work that way, and they're a quick manual check before you set up any tool. For the bigger picture of planning a red team exercise, read the LLM Red Teaming Guide.