Files
promptfoo--promptfoo/site/docs/red-team/plugins/bias.md
T
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00

4.2 KiB

sidebar_label, description
sidebar_label description
Bias Overview Red team AI systems for harmful bias and discrimination across protected characteristics to prevent discriminatory outputs and ensure ethical AI deployment

Bias Detection Plugins

Test whether your AI system produces or reinforces stereotypes, biases, or discrimination across different protected characteristics.

Available Plugins

Plugin Tests for
bias:age Age-based stereotypes and discrimination (details)
bias:disability Disability stereotypes and ableism (details)
bias:gender Gender stereotypes and sexism (details)
bias:race Racial stereotypes and discrimination (details)

Quick Start

Include all bias detection plugins:

redteam:
  plugins:
    - bias

Or select specific plugins:

redteam:
  plugins:
    - bias:age
    - bias:gender
    - bias:race
    - bias:disability

How It Works

Bias detection uses automated red team testing to systematically evaluate AI model responses across protected characteristics:

1. Automated Prompt Generation

The system generates contextual scenarios across hiring, healthcare, education, and workplace domains that systematically test for potential bias triggers in real-world AI applications.

2. Response Analysis

The evaluation engine analyzes AI responses for:

  • Stereotypical assumptions - broad generalizations about groups
  • Discriminatory language - inappropriate terms or outdated terminology
  • Differential treatment - unfair recommendations based on demographics
  • Implicit bias - subtle preferences or assumptions

3. Scoring and Reporting

Each response receives binary pass/fail scoring based on bias detection criteria, with detailed reports identifying specific bias indicators and integration into promptfoo's evaluation framework for longitudinal tracking.

Example

Failing Response: "Older employees typically struggle with new technology and need more hand-holding than younger workers."

Passing Response: "Effective training should be tailored to individual learning preferences and prior experience, regardless of age."

Why This Matters

  • Legal Compliance: Meet anti-discrimination regulations
  • Brand Protection: Avoid reputational damage from biased AI
  • Fairness: Ensure equitable treatment for all users
  • Trust: Build reliable AI systems for diverse populations

Frequently Asked Questions

What is AI bias testing?

AI bias testing is the process of systematically evaluating AI models to identify discriminatory behavior or unfair treatment across protected characteristics like age, gender, race, and disability status.

How do you test an AI model for bias?

Use automated red team testing tools like promptfoo's bias detection plugins to generate targeted prompts and evaluate responses for stereotypes, discriminatory language, and unfair treatment patterns.

How does bias detection work in promptfoo?

Promptfoo generates scenario-based prompts designed to elicit potentially biased responses, then uses evaluation criteria to automatically score whether responses demonstrate bias or maintain fairness.

What types of AI bias can be detected?

The bias detection plugins test for age discrimination, gender stereotypes, racial bias, disability discrimination, and other forms of unfair treatment based on protected characteristics.

How to prevent bias in AI models?

Regular bias testing during development, diverse training data, inclusive design practices, and ongoing monitoring with tools like promptfoo help prevent and detect bias in production AI systems.