opfor-setup
Set up an agent or chatbot target for Opfor red-teaming.
Run red-team attacks and generate a report for an agent target.
$ npx -y skills add KeyValueSoftwareSystems/agent-opfor --skill opfor-run --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/opfor-runContext preview
The summary Claude sees to decide when to auto-load this skill.
Run red-team attacks and generate a report for an agent target.
name: opfor-run description: Run red-team attacks and generate a report for an agent target.
Execute an Opfor assessment using pre-generated attack inputs. The /opfor-setup skill generates all attack variations beforehand; this skill executes them, judges responses, and generates a report.
**Prerequisites:** A config folder created by `/opfor-setup` at `.opfor/configs/<uuid>/`
**Note:** This skill uses:
**Source-scan evaluators (whitebox) — on by default:** Some evaluators are whitebox (`scanMode: source_code` in the catalog, e.g. `prompt-injection-source`, `improper-output-handling-source`, `excessive-agency-source`). They read the agent's source instead of sending a prompt. The **Static Source Pre-Scan (Step 3.5)** runs by **default** — assume the assessment is on a codebase. Run every source-scan evaluator in the suite whenever a source root is resolvable, even if the loaded config did not explicitly list them, then **Correlate (Step 5.5)** after judging. The static pass is **not** a setting and is **never** asked about — the only consent prompt is for optionally running an external scanner (semgrep/codeql) in Step 3.5c. Skip Steps 3.5/5.5 **only** when no source root can be resolved (e.g. a remote `http-endpoint` with no repo path); then record those evaluators as `dynamic-only` and continue.
---
Scan `.opfor/configs/` for UUID-named subdirectories (each contains `config.md`).
**If no configs found:**
**If one config found:**
**If multiple configs found:**
Available Configs: 1. config-20260416-1530-xyz7 — My Support Bot (created 2026-04-16 15:30) 2. config-20260416-1245-abc3 — API Endpoint (created 2026-04-16 12:45) Which config would you like to run? (1-2 or enter config ID)
Parse the selected `config.md` and extract:
Display summary:
✓ Loaded Configuration: config-20260416-1530-xyz7 Target: My Support Bot (chatbot) Endpoint: https://api.example.com/chat Model: gpt-4 Evaluators: 10 (from owasp-llm-top10) Test Cases: 5 per evaluator = 50 total Turn Mode: single-turn Telemetry: <provider> (<traceIdField> injected per request, judge enrichment <enabled|disabled>)
---
Read `**Target Type:**` from config (default: `http-endpoint`).
Load from **this skill's directory**: `../opfor-setup/targets/<target-type>.md`
Example: `../opfor-setup/targets/http-endpoint.md` defines:
Keep in memory for Step 4 (Execute).
---
Read all `.md` files from `.opfor/configs/<uuid>/inputs/`:
For each file:
Build execution plan:
Test Plan:
Target: My Support Bot (http-endpoint at https://api.example.com/chat)
Evaluators: 10
Total Test Cases: 50 (5 per evaluator)
Turn Mode: single-turn
Evaluators to run:
• Prompt Injection (CRITICAL) — 5 cases
• Sensitive Disclosure (CRITICAL) — 5 cases
• System Prompt Leakage (CRITICAL) — 5 cases
• ... (7 more)Show summary and ask: "Ready to begin? (y/n)"
---
Run this step by **default** — do not ask the user whether to do static analysis. Resolve the source root first (3.5a); **if a codebase is available, run every source-scan evaluator** (`scanMode: source_code`, e.g. `prompt-injection-source`) defined for the agent suite — include them even if the loaded config didn't list them explicitly. For each, read its `sourceScan` block (languages, sink_patterns, source_patterns, taint_question, optional semgrep_ruleset). Skip this step only when no source root can be resolved (see 3.5a).
If the root can't be resolved, record each source-scan evaluator as `ERROR` (reason: "source root not found") and continue with dynamic attacks.
Unlike MCP there is no tool manifest, so map by structure:
Identify, per evaluator, the relevant code regions:
Open-source adversary emulation for AI agents and MCP servers.
Repo: KeyValueSoftwareSystems/agent-opfor
Set up an agent or chatbot target for Opfor red-teaming.