What does Zero Trust for a One-Commander Empire conclude, in numbers, about “Anti-Scraper Defence: Token Buckets and Trap Pages”?

Answer: With ten canaries, a leaked copy of 1,000 records contains at least one with probability 0.0956; a copy of 10,000, 0.6513; a copy of 50,000, 0.9990. With fifty canaries, a copy of 1,000 records gives 0.3951 and a copy of 10,000 gives 0.9949. With two hundred canaries, a copy of 1,000 records gives 0.8663. For a copy of 1,000 records to contain at least one canary with probability 0.95, 298 canaries are needed, and such a copy holds on average 2.980 of them.

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.0956, 0.3951, 0.6513, 0.8663, 0.95, 0.9949

trap pages hfetch 50fetch 500fetch 2,500
50.04900.40960.9688
200.18240.87891.0000
500.39650.99501.0000
people: 2,000 sessions a day x e = 0.0005 -> 1.0 touches a day
P(some person touches a trap in a day) = 0.6322
canaries ccopy 1,000copy 10,000copy 50,000
100.09560.65130.9990
500.39510.99491.0000
2000.86631.00001.0000
canaries needed so a 1,000-row copy shows one with 0.95: 298
expected canaries in that copy: 2.980

Key formula

\[P=1-\frac{\binom{N-h}{n}}{\binom{N}{n}}.\]
Show the full program
# Chapter 5. p52: trap links and canary records, exact detection odds.
# A site has N pages; h of them are trap pages that no visible link,
# sitemap or menu leads to and that the robots rules exclude. A client
# that fetches n distinct pages at random hits at least one trap with
#   P = 1 - C(N - h, n) / C(N, n) = 1 - prod_{i<h} (N - n - i) / (N - i).
# A data set of M records carries c canary records, fake rows unique to
# one account key. A copy of k records found elsewhere holds at least one
# canary with the same formula. People can touch a trap by accident (for
# example through assistive software): rate e per session, illustrative.
import math


def p_hit(total, marked, drawn):
    if drawn > total - marked:
        return 1.0
    miss = 1.0
    for i in range(marked):
        miss = miss * (total - drawn - i) / (total - i)
    return 1.0 - miss


if __name__ == "__main__":
    N = 5000
    print("trap pages h   fetch 50   fetch 500   fetch 2,500")
    for h in (5, 20, 50):
        print("{:>12} {:>10.4f} {:>11.4f} {:>13.4f}".format(
            h, p_hit(N, h, 50), p_hit(N, h, 500), p_hit(N, h, 2500)))
    e, sessions = 0.0005, 2000
    fmt = "people: {:,} sessions a day x e = {} -> {:.1f} touches a day"
    print(fmt.format(sessions, e, sessions * e))
    print("P(some person touches a trap in a day) = {:.4f}".format(
        1.0 - (1.0 - e) ** sessions))
    M = 100000
    print("canaries c   copy 1,000   copy 10,000   copy 50,000")
    for c in (10, 50, 200):
        print("{:>10} {:>12.4f} {:>13.4f} {:>13.4f}".format(
            c, p_hit(M, c, 1000), p_hit(M, c, 10000), p_hit(M, c, 50000)))
    need = [c for c in range(1, 2001) if p_hit(M, c, 1000) >= 0.95][0]
    print("canaries needed so a 1,000-row copy shows one with 0.95: {}"
          .format(need))
    print("expected canaries in that copy: {:.3f}".format(need * 1000 / M))

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 5: Anti-Scraper Defence: Token Buckets and Trap Pages. 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