examples/redteam-foundation-model/README.md
This example uses the same red team tests featured on promptfoo.dev/models.
You can run this example with:
npx promptfoo@latest init --example redteam-foundation-model
cd redteam-foundation-model
npm install -g promptfoo)Create a .env file with your API keys:
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
# Add other provider keys as needed
Important: You must overwrite the default target in the command line. The configuration defaults to openai:chat:gpt-4.1-mini:
promptfoo redteam run --target openrouter:...
promptfoo redteam run --output output.json
This will:
output.json for analysis