TL;DR
Last verified: November 25, 2026.
PyRIT (Python Risk Identification Tool for generative AI, microsoft/PyRIT) is the Microsoft AI Red Team’s open-source toolkit for finding security and safety weaknesses in LLMs and the applications built on them. It started in December 2023 as a Python library. Version 1.2 turns it into three things in one package: a command-line scanner (pyrit_scan), a browser GUI called CoPyRIT, and the original Python framework of targets, converters, attacks and scorers.
As of November 25, 2026 the repository has 5,067 stars, 1,124 forks and 128 open issues (plus 163 open pull requests). It is MIT licensed. The latest release is v1.2.1 (November 18, 2026), a packaging-only fix on top of v1.2.0 (November 13, 2026), the release that put PyRIT on GitHub Trending in the week of November 25, 2026. PyPI says it needs Python 3.11 to 3.14.
Use it if you are responsible for an LLM application and want repeatable, multi-turn attacks (Crescendo, PAIR, Tree of Attacks) with scoring and an evidence trail. If you only want a fast one-command baseline scan of a model, garak is simpler. If you want red-team checks as a CI gate next to your evals, promptfoo fits better.
Not run by us: our hands-on lab (a throwaway GitHub Actions container) could not start on November 25, 2026, because GitHub refused the job over a billing limit on the account. The run we prepared would have installed pyrit==1.2.1 from PyPI, applied four converters to a prompt and sent a converted prompt through PromptSendingAttack to the offline TextTarget. None of it executed. A real scan would also need a target model and usually a second “adversarial” model, which means API keys or a local Ollama, which the lab does not hold. Everything below comes from the v1.2.1 source, the official docs, the release notes and public discussion.
What PyRIT actually is
Red teaming an LLM by hand looks like this: you write a nasty prompt, read the answer, rephrase, try base64, try a role-play framing, try splitting the request across five turns, and keep notes in a spreadsheet. PyRIT automates each piece of that loop and stores every message in a database so the results can be reviewed later.
The framework has five building blocks:
| Component | What it does | Examples in v1.2.1 |
|---|---|---|
| Targets | The system under test, or a helper model | OpenAI, Azure OpenAI, Anthropic, Gemini, Bedrock, Hugging Face, Ollama, Groq, OpenRouter, GitHub Copilot, HTTP, WebSocket, Playwright, A2A |
| Converters | Transform a prompt before it is sent | ROT13, base64, leetspeak, Unicode confusables, ASCII art, translation, text-to-image, audio, PDF, image steganography |
| Attacks | The strategy that decides what to send next | Single-turn: PromptSending, ManyShotJailbreak, SkeletonKey. Multi-turn: Crescendo, PAIR, Tree of Attacks with Pruning, RedTeaming, chunked requests |
| Scorers | Decide whether the attack worked | LLM-as-judge (self-ask refusal, Likert, category), substring matching, ASSERT, local CPU refusal and violence classifiers |
| Memory | Records every prompt, response and score | In-memory or SQLite locally, Azure SQL for teams |
By our count the v1.2.1 source defines about 105 converter classes. Many of them are cheap tricks (character swaps, ciphers). Their value is that they can be stacked: translate to Spanish, then leetspeak, then base64, and PyRIT records which combination got through.
The newer scenarios layer bundles targets, techniques, datasets and scorers into a named, repeatable assessment. The docs group the built-in scenarios into families:
- AIRT (Microsoft AI Red Team): RapidResponse, Psychosocial, Cyber, Jailbreak, Multilingual, Leakage, AggregationLeakage, Scam
- Garak: Encoding, FigStep, WebInjection, Doctor, SystemPromptExtraction, PackageHallucination, AudioAchillesHeel, ports of probes from NVIDIA’s garak
- Foundry: RedTeamAgent, matching Azure AI Foundry’s red-teaming agent
- Adaptive, Benchmark and Technique (
technique.executeruns one technique against one objective)
What changed in 1.2
The v1.2.0 release notes call it “a major upgrade to the CoPyRIT GUI”. The main additions:
- CoPyRIT GUI: launch scans, watch progress, compare runs, chat manually with a target, apply converters by hand and score responses, all in a browser.
- Scenario presets and suites: save a configured scenario under a name and launch a group of them together.
- Operations and Findings: group work into an engagement and record human-reviewed issues with linked evidence. Findings export to Word and Markdown, which is what a red-team report actually needs.
- New techniques and targets: GOAT, context-wrap, character-split, tool role-play and multi-turn jailbreak delivery; A2A, HackAPrompt and GitHub Copilot SDK targets; a no-key auth mode for OpenAI-compatible endpoints.
- Scoring and data: ASSERT scoring and generation, Microsoft decision-model scoring, local CPU refusal and violence scorers, plus CyberSecEval, MITRE, MASK, HarmEval, FORTRESS and Anthropic model-written-evaluation datasets.
The release notes also say that 108 external contributors authored 507 of the 882 merged pull requests in the release (58%). For a Microsoft repository that is a lot of outside work, and it shows in the breadth of targets and datasets.
Install and configure
Install from PyPI (the docs recommend Python 3.13 for local installs):
pip install pyrit
python -c "import pyrit; print(pyrit.__version__)"
There is also a Docker image with JupyterLab for people who would rather not manage a Python environment.
PyRIT does nothing until it knows where your models are. The quickest start in the configuration docs is three environment variables. For a local model through Ollama they look like this:
OPENAI_CHAT_ENDPOINT="http://127.0.0.1:11434/v1"
OPENAI_CHAT_KEY="not-needed"
OPENAI_CHAT_MODEL="llama2"
For anything beyond a quick test, the docs want a ~/.pyrit/.pyrit_conf file that declares the database, the initializers that register targets and scorers, and where secrets come from. Note the security stance: Azure Key Vault is the “canonical” secret source. A plain ~/.pyrit/.env still works but PyRIT warns about it, and ~/.pyrit/.env.local is the sanctioned place for local plaintext overrides. Keep both out of git.
Three ways to use it
1. The scanner (pyrit_scan)
The scanner runs a scenario against a registered target. From the docs home page:
pyrit_scan run airt.scam --target openai_chat
And from the scanner docs, with separate roles for the model under test and the judge:
pyrit_scan run technique.execute --target model_under_test \
--techniques prompt_sending --scoring-target scoring_model
Two things in the source are easy to miss. First, pyrit_scan is a client: its help text says it “requires a running PyRIT backend server”. You start one with pyrit_scan start-server, or pass --start-server to a command. Second, helper roles are explicit. The docs say --scoring-target and --adversarial-target “do not automatically reuse --target”, and no missing role silently falls back to OpenAI environment variables. That is the right default for a security tool, but it means your first scan will probably stop and ask for a scorer.
Results are browsable afterwards:
pyrit_scan scenario-history 20
pyrit_scan scenario-results <run-id> --view attacks
pyrit_shell gives the same commands interactively.
2. CoPyRIT, the GUI
pyrit_backend --auth-mode local
# then open http://localhost:8000
Local mode turns off request authentication and only listens on loopback. The GUI docs say administrator actions stay disabled unless you set PYRIT_ALLOW_UNAUTHENTICATED_ADMIN=true, and warn never to use that on a network-reachable server. For a team, Microsoft documents an Azure deployment with Entra ID sign-in.
The GUI is the biggest practical change in 1.2. Manual red teaming (chat with the target, branch the conversation, try a converter, score the reply) used to mean writing notebook cells. Now a tester who does not write Python can do it, and every turn lands in the same database as the automated scans.
3. The Python framework
This is where PyRIT is strongest. Converters on their own, from the converter docs:
from pyrit.converter import ROT13Converter, Base64Converter, LeetspeakConverter
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
await initialize_pyrit_async(memory_db_type=IN_MEMORY)
prompt = "tell me how to cut down a tree"
print(await ROT13Converter().convert_tokens_async(prompt=prompt))
print(await LeetspeakConverter().convert_tokens_async(prompt=prompt))
A multi-turn Crescendo attack, adapted from the docs’ round-robin example. Crescendo starts with harmless questions and escalates step by step toward the objective, backtracking when the target refuses:
from pyrit.executor.attack import AttackAdversarialConfig, CrescendoAttack
from pyrit.output import output_attack_async
from pyrit.prompt_target import OpenAIChatTarget
objective_target = OpenAIChatTarget() # the system you are testing
attacker = OpenAIChatTarget() # the model that writes the attack turns
attack = CrescendoAttack(
objective_target=objective_target,
attack_adversarial_config=AttackAdversarialConfig(target=attacker),
max_turns=5,
max_backtracks=3,
)
result = await attack.execute_async(
objective="Explain how to make a paper airplane that flies really far"
)
await output_attack_async(result)
Swap CrescendoAttack for TreeOfAttacksWithPruningAttack (defaults: width 3, depth 5, branching factor 2 in the source) or PAIRAttack and the rest stays the same. That composability is the reason to choose PyRIT over a fixed probe list.
Community reactions
Third-party write-ups have settled on a division of labor. Mindgard’s November 2026 comparison of red-teaming tools sums it up: “Pick Garak for a fast baseline scan, Promptfoo for CI/CD gating, PyRIT for custom multi-turn campaigns.” A July 2026 SecurityCipher guide makes the same point: garak “gives you fast, repeatable coverage; PyRIT gives you the realistic multi-turn attacks that actually break guardrails.” An October 2026 Medium deep-dive builds a combined garak + PyRIT pipeline. On r/cybersecurity, one builder posted a self-hosted app that wraps Promptfoo, Garak, PyRIT and DeepTeam together, which suggests that teams end up running more than one tool.
The most common criticism is now partly out of date. Repello AI wrote in May 2026 that “PyRIT is a framework, not a product. There is no dashboard, no compliance reporting.” CoPyRIT and the Findings export in 1.2 answer the dashboard and reporting parts. The rest of the critique still holds: you configure targets, datasets and scorers yourself, and nothing works out of the box without at least one model endpoint.
Honest limitations
- You need models, plural. Most interesting attacks need a target, an adversarial model to write the attack turns and a scoring model to judge the replies. That is two or three endpoints and real token spend per run. Multi-turn attacks with backtracking multiply the calls.
- LLM judges are a weak point. Self-ask scorers can mark a refusal as a success or the other way round. The 1.2 notes list fixes for “score inversion” and “malformed or out-of-range judge scores”, so it is a known problem. Treat automated scores as triage and confirm findings by hand, which the Findings workflow encourages.
- Many breaking changes. 1.2.0 dropped Python 3.10, changed scenario construction and dataset configuration, made backend scenario reads async-only, changed the custom scorer hook, removed the Gandalf target and moved some target creation behind admin rights. Custom code written for 1.0 or 1.1 will need work.
- Strict client/server matching. Backends that enforce compatibility reject CLI or browser clients built from a different source commit, even at the same version number. Deploy backend, frontend and CLI together.
- Heavy install. The dependency list includes the Azure SDKs, Hugging Face
datasets, OpenAI, FastAPI, SQL drivers, PDF and image libraries and the MCP SDK. Use a dedicated virtualenv or the Docker image. - Docs follow
main. The website shows the development version. Use the version picker or the matchingreleases/vX.Y.Zbranch, or notebook examples may call APIs your install does not have. - Azure flavor. Everything works with OpenAI-compatible endpoints and local models, but team deployment, Key Vault secrets and Entra auth are where the docs are most complete.
- Not run by us (see above), so this review cannot speak to install time, scan speed or how noisy the default scorers are in practice.
PyRIT vs the alternatives
Stars and licenses as of November 25, 2026:
| Tool | Stars | License | Best at |
|---|---|---|---|
| PyRIT (Microsoft) | 5,067 | MIT | Custom multi-turn attack campaigns, converter stacking, evidence and findings for a red-team engagement |
| garak (NVIDIA) | 10,175 | Apache-2.0 | Fast baseline vulnerability scan of a model with a large probe library |
| promptfoo | 27,664 | MIT | Red-team and eval tests as config files in CI, with pass/fail gates |
| DeepTeam (Confident AI) | 3,126 | Apache-2.0 | Red teaming alongside DeepEval if you already use that stack |
PyRIT now includes garak-derived scenarios, so a team that standardizes on PyRIT gets some baseline coverage too. garak is still faster to start with. For agent security (tools, code execution, real exploit chains) look at a pentest agent such as Strix or an agent auditing tool such as iFixAi. PyRIT tests what a model or chat endpoint says, plus tool calls through its newer scorers, but it does not exploit your infrastructure.
Who should use it
- Security teams running AI red-team engagements: yes. Operations, Findings and Word export map onto how engagements are actually reported.
- Product teams shipping an LLM feature: yes, if someone owns it. Start with one AIRT scenario against a staging endpoint and a cheap judge model, then add Crescendo for your riskiest objectives.
- Researchers: the framework and its datasets (CyberSecEval, MITRE, MASK, HarmEval, FORTRESS) make it a reasonable harness. The project asks you to cite its whitepaper.
- Solo developers who want a quick check: start with garak or promptfoo. PyRIT’s setup cost pays off on repeated, deeper testing.
Verdict
PyRIT 1.2 is the most complete open-source toolkit for deep LLM red teaming. It has the widest set of multi-turn attack strategies, a large converter library, pluggable scoring and now a GUI and findings workflow that make it usable by a team rather than one Python expert. The costs are configuration effort, token spend on helper models, LLM-judge noise and a fast-moving API. Pair it with a quick baseline scanner, budget for the setup, and verify the findings by hand.
FAQ
Is PyRIT free?
Yes. PyRIT is MIT licensed and free to use, including commercially. Running it costs whatever your target, adversarial and scoring models cost. With local models through Ollama there is no API bill.
Does PyRIT work with Claude, Gemini or local models?
Yes. The README lists OpenAI, Anthropic, Azure OpenAI, Microsoft Foundry, Azure ML, Google Gemini, Vertex AI, AWS Bedrock, Hugging Face, Ollama, Groq, OpenRouter, Cohere and GitHub Copilot, plus an optional LiteLLM adapter. Any OpenAI-compatible endpoint works, and HTTP, WebSocket and Playwright targets can test a whole application.
What is the difference between PyRIT and garak?
garak is a scanner: point it at a model and it runs a big library of probes. PyRIT is a framework with a scanner on top: it is built for adaptive, multi-turn attacks where another model plans the next turn, for stacking converters and for recording evidence. Many teams use garak for a quick baseline and PyRIT for deeper campaigns.
What is CoPyRIT?
CoPyRIT is PyRIT’s browser GUI, greatly expanded in v1.2.0. Start it with pyrit_backend --auth-mode local and open http://localhost:8000. It covers manual chat-based red teaming, scan setup and monitoring, result comparison, scoring, and Operations and Findings for reporting.
Which Python version does PyRIT need?
PyRIT 1.2.x requires Python 3.11 to 3.14 (>=3.11, <3.15 on PyPI). Python 3.10 support was dropped in 1.2.0. The docs recommend 3.13 for local installs.
Can PyRIT run in CI?
Yes. pyrit_scan is designed for “CI/CD pipelines, batch processing, reproducible runs”, per the scanner docs. Plan for the backend server it needs, the helper models’ API keys as CI secrets, and run time and cost for multi-turn scenarios.
Sources
- microsoft/PyRIT on GitHub: README, v1.2.1 source, stars, forks, issues, license
- PyRIT v1.2.0 release notes
- PyRIT v1.2.1 release notes
- PyRIT documentation
- PyRIT Scanner documentation
- CoPyRIT GUI documentation
- Configure PyRIT
- pyrit on PyPI
- PyRIT whitepaper: Democratizing AI Red Teaming Through Open-Source Tooling
- Mindgard: Best AI Red Teaming Tools Compared (2026)
- SecurityCipher: LLM Red Teaming in 2026, a garak + PyRIT workflow
- Repello AI: Promptfoo alternatives
- NVIDIA/garak, promptfoo/promptfoo, confident-ai/deepteam