AI red teaming & LLM evaluation

PyRIT: open-source generative AI red teaming framework

PyRIT is an open-source generative AI red teaming framework from Microsoft. It is released under the MIT license and is offered as: Library, CLI, Self-hosted.

  • Last reviewed

Best for

Security engineers who want a free Python framework for building multi-turn red teaming runs against models and web apps

Consider instead if

  • You want a command-line scanner with a ready-made probe library instead of a framework to build on. See garak.
  • You need an inline filter that screens live traffic instead of a testing framework. See NeMo Guardrails.

What PyRIT does

PyRIT, the Python Risk Identification Tool, is an open-source framework from Microsoft for red teaming generative AI systems. Its docs describe it as a framework for automated and human-led red teaming. You write Python, or use the pyrit_scan command-line scanner, to run single-turn and multi-turn attacks against targets such as OpenAI, Azure, Anthropic, Google and Hugging Face models, custom HTTP endpoints and web apps. Scorers judge the responses, and results are stored in SQLite or Azure SQL. A local web app called CoPyRIT is also available. The code is MIT licensed and free to use. PyRIT is a framework you build tests with, not an inline filter for live traffic.

This summary is our own wording of the sourced facts on this page.

Key facts

Each value links to the page that states it, with the date we checked it.

Attestations or disclosure
Vulnerability reports go through MSRC under Coordinated Vulnerability Disclosure Source, checked October 21, 2026: github.com (opens in a new tab)

Capabilities

As documented by the vendor or project. The tag is our label from a controlled vocabulary.

Integrations

Where PyRIT fits in our AI security layers

Our analysis

Our editorial model, not a standard. The primary layer follows the category, except for tools whose main documented job is detection and response; other layers rest on a capability the sources document. How the model works.

AI security layers that PyRIT covers, with the role, how each applies and what it rests on
LayerRoleHow it appliesBased on
L4 Testing Testing and red teaming Primary Attack and evaluate models, apps and agents on purpose, before release and after every change, to find what the other layers miss. Follows its category, AI red teaming & LLM evaluation

OWASP LLM Top 10 mapping

Our analysis

The risk list is OWASP's (Top 10 for LLM Applications, 2025). The mapping is our analysis, and each row rests on a capability the sources document.

OWASP LLM risks mapped to PyRIT, with the capabilities each mapping rests on
RiskHow it appliesBased on
LLM01 Prompt Injection Ships a Jailbreak scenario that tests a model against jailbreak templates. Includes a Jailbreak scenario that tests how vulnerable a model is to jailbreak templates
LLM02 Sensitive Information Disclosure Ships scenarios that cover data leakage against a target system. Includes standardized scenarios that cover data leakage, content harms and psychosocial risks

Alternatives and related tools

More in AI red teaming & LLM evaluation, ranked within the category by Coverage Score.

garak

NVIDIA

Open sourceApache-2.0
  • CLI
  • Library
  • Self-hosted

Probes language models and LLM apps for prompt injection, jailbreaks, data leakage and more.

Best for: Teams that want a free command-line scanner they can point at any model or LLM endpoint before release

Coverage Score 82 out of 100
  • LLM01 Prompt Injection
  • LLM02 Sensitive Information Disclosure
  • LLM09 Misinformation

Reviewed

Giskard

Giskard AI

Open sourceApache-2.0 Freemium
  • Library
  • Self-hosted
  • SaaS
  • On-prem

Generates adversarial test suites for LLM agents and RAG apps, runs them and reports failures by threat type.

Best for: Python teams that want a free library to scan an LLM agent or RAG app for prompt injection and harmful output, and to write pass or fail checks for it

Coverage Score 81 out of 100
  • LLM01 Prompt Injection
  • LLM02 Sensitive Information Disclosure
  • LLM09 Misinformation

Reviewed

Promptfoo

OpenAI (Promptfoo)

Open sourceMIT Freemium
  • CLI
  • Library
  • Self-hosted
  • SaaS
  • On-prem

Runs evals and red team scans against LLM apps from a CLI or CI pipeline and writes a vulnerability report.

Best for: Developer teams that want one open-source CLI for both prompt evals and red teaming, run locally and in CI

Coverage Score 80 out of 100
  • LLM01 Prompt Injection
  • LLM02 Sensitive Information Disclosure
  • LLM09 Misinformation

Reviewed

Head-to-head comparisons

PyRIT FAQ

Is PyRIT open source?

Yes. PyRIT is released under the MIT License, and the code is on GitHub at microsoft/PyRIT.

What can PyRIT target?

The docs list OpenAI, Azure, Anthropic, Google and Hugging Face targets, custom HTTP endpoints and WebSockets, and web apps through Playwright.

How does PyRIT store results?

The docs list SQLite and Azure SQL as memory backends, and scorers that use LLMs, Azure AI Content Safety or custom logic.

Key facts you can cite

We have no commercial relationship with Microsoft.

Sources & last reviewed

Last reviewed . We compile from the vendors' own public pages and repositories and we do not run the products. Source links open in a new tab. Found a mistake? Report a correction.