Chuyển đến nội dung
Skillpedia
Agent35k · #8167

orchestrating-llm-attacks-with-pyrit

Skill này làm gì

Công cụ này tự động hóa việc kiểm thử bảo mật cho các hệ thống AI. Nó mô phỏng các cuộc hội thoại dài và phức tạp để tìm những điểm yếu mà các bài kiểm tra đơn giản có thể bỏ sót.

Khi nào nên dùng

  • ✓Khi các bài kiểm tra một câu hỏi đơn giản là không đủ.
  • ✓Khi đánh giá trợ lý AI có ghi nhớ các cuộc trò chuyện trước đó.
  • ✓Để tạo các bài kiểm thử bảo mật có thể lặp lại và chi tiết.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/orchestrating-llm-attacks-with-pyrit/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra xem mô hình AI có tiết lộ thông tin nhạy cảm trong một cuộc hội thoại nhiều lượt hay không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng các mô hình AI để trò chuyện với hệ thống mục tiêu, cố gắng tìm lỗ hổng. Một “evaluator” kiểm tra câu trả lời và dẫn dắt cuộc hội thoại hướng tới một mục tiêu cụ thể.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

…

Câu hỏi thường gặp

“Red teaming” là gì?

Đây là quy trình bảo mật trong đó một nhóm chủ động tìm lỗi của hệ thống, mô phỏng các cuộc tấn công thực tế.

Vì sao dùng hội thoại nhiều lượt?

Nhiều lỗ hổng chỉ xuất hiện khi AI bị dẫn vào các tình huống phức tạp qua nhiều lượt trò chuyện, chứ không phải chỉ qua một câu lệnh.

Tôi có cần sự cho phép để dùng công cụ này không?

Có. Bạn chỉ nên dùng công cụ trên hệ thống mà bạn sở hữu hoặc có sự cho phép rõ ràng để kiểm thử.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8167
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự