Files
wehub-resource-sync 0d3cb498a3
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
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) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
CI / Shell Format Check (push) Waiting to run
CI / Check Ruby (3.4) (push) Waiting to run
CI / CI Config (push) Waiting to run
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Blocked by required conditions
CI / Build on Node ${{ matrix.node }} (push) Blocked by required conditions
CI / Style Check (push) Waiting to run
CI / Generate Assets (push) Waiting to run
CI / Check Python (3.14) (push) Waiting to run
CI / Check Python (3.9) (push) Waiting to run
CI / Build Docs (push) Waiting to run
CI / Code Scan Action (push) Waiting to run
CI / Site tests (push) Waiting to run
CI / webui tests (push) Waiting to run
CI / Run Integration Tests (push) Waiting to run
CI / Run Smoke Tests (push) Waiting to run
CI / Go Tests (push) Waiting to run
CI / Share Test (push) Waiting to run
CI / Redteam (Production API) (push) Waiting to run
CI / Redteam (Staging API) (push) Waiting to run
CI / GitHub Actions Lint (push) Waiting to run
CI / Check Ruby (3.0) (push) Waiting to run
release-please / release-please (push) Waiting to run
release-please / build (push) Blocked by required conditions
release-please / publish-npm (push) Blocked by required conditions
release-please / publish-npm-backfill (push) Waiting to run
release-please / docker (push) Blocked by required conditions
release-please / publish-code-scan-action (push) Blocked by required conditions
release-please / attest-code-scan-action (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00
..

redteam-dalle (DALL-E Red Team Example)

You can run this example with:

npx promptfoo@latest init --example redteam-dalle
cd redteam-dalle

This example demonstrates how to use promptfoo to automatically discover jailbreaks in OpenAI's DALL-E image generation model. It includes pre-configured test cases that attempt to generate various types of harmful content.

⚠️ Warning: Running this example may get your OpenAI account flagged for moderation or banned.

Setup

  1. Set your OpenAI API key:

    export OPENAI_API_KEY=your_key_here
    
  2. Initialize the example:

    npx promptfoo@latest init --example redteam-dalle
    

Usage

  1. Review and optionally modify the test cases in promptfooconfig.yaml. The example includes the same test cases shown in our blog post.

  2. Run the evaluation:

    npx promptfoo@latest eval
    
  3. View the results in the web UI:

    npx promptfoo@latest view
    

    Important table settings:

    • Under TABLE SETTINGS, enable "Render model outputs as Markdown" to display generated images
    • Set "Max text length" to unlimited to view complete responses
    • Click the magnifying glass icon (🔍) in the "View output and test details" column to see the final modified prompt that was used, complete conversation history, and scoring breakdown for each iteration.

Expected Behavior

During evaluation, you may see error messages like:

Error from target provider: 400 Your request was rejected as a result of our safety system.
Error from target provider: 400 This request has been blocked by our content filters.

This is normal expected behavior. Promptfoo automatically retries with modified prompts in a loop until it succeeds or reaches the maximum number of iterations.

Configuration

  • The default configuration uses 4 iterations per test case. To increase this (and potentially find more jailbreaks), set:

    export PROMPTFOO_NUM_JAILBREAK_ITERATIONS=6
    
  • For debugging or to see the internal workings, enable debug logging:

    LOG_LEVEL=debug npx promptfoo@latest eval -j 1
    

Troubleshooting

Note: DALL-E image URLs expire after 2 hours. The example includes an extension hook that downloads images to a local images directory as soon as they are generated. Each image is saved with a filename based on the test description and timestamp.

  • If you get rate limit errors, try reducing concurrency with -j 1
  • If you get timeout errors, the evaluation is still running in the background. Wait a few minutes and check the results
  • For other issues, please check our documentation or file an issue

Learn More

For more details about LLM red teaming with promptfoo, check out: