← Back to archive

Repo of the Day

microsoft/PyRIT

Published: Dec 2, 2026

Open repository ↗

The Python Risk Identification Tool for generative AI (PyRIT) is an open source framework built to empower security professionals and engineers to proactively identify risks in generative AI systems

Summary

PyRIT (Python Risk Identification Tool for generative AI) is an open-source toolkit for finding security and safety weaknesses in generative AI systems. It combines repeatable command-line scans, adaptive multi-turn attacks, human-led testing, a graphical interface, and an extensible Python framework. The Python project is maintained by Microsoft’s AI Red Team and open-source contributors.

What it is useful for

PyRIT is useful for engineers who need to evaluate generative AI models and applications as part of security or safety testing. For example, a team could run a repeatable scanner against a configured chatbot, explore the system interactively through the CoPyRIT GUI, or build a custom Python workflow for a specific test sequence.

It supports direct connections to targets including OpenAI, Anthropic, Azure OpenAI, Microsoft Foundry, Google Gemini, AWS Bedrock, Hugging Face, Ollama, Groq, OpenRouter, Cohere, and GitHub Copilot. It also supports OpenAI-compatible APIs. Teams testing complete applications rather than isolated models can target HTTP or WebSocket endpoints, automate browser interactions with Playwright, or implement a custom target.

The Python framework is the main extension point. Engineers can compose and extend PyRIT components when a standard scanner or interactive GUI does not fit the required red-teaming workflow. Additional provider integrations can be added through the optional LiteLLM adapter.

How engineers can use it

Start by choosing the interface that matches the work:

  • Scanner: Run repeatable assessments from the command line.
  • CoPyRIT GUI: Explore AI systems interactively and review results in a browser.
  • Python framework: Create custom red-teaming workflows by combining and extending components.

A practical engagement could involve configuring a model or application endpoint, running a repeatable assessment, examining the results, and then adding a Python component for a target-specific or multi-turn scenario. Providers and endpoint types are configured through the documented target and provider-configuration guides.

The supplied README does not include installation commands or a complete API example, so it would be misleading to provide commands here. Use the PyRIT documentation for installation, configuration, demonstrations, and examples, and use its version picker to select documentation matching the installed version.

Two documented limitations are worth noting: available features depend on the selected target and model, and broader provider support may require the optional LiteLLM adapter. The README also notes that the highlighted guides follow the latest development version, which can matter when reproducing an assessment across environments.