/promptfoo-redteam-setup
Create or refine promptfoo redteam setup configs: purpose, targets, plugins, strategies, frameworks, multi-input target inputs, policy text, grader guidance, contexts, and static-code-derived target/threat mapping. Use when preparing a red team scan plan from live probes, code
$ npx -y skills add promptfoo/promptfoo --skill promptfoo-redteam-setup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/promptfoo-redteam-setup
Context preview
The summary Claude sees to decide when to auto-load this skill.
Create or refine promptfoo redteam setup configs: purpose, targets, plugins, strategies, frameworks, multi-input target inputs, policy text, grader guidance, contexts, and static-code-derived target/threat mapping. Use when preparing a red team scan plan from live probes, code
SKILL.md
promptfoo-redteam-setup.SKILL.mdname: promptfoo-redteam-setup
description: >
Create or refine promptfoo redteam setup configs: purpose, targets, plugins,
strategies, frameworks, multi-input target inputs, policy text, grader
guidance, contexts, and static-code-derived target/threat mapping. Use when
preparing a red team scan plan from live probes, code evidence, or provider
configs, or when generating adversarial test cases for QA. Do not use for
basic provider wiring alone or for running/evaluating an already-generated
redteam scan.
Promptfoo Redteam Setup
Build a small, explicit redteam config that matches the real app threat model. Start with a narrow scan that can be generated and inspected, then expand.
Read `references/redteam-setup-patterns.md` when you need concrete YAML patterns. For OpenAPI specs, you can run the bundled `scripts/openapi-operation-to-redteam-config.mjs` to draft a one-operation redteam setup config, then inspect the inferred inputs, policy, and plugins. The script ships in this skill's `scripts/` directory; when the skill is installed as a plugin it lives in the plugin cache, not your project, so run it by its absolute path (or copy it in) rather than a bare `scripts/...` path. With `--token-env`, it infers Bearer/OAuth2/OpenID and header/query/cookie API-key auth; use `--auth-header`/`--auth-prefix` to override. For live connectivity QA, add `--smoke-test true` to include one deterministic `tests` row that can be run with `npm run local -- eval -c ... --no-cache` before redteam generation.
Inputs
Infer these from the repo, docs, or user prompt:
- Target shape: HTTP/API, model provider, custom provider, agent, RAG, MCP/tool
system, or multi-input app.
- Purpose: who uses the system, what it may access or do, and what it must
refuse or protect.
- Trust boundaries: identities, object IDs, documents, tools, secrets,
permissions, and external content.
- Discovery evidence: live probe trace, route/controller files, OpenAPI specs,
existing tests, SDK clients, or provider wrappers.
- First-pass scope: risk categories the user cares about most.
If target wiring is missing, use `promptfoo-provider-setup` first or create a TODO-marked target block and validate it before generation.
Workflow
1. Derive target facts from live or static evidence
- For live endpoints, use only safe probes and keep the request/response trace
that proves method, path, auth, body/query fields, and response path.
- For static code, search route handlers, API clients, tests, and auth/object
checks with `rg`; capture file paths and line numbers for the setup notes.
- Preserve identity, tenant, role, object, document, and tool/action fields as
target `inputs`; these are the attack surface for authorization plugins.
- Convert evidence into risks: object IDs imply `bola`, role/permission checks
imply `rbac`/`bfla`, free-form instructions imply prompt-boundary plugins, tool URLs or shell/database calls imply SSRF/injection/tool plugins.
- Use a JavaScript or Python local wrapper when static code is easier and safer
to exercise than the deployed endpoint; otherwise map the live HTTP contract directly.
2. Write the target and purpose
- Prefer `targets` for redteam configs.
- Add stable `label`; reports and generated files use it for continuity.
- For single-input targets, include a prompt template or set `redteam.injectVar`
so generation lands in the variable the target actually uses.
- For multi-input targets, define `inputs` on the target. Do not set
`redteam.injectVar` or invent a synthetic `prompt` field.
- Write `redteam.purpose` as security-relevant behavior: allowed users/actions,
forbidden data/actions, and domain-specific constraints.
3. Choose a small plugin set
Avoid `plugins: default` for an initial scan unless the user explicitly wants a broad run.
Pick 2-5 plugins from the app's real risks:
- Policy/business rules: `policy`
- Authorization and object access: `bola`, `bfla`, `rbac`
- Prompt boundaries: `hijacking`, `prompt-extraction`, `system-prompt-override`
- RAG/document workflows: `indirect-prompt-injection`,
`rag-document-exfiltration`, `rag-poisoning`, `rag-source-attribution`
- Tool/agent systems: `excessive-agency`, `tool-discovery`, `debug-access`,
`shell-injection`, `sql-injection`, `ssrf`
- Privacy: `pii:direct`, `pii:session`, `pii:social`
- Domain packs: use finance, medical, insurance, ecommerce, real estate,
telecom, teen-safety, or pharmacy plugins only when that domain is real.
For `policy`, include inline policy text unless the user intentionally references a resolved Promptfoo Cloud policy object.
4. Choose strategies conservatively
- Use `jailbreak:meta` for the default first setup/generation pass.
- Use `jailbreak:hydra` instead when the target is stateful, supports
multi-turn conversations, and sessions are configured.
- Add broader follow-up strategies such as `jailbreak:composite` only after the
first generated cases look sane.
5. Configure generation and grading
- Use Promptfoo's default redteam generation unless a specific generator or
model is needed for reproducibility, cost, or fixture QA.
- When using `redteam.provider: file://...`, make the path valid from the
command working directory; JavaScript providers expose `callApi`, while Python providers expose `call_api` or the function named in a `file://x.py:name` suffix. Run commands from the repo root unless the project convention says otherwise.
- For deterministic QA, use a small local file provider that returns Promptfoo's
expected prompt format.
- Use high-value plugins such as `bola` and `bfla` whenever target evidence
shows object IDs, ownership checks, or authorization boundaries.
- Use `redteam.maxConcurrency: 1` for fragile local providers or rate-limited
targets.
- Add plugin-level `graderGuidance` and `graderExamples` only when default
grading would misunderstand domain-specific allowed behavior.
6. Val
Read more
name: promptfoo-redteam-setup description: > Create or refine promptfoo redteam setup configs: purpose, targets, plugins, strategies, frameworks, multi-input target inputs, policy text, grader guidance, contexts, and static-code-derived target/threat mapping. Use when preparing a red team scan plan from live probes, code evidence, or provider configs, or when generating adversarial test cases for QA. Do not use for basic provider wiring alone or for running/evaluating an already-generated redteam scan.
Promptfoo Redteam Setup
Build a small, explicit redteam config that matches the real app threat model. Start with a narrow scan that can be generated and inspected, then expand.
Read `references/redteam-setup-patterns.md` when you need concrete YAML patterns. For OpenAPI specs, you can run the bundled `scripts/openapi-operation-to-redteam-config.mjs` to draft a one-operation redteam setup config, then inspect the inferred inputs, policy, and plugins. The script ships in this skill's `scripts/` directory; when the skill is installed as a plugin it lives in the plugin cache, not your project, so run it by its absolute path (or copy it in) rather than a bare `scripts/...` path. With `--token-env`, it infers Bearer/OAuth2/OpenID and header/query/cookie API-key auth; use `--auth-header`/`--auth-prefix` to override. For live connectivity QA, add `--smoke-test true` to include one deterministic `tests` row that can be run with `npm run local -- eval -c ... --no-cache` before redteam generation.
Inputs
Infer these from the repo, docs, or user prompt:
- Target shape: HTTP/API, model provider, custom provider, agent, RAG, MCP/tool
system, or multi-input app.
- Purpose: who uses the system, what it may access or do, and what it must
refuse or protect.
- Trust boundaries: identities, object IDs, documents, tools, secrets,
permissions, and external content.
- Discovery evidence: live probe trace, route/controller files, OpenAPI specs,
existing tests, SDK clients, or provider wrappers.
- First-pass scope: risk categories the user cares about most.
If target wiring is missing, use `promptfoo-provider-setup` first or create a TODO-marked target block and validate it before generation.
Workflow
1. Derive target facts from live or static evidence
- For live endpoints, use only safe probes and keep the request/response trace
that proves method, path, auth, body/query fields, and response path.
- For static code, search route handlers, API clients, tests, and auth/object
checks with `rg`; capture file paths and line numbers for the setup notes.
- Preserve identity, tenant, role, object, document, and tool/action fields as
target `inputs`; these are the attack surface for authorization plugins.
- Convert evidence into risks: object IDs imply `bola`, role/permission checks
imply `rbac`/`bfla`, free-form instructions imply prompt-boundary plugins, tool URLs or shell/database calls imply SSRF/injection/tool plugins.
- Use a JavaScript or Python local wrapper when static code is easier and safer
to exercise than the deployed endpoint; otherwise map the live HTTP contract directly.
2. Write the target and purpose
- Prefer `targets` for redteam configs.
- Add stable `label`; reports and generated files use it for continuity.
- For single-input targets, include a prompt template or set `redteam.injectVar`
so generation lands in the variable the target actually uses.
- For multi-input targets, define `inputs` on the target. Do not set
`redteam.injectVar` or invent a synthetic `prompt` field.
- Write `redteam.purpose` as security-relevant behavior: allowed users/actions,
forbidden data/actions, and domain-specific constraints.
3. Choose a small plugin set
Avoid `plugins: default` for an initial scan unless the user explicitly wants a broad run.
Pick 2-5 plugins from the app's real risks:
- Policy/business rules: `policy`
- Authorization and object access: `bola`, `bfla`, `rbac`
- Prompt boundaries: `hijacking`, `prompt-extraction`, `system-prompt-override`
- RAG/document workflows: `indirect-prompt-injection`,
`rag-document-exfiltration`, `rag-poisoning`, `rag-source-attribution`
- Tool/agent systems: `excessive-agency`, `tool-discovery`, `debug-access`,
`shell-injection`, `sql-injection`, `ssrf`
- Privacy: `pii:direct`, `pii:session`, `pii:social`
- Domain packs: use finance, medical, insurance, ecommerce, real estate,
telecom, teen-safety, or pharmacy plugins only when that domain is real.
For `policy`, include inline policy text unless the user intentionally references a resolved Promptfoo Cloud policy object.
4. Choose strategies conservatively
- Use `jailbreak:meta` for the default first setup/generation pass.
- Use `jailbreak:hydra` instead when the target is stateful, supports
multi-turn conversations, and sessions are configured.
- Add broader follow-up strategies such as `jailbreak:composite` only after the
first generated cases look sane.
5. Configure generation and grading
- Use Promptfoo's default redteam generation unless a specific generator or
model is needed for reproducibility, cost, or fixture QA.
- When using `redteam.provider: file://...`, make the path valid from the
command working directory; JavaScript providers expose `callApi`, while Python providers expose `call_api` or the function named in a `file://x.py:name` suffix. Run commands from the repo root unless the project convention says otherwise.
- For deterministic QA, use a small local file provider that returns Promptfoo's
expected prompt format.
- Use high-value plugins such as `bola` and `bfla` whenever target evidence
shows object IDs, ownership checks, or authorization boundaries.
- Use `redteam.maxConcurrency: 1` for fragile local providers or rate-limited
targets.
- Add plugin-level `graderGuidance` and `graderExamples` only when default
grading would misunderstand domain-specific allowed behavior.
6. Val
promptfoo is a CLI and library for evaluating and red-teaming LLM apps. Stop the trial-and-error approach - start shipping secure, reliable AI apps. Website · Getting Started · Red Teaming · Documentation · Discord Promptfoo is now part of OpenAI.
Repo: promptfoo/promptfoo
Other skills on promptfoo.
- /promptfoo-evals
Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions, model-graded rubrics, transforms, datasets, exports, and CI gates. Use for non-redteam eval coverage, regression tests, or new eval matrices. Do not use for
Open skill - /redteam-plugin-development
Standards for creating redteam plugins and graders. Use when creating new plugins, writing graders, or modifying attack templates.
Open skill - /search-params
URL search param and hash state management. Use when adding or modifying URL search params, working with useSearchParams, setSearchParams, useSearchParamState, or navigate() with query strings or hash fragments, or fixing browser back/forward button issues.
Open skill - /promptfoo-evals
Write, refine, run, and QA non-redteam promptfoo eval suites after the target or provider already works: prompts, vars, test cases, assertions, model-graded rubrics, transforms, datasets, output exports, filters, and CI gates. Use for regression tests and eval-suite authoring.
Open skill - /promptfoo-provider-setup
Configure promptfoo providers or redteam targets for hosted models, live HTTP APIs, Python/JavaScript local scripts, agent SDKs, or multi-input systems. Use when connecting promptfoo to the system under test, mapping vars, auth env vars, request bodies, response transforms, or
Open skill - /promptfoo-redteam-run
Run, rerun, inspect, and QA promptfoo redteam scans from generated redteam YAML or an existing redteam setup config. Use when executing `promptfoo redteam eval` or `promptfoo redteam run`, exporting results, triaging attack success rate, grader failures, target errors,
Open skill

