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.0

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.0
File Size Uploaded Provenance Actions
pyrit-1.2.0.tar.gz 17.5 MB Without provenance Details for pyrit-1.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 36.4 MB

Release files / pyrit-1.2.0.tar.gz

Download URL pyrit-1.2.0.tar.gz
Size 17.5 MB
Tags Source
SHA-256 checksum
How to use checksums
4a9661c9fb6d44c01bc50104bec72b37e66dc2f131eb31eddfd684c8ed0b48c0
BLAKE2b-256 checksum
How to use checksums
043766aa006c95e359b33a9b88310b1bdbd2fae50574c1a680150b7f1195d490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL pyrit-1.2.0-py3-none-any.whl
Size 18.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fabee89a334b3d2ee91eabe2e6b15b4f605e8b643213e89c928302b6b719e8e4
BLAKE2b-256 checksum
How to use checksums
b2637876f9d05348b5463e5a2ca06ceb8435d2d44b1061246c3c6638b000f7cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for pyrit 1.2.0

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