microsoft/PyRIT
OPEN SOURCE RED TEAMING TOOLKIT FOR AI
Open-source toolkit from Microsoft for finding security and safety vulnerabilities in generative AI systems. Automates scanning, adaptive multi-turn attacks, and manual testing via CLI, web interface, and Python framework.
// KEY FEATURES
- CLI scanner for repeatable security assessments
- CoPyRIT GUI — web interface for interactive testing
- Support for 15+ providers: OpenAI, Anthropic, Azure, Gemini, Ollama, etc.
- Extensible Python framework for custom workflows
// DEEP DIVE: HOW IT WORKS
PyRIT combines three interfaces: command line for reproducible scans, CoPyRIT GUI web interface for interactive exploration, and a Python framework for building custom pipelines. Components — targets (models and endpoints), attacks (jailbreak, prompt injection, data extraction strategies), scorers (result evaluation), and memory (logging) — are combined declaratively. The tool does not require Microsoft cloud infrastructure and runs locally.
Differs from alternatives (Garak, PromptFoo, Vigil) with built-in support for multi-turn adaptive attacks where the next iteration depends on the previous model response, and a wide native target list: OpenAI, Anthropic, Azure OpenAI, Google Gemini/Vertex, AWS Bedrock, Hugging Face, Ollama, Groq, OpenRouter, Cohere, GitHub Copilot. Via LiteLLM and custom HTTP/WebSocket/Playwright targets, any compatible APIs and web applications can be connected. Includes a whitepaper describing methodology and Microsoft AI Red Team experience.
Requires Python 3.10+ and API keys for used providers. Local models run via Ollama or Hugging Face. Playwright targets require a browser. Windows, macOS, Linux are supported. Vulnerabilities are reported through Microsoft Security Response Center. Documentation is versioned; current guides are on the project website.
// USE CASES
Best for: Security engineers and ML engineers for auditing generative AI systems
- Automate LLM checks for jailbreaks and data leaks via CLI scanner
- Interactively explore model behavior in CoPyRIT GUI web interface
- Build custom attack chains in Python for testing production applications
New repositories every 30 minutes
REDDYX AI scans GitHub 24/7 and ships the best AI/ML/Web3 projects to Telegram.
Join on Telegram