跳到正文
Skillpedia
智能体35k · #8167

orchestrating-llm-attacks-with-pyrit

它能做什么

这个工具可以自动化测试 AI 系统的安全性。它会模拟长时间、复杂的对话,找出简单测试可能漏掉的弱点。

适用场景

  • ✓当简单的单问题测试不足以发现问题时。
  • ✓在评估会记住过往对话的 AI 助手时。
  • ✓想创建可重复、详细的安全测试时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/orchestrating-llm-attacks-with-pyrit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/orchestrating-llm-attacks-with-pyrit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“测试这个 AI 模型,看它在多轮对话中是否会泄露敏感信息。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会用 AI 模型与目标系统对话,尝试找出漏洞。“评估器”会检查回复,并引导对话朝着特定目标推进。

技术内容(原始 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 .env file 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

…

常见问题

什么是“red teaming”(红队测试)?

这是一种安全测试流程,由一个团队主动寻找系统中的缺陷,模拟真实攻击。

为什么要使用多轮对话?

很多漏洞只有在对话中把 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

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#8167
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能