What does Zero Trust for a One-Commander Empire conclude, in numbers, about “Closing the Loop: a Monthly Check-up and Pre-Registered Tests”?

Answer: Test one needs 67 incidents under the normal approximation, with the null hypothesis rejected if at least 41 have a credential as root cause. But the exact binomial power at that size is only 0.7841, short of 0.8. Searching upwards, the first sample size whose exact power reaches the target is 69 incidents, with a threshold of 42 and a power of 0.8021. The protocol registers 69 incidents.

Scope of the numbers: The book is defensive only and describes no attack, intrusion, bypass or evasion technique; all hosts, domains and tokens are synthetic, parameters are illustrative, and all calculations are generated by its programs. It is general business analysis, not a security audit or legal advice, and any production change requires human review and sign-off.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.7841, 0.8, 0.8021, 41, 42, 67

test 1: incidents needed n67
reject H0 if >41 credential-rooted; exact power 0.7841
first n with exact power >0.8: 69, reject at >= 42, power 0.8021
test 2: shops per arm n435 (total 870)
test 3: paired drills n32
z values1.6449 1.9600 0.8416
Show the full program
# Chapter 8. p82: sample sizes for the pre-registered tests.
# Test 1 (core claim): among incidents at small tunneled shops, the share
# whose root cause is a credential exceeds one half. H0 p = 0.5,
# H1 p = 0.65, one-sided alpha 0.05, power 0.8. Normal approximation:
#   n = ((z_a sqrt(p0 q0) + z_b sqrt(p1 q1)) / (p1 - p0))^2,
# then exact binomial power at that n (sum of binomial terms by fsum).
# Test 2 (intervention): yearly rate of incidents with loss, 0.10 in
# shops that keep broad long-lived tokens versus 0.05 in shops that move
# to scoped short-lived tokens; two-sided alpha 0.05, power 0.8:
#   n = (z_{a/2} sqrt(2 pbar qbar) + z_b sqrt(p1 q1 + p2 q2))^2 / d^2.
# Test 3 (drill): paired log-ratio of stop-bleed times before and after
# scripting, SD of differences 1.0 (illustrative), detect a shift of
# 0.5: n = ((z_{a/2} + z_b) sd / shift)^2. All effect sizes illustrative.
import math
from statistics import NormalDist

Z = NormalDist()


def n_one(p0, p1, alpha, power):
    za, zb = Z.inv_cdf(1.0 - alpha), Z.inv_cdf(power)
    top = math.fsum([za * math.sqrt(p0 * (1.0 - p0)),
                     zb * math.sqrt(p1 * (1.0 - p1))])
    return math.ceil((top / (p1 - p0)) ** 2)


def exact_power(n, p0, p1, alpha):
    tail = [math.comb(n, k) * p0 ** k * (1.0 - p0) ** (n - k)
            for k in range(n + 1)]
    crit = next(c for c in range(n + 1)
                if math.fsum(tail[c:]) <= alpha)
    return crit, math.fsum(math.comb(n, k) * p1 ** k * (1.0 - p1) **
                           (n - k) for k in range(crit, n + 1))


def n_two(p1, p2, alpha, power):
    za, zb = Z.inv_cdf(1.0 - alpha / 2.0), Z.inv_cdf(power)
    pbar = (p1 + p2) / 2.0
    top = math.fsum([za * math.sqrt(2.0 * pbar * (1.0 - pbar)),
                     zb * math.sqrt(math.fsum([p1 * (1.0 - p1),
                                               p2 * (1.0 - p2)]))])
    return math.ceil((top / (p1 - p2)) ** 2)


if __name__ == "__main__":
    n1 = n_one(0.5, 0.65, 0.05, 0.8)
    crit, pw = exact_power(n1, 0.5, 0.65, 0.05)
    print("test 1: incidents needed n = {}".format(n1))
    print("        reject H0 if >= {} credential-rooted; exact power {:.4f}"
          .format(crit, pw))
    n_ex = n1
    while exact_power(n_ex, 0.5, 0.65, 0.05)[1] < 0.8:
        n_ex = n_ex + 1
    c_ex, p_ex = exact_power(n_ex, 0.5, 0.65, 0.05)
    print("        first n with exact power >= 0.8: {}, reject at >= {},"
          " power {:.4f}".format(n_ex, c_ex, p_ex))
    n2 = n_two(0.10, 0.05, 0.05, 0.8)
    print("test 2: shops per arm n = {:,} (total {:,})".format(n2, 2 * n2))
    za, zb = Z.inv_cdf(0.975), Z.inv_cdf(0.8)
    n3 = math.ceil(((za + zb) * 1.0 / 0.5) ** 2)
    print("test 3: paired drills n = {}".format(n3))
    print("z values: {:.4f} {:.4f} {:.4f}".format(Z.inv_cdf(0.95), za, zb))

Single source and citation

Fan, Y. (2026). Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense (Version 1.0.0), Chapter 8: Closing the Loop: a Monthly Check-up and Pre-Registered Tests. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-336 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026336,
  author    = {Fan, Yafu},
  title     = {Zero-Trust Cybersecurity for a One-Commander Silicon Empire: Origin Cloaking, Secret Hygiene and Anti-Scraper Defense},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book