orchestrating-llm-attacks-with-pyrit
Lets your agent perform complex attacks against language models. Useful for testing AI security more deeply and adaptively.
What it does
This tool automates security testing for AI systems. It simulates long, complex conversations to find weaknesses that simple tests might miss.
When to use it
- ✓When quick, single-question tests aren't enough.
- ✓When evaluating AI assistants that remember past conversations.
- ✓To create repeatable and detailed security tests.
Example of what to ask your AI
“Test the AI model to see if it reveals sensitive information in a multi-turn conversation.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool uses AI models to converse with the target system, attempting to find vulnerabilities. An 'evaluator' checks the responses and guides the conversation towards a specific goal.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill orchestrating-llm-attacks-with-pyritOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/orchestrating-llm-attacks-with-pyrit/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Orchestrating LLM Attacks with PyRIT
Legal and Authorized-Use Notice: PyRIT generates adversarial and potentially harmful prompts to test AI systems. Use it only against models and endpoints you own or are explicitly authorized to assess. Multi-turn orchestrators consume large numbers of tokens against both the target and the adversarial/scoring models; account for cost and terms of service. Unauthorized use is prohibited.
Overview
PyRIT (Python Risk Identification Tool for generative AI) is an open-source automation framework from Microsoft's AI Red Team, distributed at github.com/microsoft/PyRIT. Where a single-shot scanner sends one prompt and checks the answer, PyRIT automates multi-turn adversarial conversations: an attacker model and a scorer model collaborate in a loop to drive a target model toward a defined objective (for example, eliciting restricted content, leaking a system prompt, or making an agent perform an unauthorized tool call). This mirrors how real adversaries iterate against a chatbot rather than relying on one magic prompt.
PyRIT is built from composable primitives. Targets (pyrit.prompt_target) wrap the systems being probed and the helper models — OpenAIChatTarget, AzureMLChatTarget, HTTPTarget, and others. Orchestrators / attacks (pyrit.orchestrator) implement attack strategies; all multi-turn strategies subclass MultiTurnOrchestrator. The headline strategies are RedTeamingOrchestrator (a generic adversarial-chat loop), CrescendoOrchestrator (the Crescendo technique — start benign and escalate gradually so each turn looks reasonable in isolation), and TreeOfAttacksWithPruningOrchestrator (TAP — branch multiple attack lines in parallel, expand the branches the scorer rates as progressing, and prune dead ends). Scorers (pyrit.score) such as SelfAskTrueFalseScorer decide whether the objective was met and feed that judgment back into the loop. Converters mutate prompts (base64, translation, ASCII art) to evade filters, and memory persists every turn for later analysis.
This skill maps to MITRE ATLAS AML.T0051 (LLM Prompt Injection) and AML.T0054 (LLM Jailbreak) because PyRIT operationalizes both at scale across conversation turns, and supports NIST AI RMF MEASURE-2.7 by producing repeatable, scored security measurements of an AI system.
When to Use
- When single-shot scanning (e.g. garak) finds a model robust to one-prompt attacks and you need to test multi-turn escalation (Crescendo) or adaptive branching (TAP).
- When assessing a conversational agent or assistant where state accumulates over a dialogue.
- When you need an automated, scorer-driven harness rather than manual prompt-by-prompt red teaming.
- When building reproducible red-team campaigns with persisted conversation memory for evidence and regression.
- When evaluating whether guardrails hold under gradual, plausibly-deniable escalation.
Prerequisites
- Python 3.11+ (3.12/3.13 supported); a dedicated virtual environment.
- Install PyRIT from PyPI:
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate python -m pip install -U pyrit python -c "import pyrit; print(pyrit.__version__)" - Credentials/endpoints for: the target model, an adversarial chat model (the attacker), and a scoring model (often the same as the adversarial model). For OpenAI/Azure set
OPENAI_API_KEY/ Azure OpenAI env vars, or use a.envfile PyRIT loads. - Written authorization to test the target.
Objectives
- Initialize PyRIT memory and configure target, adversarial, and scoring endpoints.
- Run a generic adversarial-chat attack with
RedTeamingOrchestrator. - Run a gradual-escalation attack with
CrescendoOrchestrator. - Run an adaptive branching attack with
TreeOfAttacksWithPruningOrchestrator. - Apply prompt converters to evade input filters.
- Persist and export the full conversation for evidence and triage.
MITRE ATT&CK Mapping
This skill uses MITRE ATLAS technique IDs.
| ID | Tactic | Official Name | Relevance |
|---|---|---|---|
| AML.T0051 | ML Attack Staging / Impact | LLM Prompt Injection | PyRIT orchestrators inject crafted instructions across turns to subvert intended behavior. |
| AML.T0054 | Privilege Escalation / Defense Evasion | LLM Jailbreak | Crescendo and TAP iteratively bypass guardrails; the scorer confirms when restrictions are defeated. |
Workflow
…
FAQ
What is 'red teaming'?
It's a security process where a team actively tries to find flaws in a system, simulating real attacks.
Why use multi-turn conversations?
Many vulnerabilities only appear when the AI is led into complex situations over a conversation, not in a single prompt.
Do I need permission to use this tool?
Yes, you should only use it on systems you own or have explicit authorization to test.
Details
Original description by the author
Build automated multi-turn adversarial attacks against conversational LLM targets using Microsoft PyRIT's RedTeamingOrchestrator, CrescendoOrchestrator (gradual escalation), and TreeOfAttacksWithPruningOrchestrator (adaptive branching), with scorer feedback loops and persisted conversation memory. Use when single-shot LLM scanning is insufficient and you need multi-turn, scorer-driven AI red-team
Popularity
- GitHub stars
- 35k
- Ranking position
- #6004
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC