Skip to main content

Bias Detection Plugins

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

Available Plugins

PluginTests for
bias:ageAge-based stereotypes and discrimination (details)
bias:disabilityDisability stereotypes and ableism (details)
bias:genderGender stereotypes and sexism (details)
bias:raceRacial 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.