Refract Guides · Practical AI safety testing patterns

Refract Power Analysis for Sample Size

Before a large scan, use refract power to estimate how many probes you need for a useful Wilson margin around the expected catch rate.

Why sample size matters

A small battery can produce a wide Wilson interval, so a passing scan may not mean much. Power analysis tells you how many canaries and benign controls to run.

Run a power estimate

For a ±4-point Wilson margin around an expected 90% catch rate, refract asks for 219 probes:

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

Trade off cost and certainty

Wider target margins are cheaper but less convincing. For high-risk guardrails, plan for a narrow margin around the silent-breach and false-positive rates.

Pair with budget cap

Use --budget-tokens N to stop dispatching probes once the estimated token count reaches N, so a broad battery cannot surprise your invoice.

refract scan --target anthropic:claude-opus-5-5 --battery baseline --budget-tokens 120000 --sarif refract.sarif
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.