PyRIT#

Welcome to the Python Risk Identification Tool for generative AI (PyRIT)! PyRIT is designed to be a flexible and extensible tool that can be used to assess the security and safety issues of generative AI systems in a variety of ways.

Before starting with AI Red Teaming, we recommend reading the following article from Microsoft: “Planning red teaming for large language models (LLMs) and their applications”.

Generative AI systems introduce many categories of risk, which can be difficult to mitigate even with a red teaming plan in place. To quote the article above, “with LLMs, both benign and adversarial usage can produce potentially harmful outputs, which can take many forms, including harmful content such as hate speech, incitement or glorification of violence, or sexual content.” Additionally, a variety of security risks can be introduced by the deployment of an AI system.

Installation Guide#

PyRIT offers flexible installation options to suit different needs. Choose the path that best fits your use case:

Important

Version Compatibility:

  • User installations (Docker, Pip/Conda) install the latest stable release from PyPI

  • Contributor installations (DevContainers, Local Development) use the latest development code from the main branch

  • Always match your notebooks to your PyRIT version - download from the corresponding release branch if using a stable release

For Users - Quick Start

🐋 Docker Installation

Get started immediately with a pre-configured environment:

  • ✅ All dependencies included

  • ✅ No Python setup needed

  • ✅ JupyterLab built-in

  • ✅ Works on all platforms

./setup/1b_install_docker.md

For Users - Custom Setup

🐍 Local Pip/Conda Installation

Install PyRIT directly on your machine:

  • ✅ Full Python environment control

  • ✅ Lighter weight installation

  • ✅ Easy integration with existing workflows

  • ✅ Direct system access

./setup/1a_install_conda.md

For Contributors

🐋 DevContainers in VS Code

Standardized development environment:

  • ✅ Pre-configured VS Code setup

  • ✅ Consistent across all contributors

  • ✅ All extensions pre-installed

  • ✅ Zero configuration needed

./contributing/1b_install_devcontainers.md

For Contributors - Custom Dev Setup

🐍 Local Conda Development

Install from source in editable mode:

  • ✅ Full development control

  • ✅ Use any IDE or editor

  • ✅ Customize environment

  • ✅ Advanced configuration options

./contributing/1a_install_conda.md#local-installation-with-condapython