Demo
Maths
01 RuleFence Stage 1 · Feature rule sheet + rule check
Study p.3 eq.(1) · p.5
Writes down what an applicant can and cannot change, then blocks any form that breaks the sheet.
What it computes
Aε,k (x₀) = { x : xF = x₀F ; xD = g(x) ;
−ℓj ≤ xj − x₀j ≤ uj (j ∈ C) ; ‖xC − x₀C ‖0 ≤ k ;
xj ∈ Vj ; r(x) = 0 ∀ r ∈ R }
uj = min( ρj |x₀j | , absolute limit , ε · rangej ) , ε = 0.10 , k = 3
rule(x) = 1 if a validity domain, a cross-field rule or a derived-feature identity fails → s(x) = ∞
What it catches
Impossible values, off-grid numbers, wallet activity without a wallet, a typed ratio that does not match its inputs. It also defines the attacker's budget: every simulated attack is projected back onto A.
In our study
Without it, detection of unconstrained attacks falls by 0.675 (Table XIV). It cannot see rule-following edits by design; checks 03–08 exist for those. Code: lead_guard.rules.RuleSheet; lead-guard also adds a consistency check (editable fields predicted from fixed ones), which the study kept only in LEAD-U.
02 OnePass Stages 2–3 · Monotone XGBoost + exact TreeSHAP
Study p.5 eq.(6)
One run of the credit model returns the score, the decision and the exact reasons. No second model is needed for the explanation.
What it computes
minf Σi wyi ℓ(yi , f(xi )) + Ω(f)
s.t. σj ∂f/∂xj ≥ 0 ∀ j ∈ M , w₁/w₀ = n₀/n₁
logit f(x) = φ₀ + Σj φj (x) (exact TreeSHAP)
reasons = top-5 features by |φj |
frob : same hyper-parameters, retrained over 3 rounds with rule-following attacked defaulters labelled y = 1
What it catches
Nothing on its own. It is the base every check reads: monotone constraints keep risk directions sensible, and exact attributions make the explanation checks possible in real time.
In our study
Optuna, 50 trials, stratified 5-fold, early stopping at 50 rounds. The full detector adds about one millisecond: median 1.6 ms per application (p.13).
03 ProfileGap Stage 4 (b)+(d) · Input distance, cross-class ratio
Study p.5 eq.(7)–(8)
Measures how far an application sits from typical approved and typical declined customers, taking correlations into account.
What it computes
din (x) = √( (z − μc )⊤ Σc −1 (z − μc ) )
c = predicted class, z = standardised input
Σc = (1 − s) S + s · (tr S / p) · I (Ledoit–Wolf)
s = min(b̄², d²) / d² , chosen from the data
rin (x) = log( (din (c) + δ) / (din (1−c) + δ) ) , δ = 10−3
What it catches
An edited bad application that is now predicted approved but is still shaped like a declined one: far from the approved profile and close to the declined one.
In our study
Table XIV, on the distance checks of LEAD-base: one global profile instead of per class costs −0.141; diagonal covariance −0.128; dropping the input ratio −0.023. Ledoit–Wolf and empirical covariance tie at the study's sample sizes (+0.006).
04 ReasonShift Stage 4 (c)+(d) · Explanation distance, cross-class ratio
Study p.5 eq.(8)
Applies the same distance to the model's reasons. An edited case tends to be approved for unusual reasons.
What it computes
dex (x) = √( (φ(x) − μex c )⊤ (Σex c )−1 (φ(x) − μex c ) )
φ(x) = exact TreeSHAP vector, Σex c Ledoit–Wolf
rex (x) = log( (dex (c) + δ) / (dex (1−c) + δ) )
What it catches
Replaces a count of out-of-band attributions from earlier work: a count can be dodged by editing few features, while a distance adds up every deviation and their correlations.
In our study
Weak alone on minimal flips (removing it raises pooled detection by +0.037), but the explanation checks reach 0.37 on overshooting attacks, so it stays (Fig. 14, p.19).
05 EdgeWatch Stage 4 (f) · Boundary closeness
Study p.5
A minimal attack stops right after crossing the pass mark. EdgeWatch notices approvals that only just made it.
What it computes
m(x) = logit τ − logit f(x)
close(x) rises as |m(x)| shrinks
pclose (x) = (1 + #{v ∈ Vc : close(v) > close(x)}) / (|Vc | + 1)
Vc = clean validation cases of the predicted class
What it catches
Minimal-flip attacks, which land a hair past the line. It is blind to overshooting attacks that aim for a typical good score; SelfSpar covers those.
In our study
The strongest unsupervised check: removing it costs −0.045 detection (p < 0.001, Table XIV).
06 SelfSpar Stage 5 · Attack-likeness from self-simulated attacks
Study pp.5–6 eq.(9)–(11)
LEAD attacks itself under the rule sheet, then learns what its own successful attacks look like. No real fraud data needed.
What it computes
S = successful rule-following attacks on ≤ 300 validation defaulters (minimal-flip and overshoot)
u(x) = ( logit π(x), rule(x), logit f(x), m(x) )
ming Σ wy log(1 + e−(2y−1) g(u(x)) ) , w₁|S| = w₀|VA |
pS (x) = (1 + #{v ∈ VB : g(u(v)) ≥ g(u(x))}) / (|VB | + 1)
What it catches
The kind of abnormality that manipulation leaves, including overshooting attacks the unsupervised checks miss. g is a 60-tree gradient-boosting model in the study; the demo uses logistic regression on two of the inputs.
In our study
The single most important part: removing it (= LEAD-U) costs −0.119 detection. It generalises to genetic and transfer attacks it never simulated.
07 CalibRank Stage 6 · Conformal p-values
Study p.6 eq.(12)
Turns any check score into a p-value by ranking it among honest applications, so every clue speaks the same language.
What it computes
pj (x) = (1 + #{v ∈ Vc : qj (v) > qj (x)}) / (|Vc | + 1)
qj ∈ {din , dex , rin , rex , close}
PrH₀ [ pj ≤ α ] ≤ α for exchangeable honest data, with no assumption about the score's distribution
What it catches
Not a detector by itself. It puts distances, ratios and margins on one scale and makes the false-alarm rate controllable.
In our study
Percentile, z-score and no calibration detect about equally (Table XIV); percentile is kept because it fixes the false-alarm rate.
08 CauchyFuse Stage 6 · Cauchy combination of six p-values
Study pp.6–7 eq.(13)
Merges six correlated clues into one alarm whose false-alarm rate is still right.
What it computes
T(x) = (1/6) Σj tan( (½ − pj ) π )
p(x) = ½ − arctan(T) / π
alarm if T > t ; t = tan( (½ − α) π ) ≈ 6.31 at α = 0.05
deployed: t = 95th percentile of T on VB
s(x) = ∞ if rule(x) = 1, else T(x)
What it catches
Lets one strong clue raise the alarm without being drowned by five quiet ones. The tail approximation holds under any dependence between clues; Fisher's method needs independence.
In our study
Replacing Cauchy with the maximum percentile costs −0.069 detection (Table XIV). The study fuses six p-values; lead-guard’s default fuses seven, because it keeps the consistency check.
09 SafeRoute Stage 7 · Decision routing
Study p.7 eq.(14), Alg. 1
A flag is not a rejection. Flagged applications are decided by a hardened twin model or by a person.
What it computes
ŷ(x) = 1[ f(x) ≥ τ ] if s(x) ≤ t
ŷ(x) = 1[ frob (x) ≥ τrob ] or human review otherwise
alarm = rule(x) = 1 ∨ T(x) > t ∨ κ(x) < κ0.01
every decision ships with its top-5 reasons
What it catches
Turns detection into a safer decision. The 5 in 100 honest applicants who trip the alarm get a second look, not a no.
In our study
Attack success with flagged cases decided by the main model: 0.258; by the robust copy: 0.221 after one round and 0.218 after three (p.19). The three routes approve, second look and decline are lead-guard’s design, not the research code: decline happens only when the credit model itself says no, never because of LEAD.
10 EditTrace Stage 7 · Query monitor
Study p.7 · p.12
A black-box attacker has to ask many near-identical questions. EditTrace notices the cluster.
What it computes
W = last 3,000 queries
κ(x) = mean standardised Euclidean distance from x to its 5 nearest neighbours in W
flag if κ(x) < κ0.01
κ0.01 = 1% quantile on an honest validation stream
What it catches
Query-based black-box attacks before they succeed. It runs beside the detector, so it works whatever detector sits behind it. An attacker who spreads probes over time can slip past it.
In our study
Blocks 0.87–0.94 of query attackers and 0.81 of greedy ones at a cost of 0.009 of legitimate applications; attack success falls from 0.30 to 0.09 (p.12).
11 FairGate Stage 8 · Fairness audit
Study p.7 · Table X p.14
Checks that the defence itself does not single out women or young applicants for second looks.
What it computes
gapFA = | Pr[s > t | G = 1] − Pr[s > t | G = 0] |
G ∈ {sex, age < 25} , target ≤ 0.05
gapEO = | Pr[approve | good, G = 1] − Pr[approve | good, G = 0] |
optional group thresholds τG equalise approval of good applicants
What it catches
A defence that is accurate overall but sends one group to review far more often. Approval and equal-opportunity gaps belong to the credit model and are reported before and after the defence.
In our study
Worst false-alarm gap 0.039 (mean 0.018), under 0.05 in all 8 dataset–group pairs. Group thresholds cut the equal-opportunity gap 0.063 → 0.047 at the same accuracy (0.820).