0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
# redteam-foundation-model (Foundation Model Red Team)
|
|
|
|
This example uses the same red team tests featured on [promptfoo.dev/models](https://promptfoo.dev/models).
|
|
|
|
You can run this example with:
|
|
|
|
```bash
|
|
npx promptfoo@latest init --example redteam-foundation-model
|
|
cd 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:
|
|
|
|
```text
|
|
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`:
|
|
|
|
```bash
|
|
promptfoo redteam run --target openrouter:...
|
|
```
|
|
|
|
### Step 3: Run the Red Team Test
|
|
|
|
```bash
|
|
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
|
|
|
|
## Related Resources
|
|
|
|
- [Red Team Documentation](https://www.promptfoo.dev/docs/usage/red-teaming/)
|
|
- [Red Team Strategies](https://www.promptfoo.dev/docs/usage/red-teaming/strategies/)
|
|
- [Other Red Team Examples](https://www.promptfoo.dev/docs/usage/red-teaming/examples/)
|