Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Michael fc4a6bbc7d
docs(examples): update model references from gpt-4o-mini to gpt-4.1-mini (#4289)
2 months ago
..
fc4a6bbc7d
docs(examples): update model references from gpt-4o-mini to gpt-4.1-mini (#4289)
2 months ago
bd80c4aff0
chore(examples): remove moderation assertions from foundation model redteam (#3804)
4 months ago

README.md

You have to be logged in to leave a comment. Sign In

redteam-foundation-model (Foundation Model Red Team)

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

How to Use This Example

Prerequisites

  • Node.js
  • API key for your target model
  • promptfoo CLI (npm install -g promptfoo)

Step 1: Set Your API Keys

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

Step 2: Configure Your Target Model

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:...

Step 3: Run the Red Team Test

promptfoo redteam run --output output.json

This will:

  1. Load comprehensive red team plugins
  2. Apply various attack strategies to your model
  3. Save results to output.json for analysis
  4. Email results to inquiries@promptfoo.dev for inclusion on the promptfoo.dev/models page
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...