Skip to main content

PyRIT: AI red teaming for models and applications

Code contributors PRs merged Issues closed

PyRIT (Python Risk Identification Tool for generative AI) is an open-source toolkit for finding security and safety weaknesses in generative AI systems through automated scans, adaptive multi-turn attacks, and human-led testing.

Built by the Microsoft AI Red Team and an open-source community of contributors, PyRIT brings a command-line scanner, a graphical interface, and an extensible Python framework together in one toolkit.

You do not need to be a Microsoft employee or an experienced red teamer to get involved. Join our Discord community to ask questions, exchange techniques, share what you are building, and connect with maintainers and other users.

Contributions include code, documentation, examples, bug reports, testing, and feedback from real-world use. Read the contributor guide and explore issues labeled "help wanted".

Get started | Join Discord | Read the whitepaper

Explore PyRIT

  • Scanner: Run repeatable assessments from the command line.
  • CoPyRIT GUI: Explore AI systems interactively and review results in your browser.
  • Python framework: Compose and extend components to build custom red teaming workflows.

Visit our website for installation, configuration, demos, and documentation. Use the version picker to match the docs to your installation; the guides above follow the latest development version.

Models and systems

Connect to OpenAI, Anthropic, Azure OpenAI, Microsoft Foundry, Azure Machine Learning, Google Gemini, Google Vertex AI, AWS Bedrock, Hugging Face, Ollama, Groq, OpenRouter, Cohere, and GitHub Copilot.

Use OpenAI-compatible APIs or built-in targets, or install the optional LiteLLM adapter for additional provider integrations. See the provider configuration guide and LiteLLM provider directory for setup and more providers. Available features depend on the target and model.

Test complete applications and other endpoints through HTTP, WebSockets, browser automation with Playwright, or custom targets.

Research and citation

Read PyRIT: Democratizing AI Red Teaming Through Open-Source Tooling for the design principles and real-world experience behind the toolkit. If you use PyRIT in your research, please cite the paper using CITATION.cff.

Security

To report vulnerabilities in PyRIT privately through the Microsoft Security Response Center, follow our security policy.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Metadata

Release files for pyrit 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrit 1.2.1
File Size Uploaded Provenance Actions
pyrit-1.2.1.tar.gz 17.4 MB Without provenance Details for pyrit-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrit 1.2.1
File Interpreter ABI Platform Actions
pyrit-1.2.1-py3-none-any.whl Python 3 none any Details for pyrit-1.2.1-py3-none-any.whl

Total release size: 36.1 MB

Release files / pyrit-1.2.1.tar.gz

Download URL pyrit-1.2.1.tar.gz
Size 17.4 MB
Tags Source
SHA-256 checksum
How to use checksums
52cbd9b68021b68a8fe1fef86a7606a066c4627cd2d24c28308316e6bd7fa3d5
BLAKE2b-256 checksum
How to use checksums
6dc9de2afe82cbc38ffbb10b1ff77560b89abd32c203fa990dbd1d2cf93d1b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / pyrit-1.2.1-py3-none-any.whl

Download URL pyrit-1.2.1-py3-none-any.whl
Size 18.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4e404c415257d412bf2017beae42d6e116ebcd90cb32f5b1ef9394367ce2806a
BLAKE2b-256 checksum
How to use checksums
58e6b7a11ab5b79f292509924969fbbf19f8ead5362175979dd1c5055b3de8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Security for pyrit 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page