Red-team sample size: zero violations does not equal a low leakage rate
Start here
The HiveTrace Red team wrote on Habr about how to plan sample sizes when red-teaming AI applications. Using a 0.3% leakage threshold as an example, the article points out that with zero violations, at least 998 independent requests are needed to confirm that the leakage frequency is below that level. Methodologically, it calculates a one-sided 95% Clopper-Pearson confidence upper bound for independent binary outcomes: with 10 requests and zero violations, the attack success rate (ASR) is 0%, but the confidence upper bound is about 25.89%, showing that finding no violations does not equal being able to confirm a low leakage rate. A comparison table in the article also shows that a 1% threshold requires about 299 requests, and a 0.1% threshold requires more samples.
Generated by AI from reports · Updated 2026-10-25
Progress timeline
- ХабрHow many samples are needed to test the safety of an AI application
The HiveTrace Red team, in a post on Habr, presented a sample-size planning method for red-team testing AI applications. Using a 0.3% leakage threshold as an example, at least 998 independent requests are needed with zero violations to confirm that the leakage frequency is below that level. Methodologically, a one-sided 95% Clopper-Pearson confidence upper bound is calculated for independent binary outcomes; with 10 requests and zero violations, the attack success rate (ASR) is 0% but the upper bound is about 25.89%, showing that not finding a violation does not equal being able to confirm a low leakage rate; the comparison table in the article shows that a 1% threshold requires about 299 requests and 0.1% about 2995. The article suggests first defining the violation criterion, metric and threshold, then calculating the minimum number of requests; passing or not depends on whether the upper bound is strictly below the threshold rather than on the ASR itself; at the same number of requests, adding independent requests narrows the upper bound more than repeated attempts; its product HiveTrace Red has more than 90 built-in attack classes for enhanced testing.