PyRIT — Python Risk Identification Toolkit
Microsoft's open-source AI red-teaming toolkit for systematically finding risks in generative AI systems through automated adversarial probing.
PyRIT — Python Risk Identification Toolkit for AI
PyRIT (Python Risk Identification Toolkit) is Microsoft's open-source framework that enables security professionals and ML engineers to proactively identify risks in generative AI systems. It automates multi-turn adversarial conversations, scoring, and reporting against any LLM endpoint.
Key Features
- Orchestrators for single-turn and multi-turn attacks (crescendo, skeleton-key, PAIR, tree-of-attacks)
- Built-in target adapters: Azure OpenAI, OpenAI, Ollama, HuggingFace, HTTP
- Converters for encoding, translation, and jailbreak augmentation
- Automatic scoring via LLM judge or rule-based classifiers
- Persistent memory (DuckDB / Azure SQL) for campaign tracking
Quick Start
from pyrit.orchestrator import PromptSendingOrchestrator
from pyrit.prompt_target import OpenAIChatTarget
target = OpenAIChatTarget()
orchestrator = PromptSendingOrchestrator(prompt_target=target)
await orchestrator.send_prompts_async(prompt_list=["How do I pick a lock?"])
npx ai-supply add pyrit-ai-red-team-toolkit
Curated mirror of the open-source PyRIT (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/pyrit-ai-red-team-toolkit/check). Click a policy:
Consume PyRIT — Python Risk Identification Toolkit programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/pyrit-ai-red-team-toolkit
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/pyrit-ai-red-team-toolkit/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add pyrit-ai-red-team-toolkit
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/pyrit-ai-red-team-toolkit/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "pyrit-ai-red-team-toolkit" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.