Promptfoopromptfoo 0.124.1 · Node 24 · Python 3
Dashboard
0%

Red teaming: what promptfoo redteam does

promptfoo redteam turns the tool around: instead of you writing the tests, it generates adversarial ones and attacks a live target. It needs a real provider and a key, so it does not run in this keyless course.

Last updated: 15 Oct, 2026 · Promptfoo 0.124.1

Every check so far ran against an answer you supplied, graded with no key. Red teaming is the opposite shape. You point it at a deployed app, and it writes the attacks itself: jailbreaks, prompt injections, attempts to leak a system prompt or private data. Then it sends them to the target and scores what comes back.

What the subcommands do

The redteam command has its own set of subcommands. They scaffold a config, generate the attacks, run them against a target, and open a report.

bash
# every one of these needs a reachable target and model credentials
promptfoo redteam setup       # a guided first run
promptfoo redteam init        # scaffold a redteam config
promptfoo redteam generate    # write adversarial tests from your config
promptfoo redteam run         # generate, then attack the target
promptfoo redteam eval        # score an attack run

promptfoo redteam discover    # probe a target to learn what it is
promptfoo redteam poison      # build a poisoned-document corpus
promptfoo redteam plugins     # list the attack plugins available
promptfoo redteam report      # open the findings report

There is nothing to capture from them here. Each one reaches out to a target and to a model, so none can run without a reachable endpoint and credentials.

Why it needs a key

The attacks are written by a model, and each reply is scored by a model for whether the attack succeeded. Both calls hit a provider, so there is no keyless path through red teaming the way there is for the checks in the rest of this course. That is the line it sits on the far side of.

Where this fits. For hands-on adversarial testing against a live target, the AI Security course and the PyRIT course on this platform walk through it with real endpoints and keys. This lesson names the command so you know where it lives in promptfoo and why it stays out of a keyless suite.

Where you use red teaming

  • Before a launch, probing a deployed assistant for jailbreaks and injection holes while a key and a target are available.
  • On a schedule against staging, where the endpoint and credentials already exist in the pipeline.
  • Alongside the keyless suite, which gates correctness on every commit while red teaming runs less often against a real target.
Try it yourself
  • Run promptfoo redteam --help to read the full subcommand list without touching a target.
  • Read promptfoo redteam plugins in the documentation to see the attack categories it can generate.
  • Sketch which of your deployed apps have an endpoint and a key a red-team run could reach.

Little by little, you're building something great.