Skip to content

Constant-Verdict Substitution for Security Cascade Audits

Pin a routed security stage's verdicts to constant malicious and benign outputs beside deletion to bound reachable decisions and catch dead stages.

Constant-verdict substitution audits a routed stage in a layered prompt-injection gateway by pinning its verdicts to constant malicious and benign outputs. Routing, thresholds, and enforcement stay fixed, so the two constant runs isolate what the stage's own verdicts can reach. This technique pays off in stateless, fail-closed cascades with concentrated routing or tight release rules, paired with deletion and per-stage model monitoring. On the BARBICAN Model Context Protocol gateway over 25,000 balanced prompts, deleting the neural arbitrator shifted 12 to 674 decisions depending on how off was defined (Abasıkeleş-Turgut and Gümüş, 2026, arXiv:2610.33198v2). Constant substitution on the same stage showed its verdicts could alter at most 152 decisions, every one an attack (arXiv:2610.33198v2).

When constant-verdict substitution applies

Three conditions decide whether constant substitution adds signal beyond plain leave-one-out deletion.

  • Upstream routing concentrates attacks in the stage's band, or a fail-closed rule narrows releases. Where the band is balanced and most inputs remain releasable, deletion and substitution agree: "With a balanced band and a release rule that admits most of it, neither operation misleads." (arXiv:2610.33198v2, §5.6).
  • The pipeline is stateless across requests. The formal bound assumes no per-user or rolling state carries one decision into later routing or thresholds (arXiv:2610.33198v2, §4.2, §7).
  • You run substitution alongside deletion, model monitors, and regression tests. The evidence rests on one instrumented gateway from the authors' own group (20,519 in-house synthetic prompts plus 4,481 public records) and a simulated cascade of public classifiers (arXiv:2610.33198v2, §4.4, §7).

Four ablation operations and the admissible set

In a sample of 19 layered prompt-injection defenses, 16 attributed stage contributions by removing or isolating components. Zero reported the class balance reaching later stages, and one stated what deletion does with a deleted stage's inputs (arXiv:2610.33198v2, §2.1, Table 1). Separating four operations resolves that ambiguity (arXiv:2610.33198v2, §4.1):

  • Deletion switches the stage off and routes its band to a fail-open, fail-closed, or fallback path.
  • Substitution calls the stage as normal, overwrites its verdict with always-malicious or always-benign, and leaves routing and release rules intact.
  • Repair fixes a known defect inside the stage (such as a tokenizer mismatch) to test whether system output tracks stage quality.
  • Transplant drops a stronger, independently validated classifier into the stage to separate position limits from model weakness.

Let B be the inputs routed to the stage, π their malicious share, and A the admissible set of band inputs a benign verdict can release. Under Observation 1, any two verdict functions differ only on A. Over the always-malicious constant, no classifier can add more than |A_ben| correct decisions. Over the better constant, it adds at most min(|A_ben|, |A_mal|) (arXiv:2610.33198v2, §4.2). Two live runs (control and always-benign, with always-malicious derived by blocking B) yield every count.

Operation on BARBICAN (25,000 prompts) Changed Recall (%) FPR (%) What it reveals
Control (Base, \|B\| = 7,453, π = 96.82%) — 80.67 4.16 Baseline; \|A\| = 152, \|A_ben\| = 0
Fail-open deletion (Rem-Arb) 674 75.29 4.15 Mixes arbitrator with fail-closed review policy
Fail-closed deletion (Rem-Arb-FC, platform 2) 135 — — Missing verdict falls through review release rules
Positive constant (Sub-Pos, gateway fallback) 12 80.77 4.16 Always blocking beats the arbitrator (0/12, p = 5e-4)
Negative constant (Sub-Neg) 140 79.55 4.16 Releases 140 more attacks (all 152 in A)
Tokenizer repair (Repair) 55 80.34 4.16 Corpus AUC rises 0.392 to 0.855; recall drops
Prompt Guard 2 in arbitration (platform 2) 16 80.74 4.16 Band AUC 0.916; 0 of 202 benign verdicts released
Prompt Guard 2 in semantic tier (platform 2) 1,015 81.31 3.69 Upstream position changes about 60x more decisions

Source: arXiv:2610.33198v2, Tables 4, 5, 6 and Figure 2. Fail-closed deletion and transplants compare against the second platform's control (band 7,452, arbitrator AUC 0.368).

To keep cascade ablations interpretable, pair every deletion with three items: band composition (|B|, π, |A|, |A_ben|), explicit deletion semantics and internal-state mapping, and both constant substitutions (arXiv:2610.33198v2, §6).

The CI substitution gate

Treating constant and random verdicts as stage-level mutants turns substitution into a continuous-integration gate (Algorithm 1, arXiv:2610.33198v2, §4.3, §5.7). Run control and negative-constant substitution on the benchmark, then derive the positive constant by blocking every band input. Compare both constants against control with exact McNemar tests at Bonferroni level α/2. Flag the build if either constant matches or beats the stage (p >= α/2 or constant wins at least as many discordant cases). When |A_ben| meets a threshold τ (τ = 25 selected on half of the simulation bands), run m random mutants at the stage's positive rate. Flag if fewer than (1 - α)m are killed as worse, or if more than αm are killed as better.

The authors evaluated this gate across 42 held-out positions of a public-classifier cascade (Prompt Guard 2 86M router with Llama Guard 3 1B and ProtectAI v2 arbitrators) seeded with four faults (arXiv:2610.33198v2, §5.7, Table 8). The gate raised zero false alarms across all 17 healthy stages that beat both constants. It was the sole check to detect a closed release rule at all 42 positions, compared with 20 of 42 for an aggregate regression check and 0 of 42 for a band-AUC monitor. Across six BARBICAN history commits, the gate flagged unreachable verdicts from commit cafbc71 onward after memory cleaning drove |A_ben| from 3,309 to 0 (Table 9). On the same history, the band-AUC monitor caught the tokenizer fault across all three affected commits (band AUC 0.55, 0.47, and 0.37 against 0.80 before and 0.79 after repair).

Why it works

In a fail-closed cascade, every routed input outside A ends in a block regardless of what the stage predicts. Deletion removes that wrapper by changing band status and triggering fail-open or fallback paths. That single change produced a 56-fold spread on one unchanged arbitrator (arXiv:2610.33198v2, §5.2). Pinning verdicts to constants keeps the routing and release wrapper untouched and isolates the set A where the stage can move the outcome.

This is a layered-architecture instance of causal attribution under fixed context. Interpretability research reaches the same rule with optimal ablation, which "sets a component's value to a constant that minimizes the expected loss of the ablated model" to avoid off-distribution distortion from zeroing or removing components (Li and Janson, 2024, arXiv:2409.09951v1, §1). When upstream filtering concentrates attacks, prior shift also hurts downstream classifiers at global thresholds. On the public cascade, Llama Guard 3 fell behind the better constant past a 0.74 to 0.88 band base rate depending on the release rule, a failure constant substitution exposes directly (arXiv:2610.33198v2, §5.6).

When this backfires

  • Stateful cascades break the bound. Observation 1 assumes no state carries one verdict into later routing. Substituting BARBICAN's post-allow escalation triggered a per-user reputation rule and required trace computation instead (arXiv:2610.33198v2, §7).
  • Substituting the gate for model and regression monitors misses model defects. Across the 42 held-out cascade positions, band-AUC monitoring caught more rank inversions (36 vs 31) and noise faults (36 vs 29), and aggregate regression caught more threshold drifts (15 vs 8) where the degraded stage still beat both constants (arXiv:2610.33198v2, Table 8).
  • Balanced bands and minority-class stages rarely diverge. Deletion and substitution agreed on BARBICAN's post-allow escalation and on balanced public-cascade bands with permissive release rules, where mutant runs add CI cost without reversing the verdict (arXiv:2610.33198v2, §5.5–5.6, Table 7).
  • Zero admissible benign inputs does not prove the stage has no other effect. SafeHarness flags every routed input on regex match before consulting its LLM stage (A empty for the flag), yet the stage still rewrites text passed to the agent (arXiv:2610.33198v2, §5.6).
  • Prompt corpora differ from live agent execution. The study classifies static prompts rather than running agent tasks. Repeating the sweep on the 6,484 records outside the authors' generator reproduced concentrated-band losses at 88 of 90 positions and yielded no balanced bands (arXiv:2610.33198v2, §5.6, §7). Even optimal constant ablation "does not entirely eliminate the contribution of information spoofing" (arXiv:2409.09951v1, Appendix A).

Example

Applying Algorithm 1 (arXiv:2610.33198v2, §5.7) takes three inputs from two live benchmark runs (control Base and negative-constant Sub-Neg) plus the labels y for the routed band B.

from scipy.stats import binomtest

def substitution_gate(band_labels, ctrl_released, neg_released, alpha=0.05, tau=25):
    """Evaluate Algorithm 1 constant-mutant checks from control and Sub-Neg traces."""
    admissible = [i for i, rel in enumerate(neg_released) if rel]
    a_ben = sum(1 for i in admissible if band_labels[i] == 0)
    a_mal = len(admissible) - a_ben

    # Positive constant blocks all of B (derived from control).
    # Discordant counts vs control: nb (control right, constant wrong), nc (reverse).
    pos_nb = sum(1 for i, rel in enumerate(ctrl_released) if rel and band_labels[i] == 0)
    pos_nc = sum(1 for i, rel in enumerate(ctrl_released) if rel and band_labels[i] == 1)

    # Negative constant releases all of A; differs from control on A \ ctrl_released.
    neg_nb = sum(1 for i in admissible if not ctrl_released[i] and band_labels[i] == 1)
    neg_nc = sum(1 for i in admissible if not ctrl_released[i] and band_labels[i] == 0)

    flags = []
    alpha_bonf = alpha / 2
    for name, nb, nc in [("pos", pos_nb, pos_nc), ("neg", neg_nb, neg_nc)]:
        p = binomtest(nb, nb + nc, 0.5).pvalue if (nb + nc) > 0 else 1.0
        if p >= alpha_bonf or nc >= nb:
            flags.append(f"constant mutant {name} survives (nb={nb}, nc={nc}, p={p:.4g})")

    return {
        "band_size": len(band_labels),
        "admissible_size": len(admissible),
        "a_ben": a_ben,
        "a_mal": a_mal,
        "run_random_mutants": a_ben >= tau,
        "flags": flags,
    }

On BARBICAN's evaluated commit (b39f9710, Table 4 and Table 5 of arXiv:2610.33198v2), |B| = 7,453, Sub-Neg releases 152 inputs (all malicious, so a_ben = 0, a_mal = 152), and Base releases 12 of those attacks:

band_size: 7453 | admissible_size: 152 | a_ben: 0 | a_mal: 152
run_random_mutants: False
flags: ['constant mutant pos survives (nb=0, nc=12, p=0.0004883)']

The gate fails on the constant check: the positive constant beats the arbitrator (nc = 12 > nb = 0) and a_ben = 0 proves no classifier in that slot can gain a correct decision over the positive constant without changing the upstream routing or release rule.

Key Takeaways

  • Pair every leave-one-out deletion of a routed security stage with both constant-verdict substitutions (always malicious and always benign), the band base rate π, the admissible-set counts (|A|, |A_ben|), and explicit deletion semantics.
  • Check |A_ben| before spending effort tuning or swapping a downstream classifier. When |A_ben| = 0, no classifier in that position can beat the always-malicious constant on correct decisions. Increasing that ceiling requires changing the upstream routing or release rule.
  • Wire Algorithm 1 into CI alongside a band-AUC monitor and an aggregate regression check. Each catches a distinct fault class: closed release rules, model degradation, and partial threshold drift.
  • Keep a stage flagged with |A_ben| = 0 only when you explicitly declare another role for it, such as rewriting payload text passed downstream.