Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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

  1. Install PyRIT and verify installation.
    For more details and alternative installation methods, see the Install PyRIT page

# note: for local installation, python version 3.13 is recommended: https://www.python.org/downloads/latest/python3.13
pip install pyrit
python -c "import pyrit; print(f'PyRIT version installed: {pyrit.__version__}')"
  1. Create and populate endpoint and startup configuration files in ~/.pyrit/.env and ~/.pyrit/.pyrit_conf with minimal content below.
    For more details, see the Configure PyRIT page.

🔑 ~/.pyrit/.env
# example OPENAI_CHAT_ENDPOINT values:
# "https://api.openai.com/v1"
# "https://<project>.cognitiveservices.azure.com/openai/v1/"
# "https://<project>.services.ai.azure.com/openai/v1"
OPENAI_CHAT_ENDPOINT="<open-ai-chat-endpoint>"
OPENAI_CHAT_KEY="<your-api-key>"
OPENAI_CHAT_MODEL="<model-name>"
📄 ~/.pyrit/.pyrit_conf
memory_db_type: in_memory

initializers:
  - name: target
    args:
      tags:
        - default
        - scorer
  - name: scorer
  - name: load_default_datasets
  1. Use PyRIT in any mode that best fits your use case: Scanner, GUI, or Framework.

🔍 Scanner
🖥️ GUI
🧩 Framework

Run security assessments from the command line with pyrit_scan or the interactive pyrit_shell. Execute built-in scenarios against your AI targets.

pyrit_scan airt.scam --target openai_chat
scanner-demo

Use pyrit_scan --help to learn more about what else pyrit_scan can do. For more details, see the Scanner page.

For more details, see the Framework page.