К основному содержанию
скилл CX Codex

red-team · gaasher — скилл для Claude Code: что делает и как установить

Скилл red-team находит слабые места в фильтрах контента, классификаторах и API методом состязательного тестирования — генерирует атакующие вводы и собирает каталог отказов.

MIT ★ 185 обновлён 2026-06-30

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add gaasher/Agent-Loop-Skills
/plugin install agent-loops@agent-loop-skills
Открыть на GitHub

Что делает red-team

Запускает цикл нагрузочного тестирования: создаёт набор состязательных вводов (обфускация, синонимы, leetspeak, гомоглифы), прогоняет их через целевую систему и эталонный оракул с помощью tools/harness.py, фиксирует каждое расхождение как отказ и убирает дубли по классу техники. Цикл продолжается, пока новые раунды не перестанут находить новые классы отказов.

Требует Python 3.9+. Работает только с системами, на тестирование которых у пользователя есть разрешение: ищет обходы (система пропускает то, что оракул заблокировал бы) и ложные срабатывания (блокирует безопасный ввод). Не правит целевую систему — только собирает каталог воспроизводимых отказов.

Какие задачи решает

  • найти обходы фильтров через обфускацию и leetspeak
  • выявить ложные срабатывания классификатора на безопасных данных
  • протестировать гардрейл состязательными вводами
  • собрать каталог отказов с примерами для каждого класса техники

Примеры запросов агенту

  • Запусти red-team на моём классификаторе контента
  • Протестируй гардрейл в filter.py состязательными вводами
  • Собери каталог отказов для API из api_endpoint.sh

Как установить red-team

1Через маркетплейс плагинов

/plugin marketplace add gaasher/Agent-Loop-Skills
/plugin install agent-loops@agent-loop-skills

Команда ставит плагин agent-loops целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add gaasher/Agent-Loop-Skills --skill red-team -a claude-code

3Вручную: положить файлы

~/.claude/skills/red-team/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/red-team/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о red-team

Как установить red-team в Claude Code?

Выполни /plugin marketplace add gaasher/Agent-Loop-Skills, затем /plugin install agent-loops@agent-loop-skills.

Что делает скилл red-team?

Ищет слабые места в фильтрах и классификаторах: генерирует атакующие вводы, сверяет результат целевой системы с эталонным оракулом и собирает каталог расхождений по классам техник (обфускация, синонимы, ложные срабатывания). Выдаёт воспроизводимые примеры отказов и короткие рекомендации по исправлению.

Зачем нужен оракул в red-team?

Оракул — это эталон для сравнения: он выносит правильное решение по тому же вводу. Скилл фиксирует отказ, когда целевая система расходится с оракулом (пропускает запрещённое или блокирует безопасное). Без исполняемого оракула его роль может взять на себя ИИ, сверяясь с письменной политикой.

Исходный текст

SKILL.md · MIT
---
name: red-team
description: >
  Use when the user wants to adversarially stress-test a guardrail, classifier, prompt, or API they
  own or are authorized to test, to surface the distinct ways it fails. Generates adversarial inputs,
  runs them through the target and a ground-truth oracle, logs every target-vs-oracle disagreement as a
  failure de-duplicated by technique class, and loops until rounds stop surfacing new classes. Produces
  a catalogue of distinct, reproducible failures — the attacker half of a find→fix setup. Not for
  patching the target, and not for attacking systems the user does not own or have permission to test.
compatibility: Requires Python 3.9+
metadata:
  version: "0.1.0"
---

# Red Team

An adversarial loop-until-dry. The artifact is a target system; the feedback signal is the count of
**distinct failure classes** you can surface. Each round you craft adversarial inputs aimed at *new*
weaknesses and run them through the target and a ground-truth **oracle** via `tools/harness.py`, which
records every disagreement as a failure and de-dupes by the `class` (technique) you label each input
with. You loop until fresh rounds stop finding anything new. This is only the *find* half of a
find→fix setup: it catalogues failures and never patches the target (see [Pairing](#pairing)).

## When to use
Use to harden a guardrail, classifier, content filter, prompt, or API that the user owns or is
explicitly authorized to test — when the goal is a catalogue of distinct, reproducible failures, each
an objective target-vs-oracle disagreement. A failure is a **bypass** (target allows what the oracle
would block) or an **over-block** (target blocks what the oracle would allow).

Default: drive the loop with a runnable oracle so the signal is objective. Escape hatch: if the user
has no runnable oracle, the oracle is *your* judgment against a written policy — apply it consistently
and record the intended verdict per input. Not for fixing the target, and not for testing systems
outside the user's authorization.

## Setup
Resolve bindings interactively. If `loop.run.yaml` exists, load it, confirm the values in one line,
and skip to the loop. Otherwise: on Claude Code (the `AskUserQuestion` tool is available) infer a
likely value per binding and recommend it; on other hosts ask each as a quoted prompt. Then write
`loop.run.yaml` (format: `examples/run.example.yaml`) and confirm before creating any other files.

| binding | meaning | default | how to infer |
|---|---|---|---|
| `<target_cmd>` | system under test: reads one input on stdin, prints a verdict (`BLOCK`/`ALLOW`, a label, a score). Never edited. | — | the guardrail/classifier/API entrypoint the user names |
| `<oracle_cmd>` | ground-truth verdict for the same input. A failure is `target != oracle`. | — | a reference checker / policy impl; else your judgment vs a written policy |
| `<candidates_file>` | each round's candidates, JSONL `{id, text, class}`; `class` is the technique the harness de-dupes on | `<sandbox_root>/candidates.jsonl` | — |
| `<failures_log>` | append-only log of confirmed failures | `<sandbox_root>/failures.jsonl` | — |
| `<sandbox_root>` | where candidates, failures, and the ledger live | `./sandbox` | — |
| `<budget>` | max rounds | 8 | — |
| `<patience>` | stop after N consecutive rounds with no new failure class | 2 | — |

The signal comes from `tools/harness.py`. Run it each round:

```
python3 <skill_dir>/tools/harness.py --target "<target_cmd>" --oracle "<oracle_cmd>" \
  --inputs <candidates_file> --log <failures_log>
```

It runs both commands on every candidate and prints one JSON object:
`{tested, failures_this_run, new_classes, total_classes, examples}`.

## The loop
Copy this checklist and tick items off each round:

- [ ] Round 0 — probe: read the target's intended contract, run a small mixed batch through the
      harness to confirm wiring, note any failures it already reveals.
- [ ] Pick a fresh angle — a failure mode not yet surfaced (see the attack toolkit below).
- [ ] Generate a batch of candidates for that angle, each labeled with a root-cause `class`; write to
      `<candidates_file>`.
- [ ] Run `tools/harness.py`; read `new_classes` and the example failures.
- [ ] Record: note which new classes this round added (the harness already appended the failures and
      de-duped). Append one ledger row.
- [ ] Stop when `<patience>` consecutive rounds add no new class, or at `<budget>`. Else steer the next
      round at an untried angle.

**Attack toolkit** (draw from these, and invent your own):
- **Obfuscation** — case changes, spacing/punctuation, leetspeak, unicode homoglyphs, encoding.
- **Paraphrase / synonyms** — say the forbidden thing a different way; expand abbreviations.
- **Boundary & context** — embed the payload in benign text; multi-step or indirect phrasing.
- **Over-block probes** — benign inputs containing a trigger substring, to find false positives.

**Labeling classes.** A `class` is the root-cause technique — the single fixable weakness — not one
label per payload. Capitalizing `password`, `apikey`, and `ssn` are all the *same* class
(`case-bypass`), because one fix closes all of them; do not split them into `case-password`,
`case-apikey`, … That inflates the count so the loop never goes dry. Aim for a handful of root-cause
classes (e.g. `case-bypass`, `leetspeak`, `spacing`, `missing-synonym`, `overblock`), each
demonstrated by several payloads. Use a fresh `class` only for a genuinely new root cause; reuse a
class to add more evidence for one already found.

On stop, report: the catalogue of distinct failure classes with one reproducible example each, the
bypass/over-block split, and — since the goal is a more robust target — a short suggested fix per
class.

## Ledger
`<sandbox_root>/ledger.tsv`, tab-separated, never commas in the text. Header `round angle tested
new_classes total_classes`:
```
round	angle	tested	new_classes	total_classes
0	probe mixed batch	6	case,spacing	2
1	leetspeak + unicode	8	leetspeak	3
2	synonyms + expansions	8	synonym,expansion	5
3	benign trigger substrings	6	overblock	6
4	multi-step phrasing	8	(none)	6
```
Report the catalogue at the round with the most distinct classes (the cumulative `total_classes`),
not whichever round ran last.

## Constraints
- **Never edit the target, the oracle, or `tools/harness.py`.** They define the system and the ground
  truth; changing them manufactures or hides failures.
- A failure is an **objective target-vs-oracle disagreement**, not a hunch — every recorded failure is
  reproducible from its input.
- **Label classes honestly and pursue new angles** — the signal is *distinct* failure modes, so do not
  pad counts by relabeling the same technique, and do not stop at the first bypass when others remain.
- Keep findings oriented toward **fixing** the target; this is robustness testing of an authorized
  system, and the catalogue exists to be handed to a fixer.
- Stay inside `<sandbox_root>`; no path escapes outside it.
- Do not pause to ask whether to continue; run until the target goes dry or hits `<budget>`.

## Pairing
This skill is the **attacker** — half of a find→fix loop. By itself it tells you *how* the system
fails but leaves it unfixed. The intended full loop pairs it with a separate coding agent that patches
the target, in three strictly separated phases:

1. **Find** *(this loop)* — run against the **frozen** target → a catalogue of distinct failure
   classes, each with a reproducible example and a suggested fix.
2. **Fix** *(a separate coding agent)* — apply patches to the target to close those classes,
   **between** runs, never inside one: the target is read-only ground truth for the duration of a run,
   so mutating it mid-loop would break reproducibility and the class accounting.
3. **Re-verify** *(a fresh find run)* — start a new run against the patched target. Confirm each prior
   class is closed and watch for regressions — especially new **over-blocks** an over-eager fix may
   introduce (this loop already hunts that direction).

Repeat find → fix → re-verify until a fresh run stays dry. Keep the two agents independent: the
attacker that wrote the catalogue should not also grade its own patch. This skill deliberately stops
at the end of phase 1; the fix/re-verify orchestration lives outside it.

© gaasher · MIT · gaasher/Agent-Loop-Skills

Похожие скиллы

Все скиллы по теме «Безопасность» →

Сначала — red-team от других авторов.

red-team Alireza Rezvani Скилл red-team для структурированного планирования авторизованных операций красной команды: анализ цепочек атак по MITRE ATT&CK, оценка техник, выявление критических точек и оценка рисков OPSEC. CX Codex +1 826установок thinking-red-team tjboudreaux Скилл thinking-red-team для авторизованного разбора безопасности: моделирует атакующего, ищет пути эксплуатации и проверяет, что предложенное исправление закрывает дыру. CX Codex +1 800установок red-team-tactics davila7 Скилл red-team-tactics помогает планировать моделирование атак по MITRE ATT&CK и оформлять результаты проверки. Он пригодится для анализа этапов атаки и пробелов в обнаружении. CX Codex +1 177установок red-team-engagement briiirussell Скилл red-team-engagement помогает спланировать и провести авторизованную симуляцию атак red team для проверки защиты. Пригодится при составлении правил engagement, сценариев assumed-breach и деконфликтации. CX Codex +1 439установок conducting-full-scope-red-team-engagement mahipal Скилл conducting-full-scope-red-team-engagement для Claude Code планирует red team операции по MITRE ATT&CK. Запускается для оценки защиты от APT-атак или эмуляции действий группировки. CX Codex +1 243установок 14-red-team-ops Masriyan Скилл 14-red-team-ops для Claude Code помогает планировать авторизованные red team операции и проектировать C2-сети. Запускается при подготовке киберучений или анализе векторов атак. CX Codex +1 ★ 71звёзд репо strategy-red-team phuryn Скилл strategy-red-team проверяет PRD и стратегии на прочность: находит ключевые допущения, атакует их сильные версии и предлагает дешёвые проверки. CX Codex +1 9 700установок

Из того же набора26

Весь набор →
literature-search Скилл literature-search ищет научные статьи через Semantic Scholar и arXiv, обходит граф цитирований и достаёт полные тексты без внешних библиотек. CX Codex +1 ★ 185звёзд репо data-analysis Скилл data-analysis исследует набор данных через проверяемые гипотезы и собирает отчёт с подтверждёнными числами. Запускайте его для открытого анализа, а не для поиска причины уже известной ошибки. CX Codex +1 ★ 185звёзд репо prompt-optimize Скилл prompt-optimize для Claude Code итеративно улучшает готовый промпт по команде оценки и сохраняет только правки, повышающие метрику. CX Codex +1 ★ 185звёзд репо anomaly-investigation Скилл anomaly-investigation ищет причину уже замеченного скачка, падения или выброса в данных. Он проверяет версии по очереди и фиксирует подтверждение в журнале расследования. CX Codex +1 ★ 185звёзд репо power-analysis Скилл power-analysis для Claude Code рассчитывает размер выборки для двухгруппового сравнения и помогает подготовить пререгистрацию. Включается при планировании A/B-теста, простого RCT или оценки двух моделей до сбора данных. CX Codex +1 ★ 185звёзд репо claim-verify Скилл claim-verify проверяет числовые утверждения из черновика отчёта по исходным данным. Находит расхождения, тестирует выводы на выбросы и уточняет формулировки перед публикацией. CX Codex +1 ★ 185звёзд репо literature-survey Скилл literature-survey для Claude Code строит обзор исследований в виде матрицы источников и утверждений. Он подключается для поиска согласий, противоречий и пробелов по вопросу. CX Codex +1 ★ 185звёзд репо optimize-loop Скилл optimize-loop гоняет цикл правок с жёстким гейтом корректности и метрикой, которую надо снизить: рефакторинг модуля под зелёные тесты или ускорение SQL-запроса с тем же набором строк. CX Codex +1 ★ 185звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой