orchestrating-llm-attacks-with-pyrit
できること
このツールは、AIシステムのセキュリティテストを自動化します。単純なテストでは見落としてしまうような弱点を見つけるために、長く複雑な会話を模擬します。
使う場面
- ✓1回の質問だけの簡単なテストでは不十分なとき。
- ✓過去の会話を記憶するAIアシスタントを評価するとき。
- ✓再現可能で詳細なセキュリティテストを作成したいとき。
スキルのリンク
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/orchestrating-llm-attacks-with-pyrit/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“マルチターンの会話で、AIモデルが機密情報を漏らすかどうかをテストしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このツールはAIモデルを使って対象のシステムと会話し、脆弱性を見つけようとします。「評価者(evaluator)」が応答を確認し、特定の目標に向けて会話を導きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
…
よくある質問
「レッドチーミング」とは何ですか?
チームが実際の攻撃を模擬しながら、システムの欠陥を積極的に探すセキュリティの取り組みです。
なぜマルチターンの会話を使うのですか?
多くの脆弱性は、1回のプロンプトだけでは現れず、会話を通じてAIが複雑な状況に導かれたときに初めて現れるためです。
このツールを使うには許可が必要ですか?
はい。自分が所有している、または明示的に検査の許可を得ているシステムにのみ使用してください。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 35k
- ランキング
- #8167
- ライセンス
- Apache-2.0
- 更新日
- 2026/8/31
コメント
- …
このリポジトリの他のスキル
abusing-dpapi-for-credential-access
35k特定のタスク向けに用意された指示をAIエージェントに与え、より良く、より速く作業できるようにします。
abusing-shadow-credentials-for-privesc
35kAIエージェントに、明確で構成のしっかりした文章の書き方を教えます。
achieving-cmmc-level-2-compliance
35kエージェントがCMMC Level 2への準拠に向けた環境を整えられるようにします。セキュリティ要件を実装し、必要なドキュメントを管理します。
acquiring-disk-image-with-dd-and-dcfldd
35kエージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。