Introduction
Machine Learning (ML) classifiers have become a key line of defence against malware, with extensive research focusing on improving their performance and robustness to drift. However, the field of Adversarial Machine Learning (AML) has repeatedly demonstrated the brittleness of ML-based systems under targeted modifications. Although well established, this vulnerability is often underpinned with strong assumptions, such as access to confidence scores; therefore, the question most relevant for risk assessment is not whether these detectors can be evaded, but how general and efficient an attack can be under realistic constraints.
Most evasion research operates in the feature space, directly modifying the input that is fed into ML systems. Although sufficient to evade systems such as image detection, these approaches are not applicable to crafting evasive malware due to the inverse mapping problem: a change to the feature vector does not necessarily correspond to any realizable and function-preserving change in the application. Alternatively, problem-space attacks avoid this problem by modifying the application directly while enforcing syntactical and semantic constraints; therefore, every adversarial example is a valid program by construction.
Problem-space attacks must meet the following criteria:
- (i) available transformations (realizability), using only modifications an attacker could perform in practice;
- (ii) preserved semantics, the transformations performed must preserve the original malicious behavior of the sample;
- (iii) plausibility, the sample should appear realistic upon manual inspection;
- (iv) robustness to preprocessing, the modifications should survive a realistic pre-processing pipeline.
The most established way to satisfy these constraints for problem-space Android malware attacks is gadget extraction and transplantation, where self-contained code fragments alongside their known features are harvested from benign applications and transplanted into malware. As a result of gadgets being harvested from real applications, they are realizable and plausible by construction. Furthermore, since gadget transplantation only adds benign code, and thus features (0 → 1), it preserves the original behavior (semantics) of the malware.
Three major limitations
Per-sample optimization
Existing works optimize individual samples against a single target classifier and feature space, relying on confidence scores and search heuristics or greedy selection. As a result, these attacks optimize on a per-sample basis without retaining knowledge from past evasions, capping their query efficiency and limiting their transferability to new targets.
Capability set and strategy conflated
Existing literature often conflates two separate components of problem-space attacks: (i) the capability set, which defines modifications available to the attacker that can be made while preserving problem-space constraints; and, (ii) the strategy, which selects from the capability set in order to modify a sample to evade a target.
A single temporal snapshot
These approaches are evaluated only on a single temporal snapshot, ignoring the impact that temporal drift and targets that employ Active Learning (AL) have on the evasion of malware samples.
We therefore lack a comprehensive understanding of how evasion strategies generalize and transfer across classifiers, feature spaces, and time. To address these limitations, we propose REPLICANT: a unified Deep Reinforcement Learning (DRL) framework that learns problem-space evasion policies.
Threat Model
The goal of the attacker is to violate the integrity of the system by modifying malware to be classified as goodware while preserving its malicious behavior. Furthermore, in the process of achieving this goal, the attack aims to minimize the number of both malware modifications and target queries.
In the black-box setting, the attacker has no explicit knowledge of the target classifier clftarget and receives only its predicted label (i.e., either benign or malicious), rather than a confidence score. To learn an evasion policy, the attacker instead uses a surrogate classifier clfsurrogate created by themselves or others, which is trained on distinctly different data from the target. Therefore, the surrogate may also differ from the target in both classifier architecture or feature space.
To fairly compare attacks, we evaluate prior attack baselines with the same capability set and threat model as REPLICANT. In the black-box attack settings, all privileged information is drawn from the surrogate, and the target only provides predicted labels when queried. By eliminating the confounding factor of differing capability sets, this allows our evaluation to isolate the performance differences between attack strategies.
In the white-box setting, the attacker has unrestricted access to the target and thus may use its confidence scores and feature-space representation. We adopt the white-box threat model for the adversarial training (AT) experiments for the following reasons. First, a defender hardening their own model has complete access to it and thus would use the strongest realistic attacker available to them. Second, isolating the robustness gained from AT is best measured using white-box attacks as adding black-box constraints conflates robustness with the difficulty of finding an evasive strategy without access to the target.
REPLICANT Framework
Evasion here is formulated as a sequential decision-making problem (specifically, a Markov Decision Process) where an agent observes the current representation of a modified malware sample and chooses either: (i) to submit the sample to the target; or, (ii) to modify the sample and select which capability to apply. Since each capability corresponds to a concrete problem-space modification whose effect on the feature space is known in advance, we can model and evaluate the MDP in the feature space while maintaining the problem-space realizability of every transition.
Hierarchical DRL splits a policy across different levels of abstraction, where a higher-level policy decides what to do next and a lower-level policy decides how to do it. The hierarchical action space of REPLICANT is split across two separate policies: the higher-level query policy and the lower-level modify policy. Based on st, REPLICANT first selects a query action, qt ∈ {SUBMIT, MODIFY}. If qt = SUBMIT then the classifier is queried, clf(st) ∈ {0, 1}, and no capabilities are applied. If qt = MODIFY, then the modify policy selects a capability to apply to the malware sample and does not query the classifier. Action masking removes, prior to selection, any modify action whose capability either: (i) adds no new features (a no-op), or (ii) would conflict in the problem space.
Reward Function
Rsuccess = H
Rsuccess ≫ 0 rewards successful evasion.
Rdetected = −1
Rdetected ≤ 0 penalizes detection.
Rmodify = −1
Rmodify(st, cmt) < 0 penalizes each capability applied.
The relative magnitudes of these three terms determine the trade-offs between modification and query efficiency learned by the agent. These values were chosen to: (i) ensure every successful episode has a positive return, since the total penalties over an episode of at most H steps cannot surpass Rsuccess; and (ii) incentivize an efficient but balanced use of both modifications and queries.
During training, the query policy is masked to force periodic submits (PS). We scale the reward of these forced submits by λPS ∈ [0, 1]. We set λPS = 0 for two reasons. First, early in training the agent is usually detected when it queries and can learn to avoid querying altogether; making these periodic queries zero-cost encourages it to explore querying. Second, once the agent is more capable, λPS = 0 encourages the agent to voluntarily submit early to maximize reward.
REPLICANT Agent
A shared MLP encoder feeds three heads, each adding one further layer before its output: a query head over {SUBMIT, MODIFY}, a masked modify head over the capability set C, and a critic head estimating state value V(st). Training uses Proximal Policy Optimization (PPO), with the query policy loss applied at every step; the modify policy loss applied only on MODIFY steps, relying on the evasion reward being propagated through advantage estimation; and the critic is shared across both. The query and modify heads share a common entropy coefficient, encouraging exploration over both when to query and what to add.
Because training yields a policy πθ rather than a fixed adversarial sample, what REPLICANT learns is not bound to a single input or target: the same πθ can be used to evade malware it has never seen and transfers to classifiers and feature spaces it was never trained against.
Experimental Setup
Hypercube dataset, 2021–2024
In our experiments we use the Hypercube Android malware dataset, spanning 224,965 samples from 2021–2024, constructed to follow the current best practices for unbiased dataset creation: sampling from a single market (Google Play) using publication timestamps, at a statistically representative size, with a realistic malware distribution of 10% and a VirusTotal Threshold of two (VTT2).
Seven classifiers
We evaluate against the following seven classifiers: Linear SVM, SecSVM, Random Forest, DeepDrebin, RAMDA, HCC, and DRMD. We chose these seven classifiers because they span a diverse set of design principles, from margin maximization and ensemble voting to reconstruction, contrastive, and reward-weighted losses.
Three feature spaces
In total, the Drebin, APIGraph, and RAMDA feature spaces contain 10,000, 11,912, and 379 features, respectively. We chose these three spaces for their differing sizes and overlap, which allow us to evaluate transferability across varying degrees of alignment between the surrogate and target feature spaces.
Training sets: two periods, ten seeds
We repeat every experiment: (i) over ten random seeds to account for variance; and (ii) over two temporally distinct training periods (2021 & 2022) to avoid bias from temporal luck. For each seed, we perform a random stratified split to produce two equal sized training sets per training year: split a trains the surrogate and REPLICANT policies, and split b trains the target (e.g., 2021a-vs-2021b and 2022a-vs-2022b).
Testing sets: the year after training
We evaluate attack performance using malware from the year after target training (e.g., 2023 for a 2022b target); which realistically mimics evasion by malware authors as they attempt to evade deployed detectors over time. For each seed and feature space, the evasion test set is the malware that every classifier correctly detects ensuring that differences in ASR reflect the attack rather than which malware each classifier happens to detect.
Metrics: ASR and AvgQ
We report ASR, specifically the percentage of malware that evaded detection at a fixed per sample budget of twenty queries, as our primary metric. We also report the average number of queries per sample (AvgQ) as a secondary metric for attacks to measure query-efficiency.
Capability Set
REPLICANT is deliberately agnostic to what the problem-space capabilities are: it learns effective evasion policies given any capability set and a representation that captures how the modifications affect the sample. Our capability set comprises gadgets harvested by prior problem-space work, together with their feature-space effects we computed. Each gadget affects only a small set of features, so for each feature space we use the subset that changes at least one of its features, resulting in 3,143 for Drebin, 4,804 for APIGraph, and 1,739 for RAMDA. For cross-feature-space attacks, the attacker selects from the capability set applicable in their own feature space, and the target sees the effect of applying those gadgets in its own feature space.
Prior attacks
- When both components are proposed together and not evaluated in isolation, it is unclear if the new attack has discovered a better strategy for evasion, or if a potentially sub-optimal strategy is being carried by a stronger capability set.
- This ambiguity is a form of the gain attribution pitfall.
This evaluation
- All attacks are performed under the same threat model and capability set for each setting, to ensure reported differences reflect attack strategy rather than access to different capabilities.
- We also evaluate Rnd, which uses the REPLICANT framework but selects actions uniformly at random, to isolate the performance gains of policy learning.
The ASRs we report are relative to the capability set and dataset used rather than an absolute upper bound on problem-space evasion.
Black-Box Evasion
Matched Setting
In the matched setting, the surrogate and target classifiers share an architecture and feature space but are trained on separate training sets; with no difference between architecture or feature space, this setting represents the best-case scenario for a black-box attacker. REPLICANT achieves a mean ASR of 96.6% using an average of 3.6 queries per sample. The strongest baseline, APG, reaches only 77.7% while the ADZ, EvD, and random baselines sit at 61.5%–69.7%. APG is statistically tied with REPLICANT on SVM, SecSVM and DeepDrebin, where ranking capabilities by their contribution to the surrogate decision function most closely aligns with the target boundary. The gap is largest on the RL-based DRMD, where APG collapses to 25.2% against the 90.2% of REPLICANT, followed by RAMDA and RF (35.4 & 27.6 points), with every other baseline statistically beaten on every target.
Matched setting: REPLICANT against APG on each detector
Mean ASR (%) within 20 queries, averaged over feature spaces and seeds. Higher is better for the attacker.
Show all attackers as a table
| Detector | REPLICANT | APG | ADZ | EvD | Rnd |
|---|---|---|---|---|---|
| SVM | 99.1 | 99.1 | 73.5 | 84.0 | 74.2 |
| SecSVM | 98.2 | 98.7 | 53.6 | 73.5 | 54.3 |
| Random Forest | 93.3 | 65.8 | 72.1 | 69.9 | 70.7 |
| DeepDrebin | 96.5 | 94.5 | 56.0 | 69.1 | 57.9 |
| RAMDA | 99.9 | 64.5 | 81.3 | 72.0 | 82.6 |
| HCC | 98.7 | 96.1 | 79.2 | 85.2 | 81.6 |
| DRMD | 90.2 | 25.2 | 14.5 | 34.0 | 16.8 |
| Mean ASR (%) | 96.6 | 77.7 | 61.5 | 69.7 | 62.6 |
| Avg. queries | 3.6 | 6.5 | 10.6 | 9.9 | 10.0 |
All Settings
In practice, an attacker rarely has a surrogate that matches the target, so we now evaluate REPLICANT across all 1,764 surrogate/target combinations, in which the surrogate and target may differ in classifier, feature space, training period, or all axes. REPLICANT achieves the highest evasion rate (78.8% ASR), beating every Android baseline by 13.6–22.2 ASR points. Since the baselines use changes in confidence to steer capability selection, as the surrogate diverges from the target, its confidence degrades as a proxy for the decision boundary of the target. REPLICANT instead learns a policy over the malware used to train the surrogate, thereby capturing the general task of evasion rather than the surrogate confidence topology.
Rnd uses the same MDP as REPLICANT, however, it selects when to query and which applicable capability to add at random. Across all settings, Rnd matches the performance of both ADZ and EvD, while approaching the performance of APG at a budget of twenty queries. This demonstrates that: (i) the environment design of REPLICANT provides performance on par with prior attacks under our threat model; (ii) the performance gains over prior attacks are the result of our learned policy; and (iii) it exposes the weakness of relying on surrogate confidence scores for black-box attacks.
To isolate the gains of our architecture and reward function, we compare against five alternative RL agent designs adapted to Android by using our environment, threat model, and capability set. We find that in comparison to prior agent designs, REPLICANT improves the mean ASR by 5.6–22.2 points across all 1,764 settings, using 1.1–5.2 less queries on average.
All 1,764 surrogate/target pairs: attack success by attacker
Mean ASR (%) within 20 queries, ten seeds. Every attacker gets only predicted labels from the target.
Show as table
| Attacker | Type | ASR (%) | Avg. queries |
|---|---|---|---|
| REPLICANT | Learned policy | 78.8 ± 1.2 | 7.4 |
| APG | Android attack | 65.2 ± 0.9 | 9.3 |
| AdvDroidZero (ADZ) | Android attack | 61.5 ± 1.2 | 10.6 |
| EvadeDroid (EvD) | Android attack | 56.6 ± 0.9 | 11.7 |
| Rnd | Random-policy control | 59.4 ± 1.1 | 10.4 |
| MEME | RL design | 73.2 ± 0.9 | 8.5 |
| MAB-Malware | RL design | 71.2 ± 0.9 | 9.0 |
| PSP-Mal | RL design | 59.7 ± 1.2 | 11.0 |
| MERLIN | RL design | 59.5 ± 1.4 | 11.3 |
| AIMED-RL | RL design | 56.6 ± 1.5 | 12.6 |
The ADZ method does not scale to larger capability sets, therefore, ADZ is the only exception to the shared capability set across attackers. We instead reconstruct a 662-action space from our capability set following the subset of manifest and code perturbations specified in the original work.
Query-Efficiency
At a query budget of 20, REPLICANT is also the most query-efficient attacker by AvgQ, spending the fewest average queries per sample of any attack: 3.6 in the matched setting and 7.4 across all settings versus the 6.5 and 9.3 of APG, the Android strongest baseline.
Average target queries per malware sample
AvgQ under a 20-query budget, ten seeds. Lower is better for the attacker.
Show as table
| Attacker | Matched AvgQ | All settings AvgQ |
|---|---|---|
| REPLICANT | 3.6 | 7.4 |
| APG | 6.5 | 9.3 |
| AdvDroidZero | 10.6 | 10.6 |
| EvadeDroid | 9.9 | 11.7 |
| Rnd | 10.0 | 10.4 |
Datasets & VTT
Our main results use the canonical Hypercube dataset, which samples the distribution and labels applications using VirusTotal threshold of 2 (VTT2). To confirm our results are not an artifact of this threshold, we re-run the black-box experiments on a variant of Hypercube created for VTT4. Since VTT4 creates a higher standard for samples to be labeled as malware, it simplifies the detection task, dropping misclassification rates for 2022 malware from 63.8% to 46.9%. Thus VTT4 has a two-fold effect on our evaluation that makes it more favorable for the attacker: (i) it provides a larger test set as more malware are detected by all targets for a given seed and (ii) it produces more capable surrogates that provide a better proxy for the targets. These two factors result in a higher mean ASR across all attacks; REPLICANT rises from 78.8% (VTT2) to 94.1% (VTT4), remaining the dominant attacker (12.6% better than the best baseline). Therefore, since using VTT2 follows current best practice and it is the more conservative setting for attack performance, our main results give a realistic measure of attack efficacy that is not inflated by higher labeling thresholds.
Evaluation Periods
To confirm the attacks are also effective in-distribution, we additionally test on the malware from the surrogate split of each target’s training year (e.g., 2021a malware for a 2021b target, and 2022a for a 2022b target). The attack remains effective, with only a minor decline in performance; the mean ASR of REPLICANT on in-distribution malware is 70.0% compared to the 78.7% of the main temporally withheld results. Furthermore, when testing on malware from two and three years after the training periods, the mean ASR rises to 89.4% and 95.4%, respectively.
Transferring Policies
We analyze both Policy Transfer Evasion (PTE), where the policy learned by REPLICANT is deployed against the target; and Sample Transfer Evasion (STE), where REPLICANT evades the surrogate, and those adversarial samples are applied directly to the target. Therefore, both attacks use identical policies, capabilities, and surrogates; they only differ in whether the learned policy is employed as an active attacker or used to pre-compute adversarial samples, as done in classical transfer attacks.
Specifically, we consider four transferability axes: the temporal gap (when training periods differ), the architecture gap (when classifiers differ), the representation gap (when feature spaces differ), and the combined gap (when all differ).
Policy transfer against sample transfer, by surrogate/target gap
Mean ASR (%) of REPLICANT within 20 queries (PTE) and of its pre-computed samples (STE), ten seeds.
Show as table
| Gap | PTE ASR (%) | PTE AvgQ | STE ASR (%) |
|---|---|---|---|
| Matched | 96.6 ± 0.7 | 3.6 | 59.4 ± 4.3 |
| Temporal | 96.6 ± 0.6 | 3.6 | 59.4 ± 4.4 |
| Architecture | 87.4 ± 1.1 | 5.8 | 44.7 ± 1.8 |
| Representation | 78.8 ± 1.3 | 7.6 | 42.5 ± 2.8 |
| Combined | 73.0 ± 1.5 | 8.5 | 41.3 ± 1.9 |
| All settings | 78.8 ± 1.2 | 7.4 | 43.3 ± 1.8 |
- Temporal Gap. Matching the classifier and feature space but training the surrogate and target in different periods, PTE retains a mean ASR of 96.6%, statistically indistinguishable from the matched setting. Therefore, the learned policy is effectively invariant to the temporal gap; the only appreciable difference is between 2021b and 2022b targets, which is a result of temporal luck rather than the surrogate-target gap.
- Architecture Gap. When the surrogate and target share the same feature space but differ in architecture, transfer remains strong: PTE evades 87.4% of malware within twenty queries against 44.7% for STE, and overtakes STE within roughly two queries. Given a shared representation, the learned effect that each modify action has on the feature space still holds for the target; the agent, therefore, retains an accurate model of how its capabilities change a sample. The architecture gap is thus paid foremost in queries: ASR rises slowly against the targets whose boundaries differ most from the surrogate, most notably DRMD, the only RL-trained detector, whose categorically different training regime makes its boundary the least similar to the others.
- Representation Gap. Keeping the architecture fixed while moving the surrogate and target into different feature spaces lowers ASR to 78.8%, still far above the 42.5% of sample transfer. The performance decay concentrates on pairs involving RAMDA especially when it is used as the surrogate. A policy trained on RAMDA, the smallest feature space, and deployed against a richer target space has only learned capabilities that affect a small fraction of the target representation and must therefore rely either on that sub-region to influence the decision of the target or on incidental side-effects its capabilities produce elsewhere in the larger representation. Conversely, transferring an attack into a smaller representation, such as RAMDA, can render many of its modifications invisible to the target, as they are not captured by the representation of the target. Therefore, this reduction in ASR reflects an underlying property of the representation gap rather than any intrinsic robustness of RAMDA.
- Combined Gap. This is the hardest regime, where the surrogate differs from the target in architecture, feature space, and training period. The costs of each transferability gap now compound: the policy pays in queries to push towards the shifted boundary and in expressiveness to compose capabilities in a representation it was not trained on, lowering the ASR of PTE to 73.0%, still far above the 41.4% of STE. DRMD is the hardest target to evade, which is further compounded by the representation gap to produce the slowest per-query ASR rise. Even so, PTE reaches an ASR of 41.1% against it, whereas STE reaches only 4.2%.
A transferred sample is optimized to pass the decision boundary of the surrogate and relies on the alignment of decision boundaries. A transferred policy instead encodes a distribution over actions conditioned on the current representation of the sample. This provides PTE with a distinct advantage that is exactly where STE fails: as surrogate and target diverge, misaligned boundaries cause sample transfer to decay, while an adaptive policy re-queries until the decision boundary is crossed. Averaged over all settings, PTE reaches 78.8% ASR against 43.3% for STE, and overtakes the ASR of STE within three queries on average.
When the surrogate and target agree on nothing but the distribution from which their training data was drawn, what transfers best is the learning of how to evade, not specific evasive samples.
Adversarial Training
Despite a long history of proposed defenses against evasion attacks, adversarial training remains one of the few defenses that has consistently demonstrated empirical robustness. Evasion attacks highlight the weakness in a models decision-making; by retraining against these adversarial samples the model can become hardened or more robust against such attacks.
The robustness gained from adversarial training depends on the quality of the attacker, so we harden with the strongest attacker from each attack type (i.e., policy-based and per-sample optimization). Therefore, we use REPLICANT for learned policies and APG for per-sample optimization to provide the most informative comparison. As we are not considering transferability, and evasion rates are similar between the feature spaces in the matched setting, we focus this analysis on the Drebin feature space because it is the most widely used representation.
We also produce a white-box variant of REPLICANT (REPLICANTWB) for use in AT and the robustness evaluations of the hardened targets. Architecturally, REPLICANTWB drops the query head and submits after every modification, since query efficiency is not required in the white-box setting; it also uses the confidence score of the target, clfscore, for rewards. Since confidence deltas can be small, we scale them by λWB = 5 for all targets. Beyond architecture and reward, the rest of the REPLICANT formulation remains unchanged.
AT-REPLICANT
Train a fresh policy
Each round of AT-REPLICANT trains a fresh REPLICANTWB policy against the classifier being hardened.
Collect every adversarial sample
Simultaneously collecting adversarial samples throughout training exposes the classifier to many distinct variants of every malware sample, unlike collection from an already-converged policy or via greedy composition.
Retrain the classifier
The unique adversarial samples collected are added to the training set of the classifier for retraining before the next round.
Repeat for 15 rounds
As the classifier becomes harder to evade with each round, a fixed training budget yields progressively fewer adversarial samples, so we increase the number of policy updates as AT progresses. Empirically the number of new adversarial samples collapses after five rounds under a fixed budget, whereas doubling the policy updates of REPLICANTWB every five rounds maintains adversarial sample production across all 15 rounds.
AT-REPLICANT and AT-APG follow the pipeline, however, AT-APG collects adversarial samples during its per-sample rollouts as it does not have a training phase.
Robustness Evaluation
We evaluate each classifier trained by both AT pipelines against both REPLICANTWB and APGWB attacks.
Attack success against hardened detectors after 15 rounds
Mean ASR (%) over seven detectors, Drebin features. Lower is better for the defender.
Show per detector
| Detector | REPLICANTWB vs AT-REPLICANT | REPLICANTWB vs AT-APG | APGWB vs AT-REPLICANT | APGWB vs AT-APG |
|---|---|---|---|---|
| SVM | 9.8 | 99.9 | 10.1 | 100.0 |
| SecSVM | 8.9 | 48.4 | 9.3 | 49.3 |
| Random Forest | 1.9 | 77.4 | 3.7 | 7.8 |
| DeepDrebin | 7.2 | 12.1 | 17.2 | 13.6 |
| RAMDA | 16.0 | 86.9 | 14.0 | 19.6 |
| HCC | 18.2 | 25.7 | 51.2 | 46.6 |
| DRMD | 7.6 | 86.4 | 8.8 | 12.2 |
| Mean | 9.9 | 62.4 | 16.3 | 35.6 |
After 15 rounds, AT-REPLICANT reduces the mean ASR to 9.9% and 16.3% for REPLICANTWB and APGWB, respectively. Therefore, AT-REPLICANT produces classifiers that are robust against both the attack it was trained on and an unseen attacker. Conversely, AT-APG primarily reduces the mean ASR of APGWB (35.6%) while remaining vulnerable to REPLICANTWB (62.4%).
APG is greedy and deterministic, thus each round naturally focuses on a small sub-set of capabilities and limits the diversity of adversarial samples produced. As a result, REPLICANTWB learns capability sequences outside from the targeted paths AT-APG trained on, and achieves a mean ASR of 62.4%. Conversely, the robustness learned by AT-REPLICANT generalizes better as it collects diverse adversarial samples during stochastic policy training, providing significantly more coverage of attack paths. Therefore, the coverage of possible paths modulates how broadly the robustness gained by AT can generalize.
Clean Performance
AT-REPLICANT has a more adverse effect than AT-APG to the initial F1 performance in the first test month (mean F1 drop across classifiers of −5.6 versus −3.1). However, when considering performance-over-time, both AT pipelines increase mean A-AUT(F1) in four of the seven total classifiers, with AT-REPLICANT hardened classifiers improving mean A-AUT(F1) by 2.8 compared to the 1.1 gain of AT-APG. Therefore, although AT reduces initial performance, the new malware variants for training created by AT-REPLICANT mildly improve the generalization of most classifiers as samples start to drift over time.
Capability Drift
In this section we test whether the robustness learned by the AT pipelines generalizes to unseen problem-space capabilities, which we refer to as capability drift. Therefore, we split the capability set in two: (i) the capability set used by both the AT and the initial attacker; and, (ii) the held-out attacker capabilities used to measure generalization to capability drift. Attackers are evaluated six separate times, starting with the initial capability set, and then progressively adding 10% of the total capabilities back in each subsequent evaluation.
AT-REPLICANT shows robustness against both REPLICANTWB (8.7%) and APGWB (14.6%), whereas AT-APG primarily against APGWB (26.6% versus the 49.5% of REPLICANTWB). However, as capability drift increases so does the mean ASR of REPLICANTWB, with the full capability set reaching 91.3% (AT-REPLICANT) and 96.1% (AT-APG).
| Hardened with | REPLICANTWB ASR, reduced set (50%) | REPLICANTWB ASR, full set (100%) |
|---|---|---|
| AT-REPLICANT | 8.7% | 91.3% |
| AT-APG | 49.5% | 96.1% |
Therefore, as the attacker set changes, the two AT pipelines demonstrate similar robustness to APGWB; however, AT-REPLICANT remains consistently more robust than AT-APG to the REPLICANTWB attacker at every stage of capability drift (mean ASR reduction of −40.8 to −4.9 percentage points). This demonstrates that although AT-REPLICANT generalizes better to capability drift than AT-APG, AT has natural limitations with respect to the capability set it was trained against. Therefore, in practical deployments just as classifiers need active learning to adapt to temporal drift, AT must also adapt to capability drift.
Temporal Drift
Over time both goodware and malware evolve, without adaptation, the performance of a trained detector decays as new samples drift further from the training distribution. We compare five different pipelines for the classifiers against fixed REPLICANT attackers (under both the white-box and black-box settings): (i) Base, the static classifier from its respective training period; (ii) AL, which performs monthly AL updates with 400 samples selected from that period using uncertainty-based selection; (iii) AT, the AT-REPLICANT pipeline; (iv) AT&AL, the AT-REPLICANT hardened classifiers with AL across the test periods; and, (v) Robust AL (RAL). We propose RAL, which extends AL by running one AT-REPLICANT round on the malware collected each AL period and adds the resulting adversarial samples to the AL update set.
| Pipeline | A-AUT(F1) ↑ | A-AUT(ASR), WB ↓ | A-AUT(ASR), BB ↓ |
|---|---|---|---|
| Base (no updates) | 26.7 | 99.9 | 93.9 |
| AL | 49.8 | 98.2 | 88.5 |
| AT (AT-REPLICANT) | 29.5 | 0.1 | 0.4 |
| AT&AL | 47.9 | 19.4 | 20.6 |
| RAL (ours) | 49.0 | 0.6 | 0.8 |
Drift adaptation (↑A-AUT(F1)) and adversarial robustness (↓A-AUT(ASR) WB & BB) are largely orthogonal, with no prior strategy improving both metrics over the three-year evaluation. AL recovers the most clean performance of any configuration (49.8) but, as it never exposes the classifiers to adversarial samples in training, the adaptation only has a minor reduction on attack performance (98.2% WB, 88.5% BB); AT conversely suppresses the attackers to near-zero ASR, however, provides only minor robustness to temporal drift (29.5). Combining AT&AL improves performance with regards to temporal drift at the cost of adversarial robustness (19.4% WB, 20.6% BB). Finally, only our RAL, with its combination of clean and adversarial samples for retraining, improves on both axes, matching the clean performance of AL (49.0 versus 49.8) while preserving the adversarial robustness from AT (0.6% WB versus 0.1% WB).
Therefore, just as AL is needed to adapt to temporal drift, AT must continually adapt alongside it, as neither AL nor AT alone is sufficient.
Contributions
- REPLICANT Framework. We propose REPLICANT, a general DRL-based framework that learns problem-space evasion over a capability set as a hierarchical policy, improving Attack Success Rate (ASR) by 20.9%–39.2% compared to state-of-the-art Android attacks.
- Policy Transfer. We demonstrate that a policy trained against a surrogate transfers more effectively than the samples that evade the same surrogate, yielding an 82.0% relative increase in ASR.
- AT & Capability Drift. We show that AT-REPLICANT reduces attacker success below 17% for both REPLICANTWB and a APGWB, whereas AT-APG leaves the model over five times more vulnerable to REPLICANTWB. We also show that the robustness gained from AT diminishes as the attacker capabilities expand from the capability set used by the defender.
- Robustness under Drift. We establish that applying AL directly to AT hardened classifiers recovers drift-induced performance but degrades robustness, whereas our Robust AL (RAL) retains the performance-over-time of AL and the robustness of AT.
- Comprehensive Study. We conduct the largest evaluation of problem-space Android malware evasion to date, comprising 379,680 attack evaluations, isolating the gains of evasion strategies on attacker success.
Together, these results establish learned policies as a state-of-the-art foundation for both attacking and adversarially training malware detectors.
Cite
@misc{mcfadden2026replicant,
title={REPLICANT: Learning Policies for Evading and Hardening Malware Detectors},
author={Shae McFadden and Ilias Tsingenopoulos and Mario D'Onghia and Alexander Herzog and Myles Foley and Chris Hicks and Lorenzo Cavallaro and Fabio Pierazzi},
year={2026},
eprint={2608.28499},
archivePrefix={arXiv},
primaryClass={cs.LG}
}