
PyRIT
Python Risk Identification Tool¶
Automated and human-led AI red teaming — a flexible, extensible framework for assessing the security and safety of generative AI systems at scale.
What PyRIT Offers
Key Capabilities¶
🎯 Automated Red Teaming
Run multi-turn attack strategies like Crescendo, TAP, and Skeleton Key against AI systems with minimal setup. Single-turn and multi-turn attacks supported out of the box.
📦 Scenario Framework
Run standardized evaluation scenarios at large scale — covering content harms, psychosocial risks, data leakage, and more. Compose strategies and datasets for repeatable, comprehensive assessments across hundreds of objectives.
🖥️ CoPyRIT
A graphical user interface for human-led red teaming. Interact with AI systems directly, track findings, and collaborate with your team — all from a modern web UI.
🔌 Any Target
Test OpenAI, Azure, Anthropic, Google, HuggingFace, custom HTTP endpoints or WebSockets, web app targets with Playwright, or build your own with a simple interface.
💾 Built-in Memory
Track all conversations, scores, and attack results with SQLite or Azure SQL. Export, analyze, and share results with your team.
📊 Flexible Scoring
Evaluate AI responses with true/false, Likert scale, classification, and custom scorers — powered by LLMs, Azure AI Content Safety, or your own logic.
Getting Started¶
Getting PyRIT running takes two steps: install the package, then configure your AI endpoints. For the path that’s right for you, see the Getting Started guide.
Step 1: Install¶
PyRIT offers flexible installation options to suit different needs. Choose the path that best fits your use case.
Quick Start ⭐
Get started immediately with a pre-configured environment:
✅ All dependencies included
✅ No Python setup needed
✅ JupyterLab built-in
✅ Works on all platforms
Custom Setup
Install PyRIT directly on your machine:
✅ Pip, uv, or conda
✅ Full Python environment control
✅ Easy integration with existing workflows
Recommended for Contributors ⭐
Pre-configured Docker container with VS Code:
✅ Consistent across all contributors
✅ All extensions pre-installed
✅ One-click setup
Custom Dev Setup
Install from source in editable mode:
✅ Full development control
✅ Use any IDE or editor
✅ Customize environment
Step 2: Configure¶
After installing, configure PyRIT with your AI endpoint credentials and initialize the framework. PyRIT reads from ~/.pyrit/ by default. For more details, see the Configure PyRIT page.
Set Up Your .env File
Create ~/.pyrit/.env with your provider credentials. Tabbed examples for OpenAI, Azure, Ollama, Groq, and more.
Full Framework Setup ⭐
Set up .pyrit_conf + .env for persistent config. Enables initializers that register targets, scorers, and datasets — required for pyrit_scan and scenarios.