Refract Guides · Practical AI safety testing patterns

Wilson Score Intervals in Refract

Small samples can make a guardrail look perfect. Wilson score intervals keep the Refract 2×2 report honest by showing the plausible range around every rate.

The small-sample illusion

If a guardrail catches 10 out of 10 canaries, the observed catch rate is 100%, but the true long-run rate may be much lower. Wilson intervals widen as the sample shrinks.

What Refract reports

Refract reports Wilson 95% bounds for the catch rate and false-positive rate. If the lower bound is too low, you do not yet have enough evidence to ship.

Read the output

refract matrix --intervals prints every rate with its Wilson 95% bounds (exact Clopper-Pearson bounds too). An excerpt:

"catch_rate": 0.9,
"catch_rate_wilson": [0.5958, 0.9821],
"fpr": 0.0667,
"fpr_wilson": [0.0185, 0.2132]

Plan before you spend

Use refract power to choose a sample size that will produce a useful Wilson margin before you spend API budget on a large scan.

refract power --target-half-width 0.04 --p-est 0.90 --confidence 0.95
Related

Refract Power Analysis for Sample Size

How to plan Refract sample sizes with refract power before spending API budget, targeting a Wilson margin around the expected leak or false-positive rate.