A malware detector that flags a file should tell the analyst why. The same explanation also tells a malware author what to change. This proposal starts from one observation. For the strongest kind of faithful explanation, a "sufficient reason" (a set of input features whose current values alone guarantee the verdict, whatever the other features do), the explanation can hide an attacker's cheap escape route only when no such route exists. Whether a detection can be explained safely therefore reduces to whether that sample is robust against the attacker's realistic edits. Both questions can be decided exactly with mixed-integer linear programming (MILP), which encodes each ReLU neuron's on/off switch as a binary variable so that an off-the-shelf solver can search every input in a region.
We propose to build and evaluate this link on Windows malware benchmarks (EMBER, BODMAS). For each flagged sample, the system either produces a certified explanation that uses only features the attacker cannot cheaply change, or reports that no such explanation exists. In the second case it quantifies the least amount of evasion hinting that any faithful explanation must carry. Releasing an explanation then becomes a decision backed by a proof rather than a judgment call. We also test whether training detectors to be robust under a semantics-preserving threat model raises the fraction of detections that can be explained this way.
Core Claim
Let $f$ be a ReLU detector, $x$ a sample it flags as malicious, and $C$ the set of features an attacker can change without breaking the program. Examples are adding unused imports, appending bytes that shift the byte histogram, and editing timestamp or debug fields. The attacker's feasible region $A(x)$ is the set of vectors reachable by such edits. A feature set $S$ is a sufficient reason if
$$f(x') = \text{malicious} \quad \text{for all } x' \in D(x) \text{ with } x'_S = x_S,$$
where $D(x)$ lets features outside $C$ range over their full valid domain and lets features in $C$ range over attacker-feasible values. Call $S$ evasion-inert if $S \cap C = \emptyset$.
The argument is short. Suppose some feasible evasion $x' \in A(x)$ exists. Then $x'$ agrees with $x$ on every feature it did not change, so any sufficient reason must contain a feature that $x'$ changed, and that feature lies in $C$. Conversely, if no feasible evasion exists, the complement of $C$ is itself a sufficient reason, and a minimal inert explanation can be found inside it. A detection therefore admits an evasion-inert explanation exactly when it is certifiably robust under the threat model.
This is a specialization of the known hitting-set duality between sufficient and contrastive explanations in formal explainability. We do not claim the lemma as the contribution. The contribution is to make it operational for security detectors. That means encoding executable-file constraints into the MILP, measuring how often safe explanation is possible, choosing minimal-hint explanations when it is not, and testing empirically whether certified-inert explanations actually deny attackers any uplift.
Relation to Prior Work
Four lines of work motivate the proposal. The first shows that explanations leak. Exploring Counterfactual Explanations Through the Lens of Adversarial Examples shows that counterfactuals and adversarial examples follow the same optimization paths. From Counterfactuals to Trees and Model extraction from counterfactual explanations turn released counterfactuals into near-complete model clones. Both focus on extraction from recourse in tabular settings. We focus on evasion from sufficient reasons in malware, where the attacker wants one passing file rather than a clone.
The second line contains two defenses, and each is built for a different object than ours. Models That Are Interpretable But Not Transparent picks faithful sufficient conditions with small training-set support for OR-of-AND rule models. It reasons over discrete rules and uses support as a proxy for leakage. We reason over ReLU networks and use a certified, attacker-specific notion of leakage. XRand perturbs SHAP rankings with local differential privacy against explanation-guided backdoors on EMBER. Its guarantee is statistical and concerns rankings, whereas ours is deterministic and concerns sufficiency.
The third line supplies methods. The Big-$M$ encoding of Evaluating Robustness of Neural Networks with Mixed Integer Programming is our exact sufficiency and robustness oracle. FAME computes minimal formal sufficient reasons by pruning features in batches with linear-relaxation bounds and then refining exactly. We reuse that two-phase scheme, but FAME is security-blind and was tested only on vision. Interval Abstractions for Robust Counterfactual Explanations and Counterfactual Explanations and Model Multiplicity: a Relational Verification View show that MILP-certified explanations are practical on tabular networks. They treat robustness purely as a benefit to the user. The research file points out that certified-robust counterfactuals are also certified, transferable evasion vectors, and that tension is why we release sufficient reasons rather than counterfactuals.
The fourth line constrains the design. Case Study: Neural Network Malware Detection Verification verifies malware classifiers on BODMAS with reachability tools. It reports 96% certified robust accuracy when only discrete and continuous features are perturbed by 0.1%, and 19% when all features are perturbed. It also notes that arbitrary perturbations of binary features produce invalid files. These numbers suggest that the share of safely explainable detections depends heavily on how realistic the threat model is, so our threat-model constraints must be explicit and linear. Logically Explainable Malware Detection shows that rule-based detectors reach about 92% accuracy on EMBER. Their published rules, however, hand attackers an inversion recipe.
Research Program
The first component is a threat-model library written as linear constraints over EMBER/BODMAS feature vectors. Add-only edits become monotone constraints on binary import and section indicators. Byte appending becomes linear coupling between the byte histogram, the entropy bins we can bound linearly, and the file-size fields. Header fields that do not affect execution become free variables. Functionality-bearing features become fixed. We will define three nested threat models, from conservative to aggressive, because the case-study numbers show that the conclusions depend on this choice. Where tooling allows, we will realize a sample of the solver's feature-space evasions as actual modified binaries, to check that the constraints are not wildly optimistic.
The second component is the explainer. For a flagged $x$, one MILP decides robustness over $A(x)$. If $x$ is robust, we compute a minimal sufficient reason inside the non-controllable features. Each deletion step is checked with MILP, and FAME-style linear-relaxation batch pruning certifies whole groups of irrelevant features first. If $x$ is not robust, no inert explanation exists. The system then either withholds the explanation externally or releases the sufficient reason with the fewest controllable features. Finding that reason is a minimum-cost hitting problem, solved by integer programming over controllable features, with MILP sufficiency checks done lazily. Internally, the analyst is told that the sample is evadable and is shown the solver's concrete evasion witness, which is useful forensic information in its own right.
The third component is training. We will train ReLU detectors with adversarial training under each threat model. We then measure how the safe-explainability rate (the fraction of true detections that admit an inert explanation) trades off against clean accuracy. The lemma predicts that the safe-explainability rate equals certified robust accuracy under the threat model. The empirical question is how high both can be pushed before detection accuracy suffers.
Baselines
The naive reference point is label-only release, the "do nothing" policy. An attacker who sees only the verdict must search for evasions blind. Every explanation policy is scored by how much it raises the attacker's evasion success and how much it lowers the queries the attacker needs, relative to this floor. An inert explanation should match the floor while still giving the analyst content.
The strongest existing competitor for explanation-guided attacks on EMBER is XRand. It reports that attack success rate fell from 77.8% to 10.2% at privacy budget $\epsilon = 1.0$ for LightGBM with 1% poisoning. That figure concerns backdoor poisoning, not evasion, and we found no reported evasion result for XRand on Lacuna. We will therefore run XRand's randomized top-$k$ rankings on our ReLU detectors, sweeping $\epsilon$ with the same tuning budget we give our method, and attack it with the same explanation-guided evasion attacker. Beating XRand means equal or lower attacker uplift at equal or higher explanation faithfulness, where faithfulness is the fraction of released explanations that our MILP verifies as sufficient.
Raw top-$k$ KernelSHAP, run on the same detector, is the standard practice in security tooling and is the case of maximal leakage. Security-blind minimal sufficient reasons, computed by the same FAME-style pipeline but without the inert objective, form the ablation that isolates our key ingredient. Any difference between this ablation and our method is attributable to the choice of which faithful explanation to release, not to verification itself. A second ablation drops the executable-file constraints and uses a plain box perturbation model. This tests whether the semantic encoding changes which samples are classed safe.
The Tailored-LEN rule detector from Logically Explainable Malware Detection, at about 92% accuracy, serves as the inherently interpretable reference. All neural models share training data splits and architecture families. Verification runs use a fixed per-sample solver time limit, and timeouts are reported as "not certified" rather than dropped.
Why not just…?
Why not just filter SHAP attributions to non-controllable features? This is the closest cheap alternative and it does capture the intuition. It has no guarantee of sufficiency, however, and the lemma says that for any non-robust sample a filtered explanation is necessarily unfaithful. It will silently claim that features justify a verdict the attacker can flip. We will measure this directly by running the MILP sufficiency check on filtered SHAP outputs and reporting their false-sufficiency rate, in the spirit of the non-zero false positive rates Models That Are Interpretable But Not Transparent found for LIME. If filtered SHAP turns out to be nearly always sufficient on robust samples, it becomes a cheap practical approximation. Our certificate then remains the only way to know which samples those are.
Why not just add differential-privacy noise, as XRand does? Noise trades faithfulness for secrecy on every sample, including samples where faithful release is provably harmless. DualCF results in the file indicate that noisy counterfactuals still allow boundary capture under repeated queries. Our experiments compare uplift and faithfulness jointly. If XRand reaches near-floor uplift with comparable faithfulness, that is a real threat and we will report it. The lemma predicts that it cannot do so on evadable samples without becoming unfaithful.
Why not just keep explanations inside the security operations center? If explanations never reach submitters, there is no leak, and for purely internal analyst workflows this objection wins. Our regime is the one where explanations do leave the organization: cloud scanning services that return reasons, and vendors of falsely flagged legitimate software disputing a verdict. Even internally, the robustness certificate and evasion witness tell the analyst which detections are fragile, which plain explanations do not.
Why not just robust-train the detector and use any explainer? By the lemma, robust training is the main way to raise the safe-explainability rate, so it is part of our program rather than a rival. It does not remove the need for selection. Security-blind minimal explanations on robust samples may still include controllable features that hint at near-evasions under a slightly stronger attacker. The security-blind ablation, scored under the next threat model up, measures this.
Proposed Experiments
On EMBER and BODMAS, with small ReLU detectors comparable to EmberNN and the case-study architectures, we will report six quantities for each of the three threat models: safe-explainability rate, explanation size, verified faithfulness, solver time, and the evasion success and query count of an explanation-guided attacker. That attacker restricts a search over feasible edits to the controllable features named in the explanation, and also exploits rankings when given SHAP or XRand output. The attacker receives up to a fixed query budget per sample. We found no reported result on Lacuna for explanation-guided evasion uplift on EMBER, so the label-only floor is established by us.
The first decisive check is the lemma's empirical consequence. The safe-explainability rate should equal certified robust accuracy exactly, and on robust samples the uplift from inert explanations over label-only release should be statistically indistinguishable from zero, while SHAP and security-blind minimal explanations show positive uplift. The second check is the training curve. If adversarial training under the realistic threat model raises the safe-explainability rate substantially, say from a baseline near the case study's 19% (all features perturbed) toward its 96% (restricted features), while keeping accuracy within a few points of the roughly 92% rule-detector reference, the approach is practical. If accuracy collapses first, the honest conclusion is that faithful external explanation of most malware detections is incompatible with security under that threat model, which is itself worth establishing. The third check is scale. Using FAME's reported 185s-to-7.42s gain on GTSRB as the expectation for batch pruning, we will report the fraction of samples certified within the time limit as network width grows. We will treat a timeout rate above a quarter of samples as evidence that the method stays confined to small detectors.
References
- Exploring Counterfactual Explanations Through the Lens of Adversarial Examples: A Theoretical and Empirical Analysis
- From Counterfactuals to Trees: Competitive Analysis of Model Extraction Attacks
- Model extraction from counterfactual explanations
- Models That Are Interpretable But Not Transparent
- XRand: Differentially Private Defense against Explanation-Guided Attacks
- Evaluating Robustness of Neural Networks with Mixed Integer Programming
- FAME: Formal Abstract Minimal Explanation for Neural Networks
- Interval Abstractions for Robust Counterfactual Explanations
- Counterfactual Explanations and Model Multiplicity: a Relational Verification View
- Case Study: Neural Network Malware Detection Verification for Feature and Image Datasets
- Logically Explainable Malware Detection