Refract Guides · Practical AI safety testing patterns

McNemar Test for Paired Refract Verdicts

When the same probes are scored before and after a prompt change, McNemar's test tells you whether the change is real or just noise from paired disagreements.

Why paired data matters

Refract runs the same canary and benign pack against baseline and candidate targets. Paired verdicts remove between-probe variability and isolate what the prompt or filter edit changed.

When to use McNemar

Use McNemar when one cell, usually silent breaches or false positives, moves in opposite directions across the two runs. It tests whether the disagreement pattern is statistically meaningful.

Compare two scans

refract diff pairs the two runs probe by probe and reports the exact McNemar p-value automatically; there is no extra flag.

refract diff --baseline scan-a1b2c3d4 --candidate scan-z9y8x7w6 --db ./runs.sqlite

Use with Wilson intervals

McNemar answers whether a change is significant; Wilson intervals show the plausible range of the new rate. Report both before shipping.

Related

Wilson Score Intervals in Refract

How Refract uses Wilson 95% confidence intervals to keep small AI safety samples honest and how to read catch-rate and false-positive bounds.