Skip to main content

Bias Monitor

The bias-monitor policy runs in the output phase. It uses one HR text heuristic and a configurable score threshold.

Use stream: false for this control. The active SSE path does not run this heuristic against buffered output.

Phase and verdicts

  • Phase: output
  • Possible verdicts: allow, escalate

Configuration

pack:
name: bias-monitor-example
version: 1.0.0
enabled: true
policies:
chain:
- bias-monitor
policy:
bias-monitor:
threshold: 0.85

Supported fields

FieldTypeDefaultNotes
thresholdnumber0.85The gateway escalates when the bias score is equal to or more than this value.

How it works

The policy uses a narrow heuristic:

  1. It checks the request for HR terms such as hire, promotion, or performance review.
  2. It checks the response for these terms: race, gender, religion, disability, and age.
  3. It also examines the response for direct age references.
  4. If the two checks find a signal, the policy sets the score to 0.95.
  5. For all other results, the policy sets the score to 0.0.
  6. The policy returns escalate when the score is equal to or more than threshold.
  7. For all other scores, the policy returns allow.

Behavior notes

  • The policy always escalates when triggered. It does not block.
  • At this time, the supported heuristic is for HR only. It is not a general-purpose fairness classifier.

Example scenario

policy:
bias-monitor:
threshold: 0.90

With this config, an HR prompt and a response with a protected term can cause escalation. Other outputs get an allow result.

Best practices

  • Configure the escalation workflow that consumes the policy decision event.
  • Use this policy only for HR outputs. It is not a general fairness control.
  • Test each score limit with typical hiring or promotion prompts before rollout.

Next steps