AI guardrail calculator
Enter four counts to measure caught leaks and false alarms. Compare two runs on the same prompts.
Loading calculator… You can read the example while the controls load.
Save this scenario Unsaved counts. Copy the link to keep them.
Copy scenario link
Share conformance receipt
This receipt uses only the matrix counts and paired comparison counts.
The receipt appears when the interactive tool is ready.
Copy permalink
Copy JSON receipt
Copy Markdown badge
Preview receipt data
The receipt appears when the interactive tool is ready.
Load preset:
Balanced Default (110)
85% Safe Illusion (110)
More presets +
Tiny 10-Prompt Check
Crying-Wolf Filter (110)
Zero-Breach Prod (300)
Enter Your 2×2 Test Counts
n = 110 probes
Counts locked · Read-only
Enter 0–100,000. Sliders stop at 500.
How your filter did
90.0% leaks caught
TPR · 18/20 caught
5.6% false alarms
FPR · 5/90 safe prompts blocked
Overall filter agreement
+0.801
MCC φ · Strong guardrail correlation
78.3% of blocks were leaks
PPV · 18 of 23 blocked probes were leaks
Leak catch rate · Wilson 95% CI
Exact Clopper–Pearson 95%
68.3% – 98.8%
False Positive Rate · Wilson 95% CI
Exact Clopper–Pearson 95%
1.8% – 12.5%
0% 50% 100%
Required n for ±5% Margin (95% Wilson CI)
Precision Planner
At Observed Catch Rate
n = 141 (+121)
At Observed FPR
n = 90 ✓
Worst-Case (p = 0.50)
n = 381
Copy Markdown Scorecard
Download .md Scorecard
Copy SARIF 2.1.0 Sample
Download .sarif.json
Markdown Preview
SARIF 2.1.0 Preview
# Refract 2x2 Guardrail Scorecard
- **Total Probes (`n`):** 110 (90 benign / 20 leak-inducing)
- **CI Policy Gate (`--max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70`):** **FAIL (exit 2)**
| Quadrant | Model Behavior | Guardrail Action | Count |
| --- | --- | --- | ---: |
| **TN** Clean & Safe | Safe | Quiet (ALLOW) | 85 |
| **FP** False Alarm (Crying Wolf) | Safe | Blocked (BLOCK) | 5 |
| **TP** Caught Leak | Leaked | Blocked (BLOCK) | 18 |
| **FN** Silent Breach | Leaked | Missed (ALLOW) | 2 |
## Statistical Diagnostics
- **Leak Catch Rate (TPR):** 90.0% (95% Wilson 69.9% – 97.2%; exact Clopper–Pearson 68.3% – 98.8%)
- **False Positive Rate (FPR):** 5.6% (95% Wilson 2.4% – 12.4%; exact Clopper–Pearson 1.8% – 12.5%)
- **Precision (PPV):** 78.3% (95% Wilson 58.1% – 90.3%; exact Clopper–Pearson 56.3% – 92.5%).
- **CI method note:** These intervals assume independent binomial observations at each denominator. Precision depends on the prevalence of leaks in the sample.
- **MCC φ:** `0.801`
- **Required `n` for ±5% Margin (95% Wilson):** `n = 141` leak probes (need 121 more), `n = 90` benign probes (need 0 more), worst-case `p=0.5` is `n = 381`.
Next: the CLI Lab, 18 commands in 4 steps →
Read the docs
Privacy Controls