Evaluation and QualityStatistical reliabilityPrincipal
What can zero failures in 200 agent trials establish about a rare unauthorized-write rate?
By Amit Kumar3 min readWorked answer includedReviewed 26 Sept 2026
The question
Interview question
A team observes zero unauthorized writes in 200 trials and claims the rate is below one in 10,000. Half the trials are close variants of one task. Derive a one-sided 95 percent upper bound under independent Bernoulli sampling, assess the violated assumptions, and design evidence and enforcement needed before unattended execution.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
Zero observed does not mean zero possible. Under an independent, identically sampled Bernoulli model, if the true failure probability is p, the chance of seeing zero failures in n trials is (1-p)^n. For n = 200, the one-sided 95 percent upper confidence bound solves (1-p)^200 = 0.05, giving p = 1 - 0.05^(1/200) ≈ 0.0149. About 1.49 percent, far above 0.01 percent. To push that bound below 0.01 percent with zero failures would require roughly 30,000 independent representative trials. NIST's exact binomial documentation covers the one-sided method. The arithmetic is a useful sanity check, not a guarantee for an agent whose failures are clustered by task, model version, or tool.
The bound can be understood through the experiment that produced zero failures. At a true rate near 1.49 percent,200 independent trials have about a 5 percent chance of producing no failures. At the proposed one in 10,000 rate, observing zero in 200 is very likely, about 98 percent. The test therefore cannot discriminate that rare target from much larger rates with the claimed assurance. This is a confidence procedure under a sampling model, not a posterior probability assigned to one fixed unknown rate.
The zero-failure sample size for the one in 10,000 target is 29,956 under this calculation, rounded upward. That figure assumes a predeclared experiment with representative independent exposures, a stable system and a detector that observes the defined failure. Generating that many near-duplicate prompts, changing the model halfway through or dropping inconclusive trials does not satisfy those assumptions.
Here half the cases are slight variants. Correlation means 200 lines in a spreadsheet do not necessarily carry 200 independent opportunities to fail.
There is another issue: did these tests even exercise the conditions that allow an unauthorized write? A corpus of safe read-only tasks can produce a perfect result while saying almost nothing about the write boundary. Specify the event first. Does “unauthorized” mean outside delegated scope, above a monetary cap, stale approval, wrong tenant, or an external action after cancellation? Record the attempted action and the actual effect, not just the model's final text.
I would make the release gate a layered argument. Deterministic broker checks enforce permissions for every effect, with adversarial tests around concurrency, revocation, and format changes. Then run scenario tests that deliberately reach each failure path. A separate representative sample estimates ordinary workload risk with intervals, including runs that error or never finish. Human review of the attempted actions checks whether the grader itself misses violations. Keep the statistical statement tied to the sampled population and version. Testing does not replace a hard authorization boundary for a rare, high-consequence effect.
Suppose the team offers ten thousand more synthetic variants of the same prompts. That may catch a narrow regression, but it cannot repair the sampling or oracle problem. Suppose instead they observe zero incidents in a million production requests. The rate might look much smaller, but only if unauthorized actions would have been detected, exposures were counted correctly, and the policy and traffic did not change. I would ask for detection coverage and the relevant high-risk denominator before turning a zero into a safety claim.
Related questions
Keep practising evaluation and quality
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux