red-teaming-llms-with-garak
Skill này làm gì
Công cụ này kiểm tra độ an toàn của mô hình AI bằng cách gửi các câu hỏi 'độc hại' để xem chúng có phản hồi không phù hợp hay không. Nó giúp tìm lỗ hổng bảo mật trước khi chúng gây ra vấn đề.
Khi nào nên dùng
- ✓Khi bạn chuẩn bị đưa một mô hình AI vào sử dụng thực tế.
- ✓Khi bạn muốn kiểm tra xem bản cập nhật bảo mật có hiệu quả không.
- ✓Khi bạn muốn hiểu rủi ro bảo mật của một mô hình.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/red-teaming-llms-with-garak/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra mô hình AI này xem nó có bị đánh lừa để tiết lộ thông tin nhạy cảm không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ gửi nhiều loại câu hỏi khó cho mô hình AI. Sau đó, nó phân tích câu trả lời để xem mô hình đã thất bại bao nhiêu lần trong việc tự bảo vệ. Điều này cho thấy mô hình dễ bị tổn thương nhất ở đâu.
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.
Red-Teaming LLMs with garak
Legal and Authorized-Use Notice: This skill is for authorized AI security testing and educational purposes only. Probe only models, API keys, and endpoints you own or have explicit written permission to test. Automated probing of third-party LLM APIs may violate their terms of service and consume billable tokens. Unauthorized probing of systems you do not control may be illegal.
Overview
garak (Generative AI Red-teaming and Assessment Kit) is an open-source LLM vulnerability scanner maintained by NVIDIA. It plays the role that a network vulnerability scanner like Nessus plays for hosts, but for large language models: it sends thousands of adversarial prompts ("probes") at a target model, captures the generations, and runs automated "detectors" over the responses to decide whether each attempt succeeded. Probe families cover prompt injection (promptinject, latentinjection), jailbreaks (dan), training-data and system-prompt leakage (leakreplay), malware generation (malwaregen), cross-site-scripting payload emission (xss), encoding-based bypasses (encoding), toxicity, and more. garak is described in the paper "garak: A Framework for Security Probing Large Language Models" (arXiv:2406.11036) and is distributed from the NVIDIA/garak GitHub repository.
The scanner is generator-agnostic. It can target Hugging Face models loaded locally, OpenAI-compatible APIs, AWS Bedrock, Replicate, Cohere, NIM endpoints, GGUF/llama.cpp models, and arbitrary REST endpoints via a JSON generator spec. After a run, garak emits a .report.jsonl line-delimited log of every attempt and detector verdict, a human-readable .report.html, a garak.log debug log, and a hit log of confirmed vulnerabilities. The terminal output prints a per-probe, per-detector pass/fail summary with a hit rate (for example dan.Dan_11_0 jailbreak: FAIL ok on 38/40), which is the primary artifact you interpret.
This skill maps to the MITRE ATLAS techniques AML.T0051 (LLM Prompt Injection) and AML.T0054 (LLM Jailbreak) because garak operationalizes both: it crafts prompt-injection and jailbreak inputs at scale and measures whether the target's guardrails hold. It supports the NIST AI RMF MEASURE-2.7 subcategory by providing repeatable, quantitative security/resilience measurement of a deployed AI system.
When to Use
- When you need a fast, repeatable baseline security assessment of an LLM before or after deployment.
- When validating that a guardrail, system prompt, or safety fine-tune actually reduces jailbreak and injection success rates (run before/after and compare hit rates).
- When producing evidence for an AI risk assessment or model card security section (NIST AI RMF MEASURE-2.7).
- When triaging which OWASP LLM Top 10 risks (LLM01 prompt injection, LLM02 sensitive information disclosure, LLM07 system prompt leakage) actually manifest in your model.
- When regression-testing an LLM endpoint in CI after model or prompt changes.
Prerequisites
- Python 3.10+ (3.12 recommended) and a virtual environment.
- Install garak from PyPI:
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate python -m pip install -U garak garak --version - For the bleeding-edge version:
python -m pip install -U git+https://github.com/NVIDIA/garak.git@main - An API key for the target if probing a hosted model (for example
export OPENAI_API_KEY="sk-..."). - Written authorization to test the target, and awareness of token cost (probes generate thousands of calls).
Objectives
- Enumerate available probes and detectors and pick a scoped suite.
- Configure garak against a local Hugging Face model, an OpenAI-compatible API, and an arbitrary REST endpoint.
- Run prompt-injection, jailbreak, and leakage probe families and capture reports.
- Interpret the per-probe hit-rate output and the
.report.jsonl. - Re-run after applying a mitigation to demonstrate risk reduction.
- Produce a defensible findings artifact for an AI risk assessment.
MITRE ATT&CK Mapping
This skill uses MITRE ATLAS (the adversarial-ML companion to ATT&CK) technique IDs.
| ID | Tactic | Official Name | Relevance |
|---|---|---|---|
| AML.T0051 | ML Attack Staging / Impact | LLM Prompt Injection | garak's promptinject and latentinjection probes craft malicious prompts that subvert intended model behavior. |
…
Câu hỏi thường gặp
“Probe” là gì?
'Probe' là các câu hỏi kiểm tra đặc biệt, được thiết kế để thử đánh lừa hoặc làm hỏng mô hình AI, kiểm tra khả năng phòng thủ của nó.
“Jailbreak” là gì?
'Jailbreak' là nỗ lực khiến mô hình AI bỏ qua quy tắc an toàn và trả lời những câu hỏi mà bình thường nó sẽ từ chối.
Tôi có cần sự cho phép để kiểm thử một mô hình không?
Có, bạn cần giấy phép bằng văn bản rõ ràng trước khi kiểm thử bất kỳ mô hình hoặc API nào không thuộc sở hữu của bạn. Kiểm thử khi chưa được phép có thể vi phạm pháp luật và điều khoản dịch vụ.
Chi tiết
Mô tả gốc của tác giả
Runs NVIDIA garak probe suites (jailbreak, prompt injection, data leakage, toxicity, and more) against an LLM endpoint - Hugging Face models, OpenAI-compatible APIs, or Bedrock - then interprets the resulting hit-rate report for triage. Use when baselining LLM security before/after deployment, validating that a guardrail or fine-tune reduces jailbreak/injection success rates, or producing evidence
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #8347
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.