Refract Guides · Practical AI safety testing patterns

Refract 2×2 Matrix: Detect vs Complete Explained

The Refract 2×2 matrix is the fastest way to see whether your AI leaks, your guardrail overblocks, or both. Each probe produces two verdicts: what the model did and what the filter allowed.

The four cells

Refract pairs every adversarial probe with a benign control and records two signals. The model either leaks or completes safely; the guardrail either alerts or stays quiet. That gives four outcomes.

Why one number hides the problem

A 90% catch rate can look good while the guardrail blocks 20% of safe users. A low false-positive rate can hide a serious silent breach. Refract keeps the cells separate so both risks are visible.

Print the matrix

refract matrix --scan scan-a1b2c3d4 --db ./runs.sqlite --intervals

Gate the matrix

In CI, fail the build when the matrix crosses a risk threshold.

refract gate --scan scan-a1b2c3d4 --db ./runs.sqlite --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
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.

Related

Silent Breach Detection with Refract

How Refract detects AI silent breaches, canary leaks that a guardrail misses, using synthetic high-entropy canaries, benign controls, and SARIF 2.1.0 CI gating.