Introduction
Deep Reinforcement Learning (DRL) has successfully improved the speed of matrix multiplication; discovered new protein structures; and, achieved superhuman performance at game playing. Through continuous interaction with a DRL environment (often simply referred to as the environment), DRL agents learn sequential decision-making policies by optimizing the expected cumulative reward over time. Unsurprisingly, these capabilities have motivated applications in cybersecurity, where systems must make adaptive decisions in dynamic, adversarial environments. DRL applications range from detecting malicious activity to evading detection and from autonomously defending networks to discovering vulnerabilities.
However, the transition to cybersecurity introduces fundamental challenges compared to traditional domains where DRL has previously excelled, such as game playing, robotics, and computer chip design. In cybersecurity, adversaries actively adapt their strategies to evade detection, systems evolve over time, and defenders typically observe limited information about attacker intentions and system state. These characteristics violate core assumptions of Markov Decision Processes (MDPs), the model for DRL learning tasks, that presume fixed transition dynamics and complete state observability, which can cause agents to be vulnerable to adversaries. In reality, most security tasks are better characterized as Partially Observable MDPs (POMDPs), where agents must infer hidden dynamics from incomplete knowledge: an observation of the system state. Further compounding these challenges are additional task-specific requirements, from information constraints (privacy and access limitations) to practical deployment capabilities (query budgets, real-time constraints). Failing to address these can produce agents that perform well in controlled simulations, however, fail unpredictably and dangerously when deployed in operational environments.
To the best of our knowledge, ours is the first work to delineate the pitfalls that arise when applying DRL in security. In 2022, Arp et al. identified 10 pitfalls in 30 supervised learning-based security research papers, finding at least three pitfalls in each paper. More recently, Evertz et al. extended this analysis to LLM-based security research. They identified nine pitfalls, finding at least one in each of the 72 papers reviewed. While there are some parallels between previously identified pitfalls and our work, the sequential decision-making paradigm of DRL is different. This means that although similar in spirit, these parallel ideas manifest in fundamentally different ways. For example, invalid environment modeling opposed to incorrect dataset construction: they have different causes, impacts, and mitigations.
Collectively, these pitfalls obscure whether reported improvements stem from genuine algorithmic advances or rather from artifacts of simplified environments and incomplete evaluations. More critically, they create a dangerous gap between simulated and operational reality, leading to systems that provide a false sense of security when deployed.
Our goal is not to discourage DRL applications in cybersecurity, as it holds genuine promise, but rather to establish methodological standards that enable the community to distinguish robust, deployable solutions from those that succeed only in idealized settings.
Foundational Concepts
At its core, Reinforcement Learning (RL) problems learn optimal policies through environmental interaction formalized as MDPs. MDPs are defined by the tuple (S, A, R, T, γ), consisting of: a state space S, action space A, reward function R : S × A → ℝ, transition function T : S × A → Δ(S) (where Δ(S) denotes probability distributions over states), and discount factor γ ∈ [0, 1]. An RL ‘agent’ observes a state st, selects an action at according to the policy π, then receives a reward rt, and transitions to the next state st+1. The agent then learns a policy that maximizes expected cumulative discounted reward: E[∑t=0∞ γtrt].
Traditional RL algorithms such as Q-Learning maintain explicit tables of state-action values that do not generalize to unseen states, and become intractable for large state or action spaces, which is critical for cybersecurity applications. DRL addresses this limitation by using deep neural networks as function approximators, allowing generalization to unseen states and scalability to high-dimensional problems. The three primary paradigms of DRL are: value-based methods, which approximate the state-action values of Q-learning; policy-based methods, which directly approximate the action distribution of the policy; and, actor-critic methods that combine both paradigms.
The MDP formulation relies on the Markov property: that the future state depends only on the current state and action, not on the history of past states. This assumption is critical for DRL but can be violated in cybersecurity settings where attackers maintain a hidden state (e.g., compromised credentials, established persistence) not observable to defenders. In such cases, the problem is more accurately modeled as a POMDP, where the agent receives observations ot from an observation function Ω : S → O rather than directly receiving states. POMDPs require agents to maintain belief states or use recurrent architectures to infer the hidden state from observation histories.
Four stages of agent development
In this paper, we systematize 11 recurring methodological pitfalls that emerge when DRL is employed in cybersecurity (DRL4Sec). We organize these pitfalls across the four stages of agent development.
-
Environment modeling
The foundation of applying DRL is formulating a problem as an MDP. As a result of problem diversity, cybersecurity domains typically lack standardized DRL environments necessitating bespoke MDP formulations for each task. First, an incomplete MDP Specification hinders reproducibility and obscures potential flaws in DRL-based approaches. Second, Modeling Correctness issues arise when the underlying security task is incorrectly modeled as an MDP. Third, security problems often lack complete system information in practice; inadequately addressing this can lead to problems of Partial Observability.
-
Agent training
Unlike supervised learning, where training typically converges given sufficient data, DRL training is inherently more variable and sensitive to numerous factors including: hyperparameter choices, random initialization, sparsity of reward, and the stochastic nature of exploration. First, Hyperparameter Reporting issues arise when critical implementation details necessary for reproduction and validation are omitted. Second, when Variance Analysis is not performed across multiple training runs, the reliable performance of the proposed approach is in question. Third, when Policy Convergence is not achieved, due to premature training termination, it often leads to systems with inconsistent and unpredictable behavior when deployed.
-
Performance evaluation
DRL evaluations present unique challenges compared to traditional machine learning. First, Application Motivation issues occur when DRL is used without adequate justification over simpler domain-specific methods. Second, Gain Attribution issues arise when performance gains are due to the basic agent capabilities rather than the learned policy itself. Third, Environment Complexity creates misleading results when training and evaluation occur in overly simplified settings that do not capture real-world complexity.
-
System deployment
Avoiding pitfalls in modeling, training, and evaluation does not guarantee an agent’s reliable performance in the complexities and uncertainties of real-world systems. First, Underlying Assumptions issues arise when agent design or environment assumptions cannot be satisfied in practice. Second, Non-Stationarity problems occur when the evolving nature of security environments are not adequately captured.
This work identifies recurring pitfalls in DRL4Sec literature. These are not failures of individual researchers but systematic challenges that emerge when adapting DRL to cybersecurity. We frame our analysis around pitfall patterns over critiquing specific papers, and while we list the papers reviewed, we do not report the per-paper pitfalls.
Review Methodology
We conducted a systematic literature collection using IEEE Xplore, ACM DL, and Google Scholar. We performed our collection in two rounds, first in April 2025 using only Google Scholar for initial pitfall identification and second in December 2025 using all search tools to complete the corpus and update citation counts.
Significance Criteria. To ensure academic impact and quality, papers must satisfy at least one of the following criteria: (1) published in a first- or second-tier (CORE-ranked A* or A) venue in machine learning, software engineering, or security; or (2) demonstrate significant research impact by averaging more than 10 citations per year since publication from a reputable publisher.
Topic Criteria. We define the scope of papers to be included in our work as: direct applications of DRL to cybersecurity problems and have DRL as the primary methodological contribution. We then excluded several categories of related but out-of-scope work: (1) secondary studies (surveys, systematic reviews, etc.); (2) research on the security of DRL systems, i.e., non-DRL-based attacks against DRL agents (which are not applied to cybersecurity problems); (3) pure game-theoretic approaches without DRL; (4) non-deep RL methods (e.g., tabular Q-learning, which fail in complex environments); and (5) Multi-Agent RL (MARL) systems, a separate research domain (which require distinct formulations and analysis).
Review Process. We began with a pilot review of the 37 papers from the April collection to identify themes and commonalities. Using this review, we isolated the reoccurring issues in DRL4Sec papers and formalized the 11 pitfalls discussed in this work. We then evaluated the complete 66 papers for each of the identified pitfalls. Each paper was independently evaluated by two reviewers using the pitfall definitions.
Present
Clearly and completely exhibited.
Partially present
Partial manifestations or acknowledged but unaddressed.
Not present
Adequately handled or not applicable.
Following the independent reviews, the initial prevalence scores achieved substantial agreement, according to a Cohen’s κ of 0.712 and the Landis–Koch interpretation. With a 81.5% total agreement on pitfall prevalence, the remaining disagreements (18.5%) around the severity of pitfalls for the papers reviewed were resolved through discussion between the reviewers. When evidence was ambiguous, we gave the benefit of the doubt to the paper by using the less severe pitfall classification to resolve the disagreement (e.g., marking as not present if reviews were split between not present and partially present).
Corpus Characteristics. The 66 papers in our corpus were published between 2018 and 2025 across a diverse set of cybersecurity tasks.
The 66 reviewed papers by security domain
Papers per domain, 2018–2025. Red: domains of the case studies.
Show as table
| Domain | Papers | Share |
|---|---|---|
| Adversarial sample creation | 15 | 22.7% |
| Intrusion detection | 15 | 22.7% |
| Fuzzing and web security | 10 | 15.2% |
| Autonomous cyber defense | 7 | 10.6% |
| Penetration testing | 6 | 9.1% |
| Cyber-physical systems security | 4 | 6.1% |
| Malware detection | 4 | 6.1% |
| Blockchain security | 3 | 4.5% |
| Hardware security | 2 | 3.0% |
These domains represent the major application areas of DRL4Sec, showing concentration in areas requiring complex sequential decision-making. First, we consider Autonomous Cyber defense (ACD) as these environments are well established and often reused across subsequent works. Then, we consider adversarial malware generation and web security testing as they are some of the most prominent applications of DRL4Sec across the 66 papers studied (22.7% and 15.2%, respectively).
Prevalence Analysis
Through systematic analysis of 66 DRL4Sec papers, published between 2018 and 2025, we quantify the prevalence and severity of each pitfall. Our review reveals widespread issues where every paper contains at least two pitfalls, with an average of 5.8. Furthermore, across the individual pitfalls, 28.8% of papers fall victim to the least common pitfall (Underlying Assumptions), with the most common being present in 71.2% of papers (Policy Convergence).
How often each pitfall appears
Share of the 66 papers with each pitfall present or partially present, grouped by stage.
Show as table
| Code | Pitfall | Stage | Present | Partial | Total |
|---|---|---|---|---|---|
| M-MS | MDP Specification | Modeling | 4 | 35 | 39 (59.1%) |
| M-MC | Modeling Correctness | Modeling | 17 | 6 | 23 (34.9%) |
| M-PO | Partial Observability | Modeling | 20 | 20 | 40 (60.6%) |
| T-HR | Hyperparameter Reporting | Training | 21 | 24 | 45 (68.2%) |
| T-VA | Variance Analysis | Training | 38 | 6 | 44 (66.7%) |
| T-PC | Policy Convergence | Training | 28 | 19 | 47 (71.2%) |
| E-AM | Application Motivation | Evaluation | 8 | 21 | 29 (43.9%) |
| E-GA | Gain Attribution | Evaluation | 15 | 18 | 33 (50.0%) |
| E-EC | Environment Complexity | Evaluation | 12 | 15 | 27 (40.9%) |
| D-UA | Underlying Assumptions | Deployment | 10 | 9 | 19 (28.8%) |
| D-NS | Non-Stationarity | Deployment | 23 | 13 | 36 (54.5%) |
Most commonly, we find that: 71.2% lack clear evidence of policy convergence, 60.6% fail to address partial observability, 66.7% neglect variance analysis, and 40.9% evaluate in oversimplified environments.
The gap in convergence reporting suggests that although the need for convergence may be understood, the concrete demonstration of policy convergence and stability is often under-emphasized. Such prevalence indicates that partial observability is a pervasive challenge in DRL applications to cybersecurity. While the number of papers acknowledging the issue show that some awareness exists, it does not match the high prevalence of partial observability in cybersecurity tasks.
Pitfall Taxonomy
M-MSMDP Specification
The MDP is ill-defined, so that one or more components (state space, action space, reward function, and transition dynamics) remain unclear.
- Prevalence
- Across the 66 papers reviewed, we observed fully unspecified MDP definitions in 4 papers (6.1%), partially unspecified definitions in 35 papers (53.0%), and complete definitions in the remaining 27 papers (40.9%). Among the full and partial cases the distribution of under-specified components are as follows: the state space was the most frequent (22 papers, 33.3%), followed by transitions (18 papers, 27.3%), action space (14 papers, 21.2%), and reward function (10 papers, 15.2%). The high prevalence indicates a significant documentation issue in DRL4Sec literature, reflecting the inherent difficulty of translating complex security scenarios into fully specified environments.
- Security implications
- The risks that ambiguous definitions can cause in real-world deployments is threefold. First, it obfuscates other pitfalls in the problem formulation, e.g., state spaces that do not address partial observability allow attacks to go undetected despite causing harm to the system. Second, it hinders reproducibility, as attempts at reconstruction may yield different MDPs. For instance, ‘rewards for attack detection with penalties for false positives’ can produce vastly different behaviors due to variations in relative reward magnitudes. Finally, assessing the real-world viability of the proposed solution becomes significantly harder.
- Recommendations
- Complete MDP specification requires unambiguous definition of: (1) the state space, including available information, dimensionality, and semantic meaning of individual state values; (2) the action space, specifying all available actions and connection to the security task; (3) the transition function, describing how actions influence state changes, including stochasticity and terminal conditions; and (4) the reward function, providing the complete formulation with rationale for the contribution of each component to the overall objective. Crucially, assumptions, approximations, or simplifications must be explicitly discussed.
- Case study
- Link (XSS payloads)
M-MCModeling Correctness
The modeled environment violates the Markov assumption or does not correctly encapsulate the actual MDP underlying the security problem.
- Prevalence
- Across the 66 papers reviewed, we observed incorrect MDP modeling in 17 papers (25.8%), minor modeling errors in 6 papers (9.1%), and valid modeling in the remaining 43 papers (65.2%). The combined 34.9% of partially and fully present is primarily due to issues with state representation and transitions.
- Security implications
- When the Markov property is violated or the task is misspecified as an MDP, agents can learn spurious correlations between unrelated decisions. For example, formulating a classification task as sequential decision-making induces nonexistent temporal dependencies between independent samples. Separately, misaligned rewards can incentivize agents to maximize return through behaviors that undermine security objectives via reward hacking. Together, these modeling errors produce brittle policies that appear effective in controlled experiments but fail unpredictably when deployed.
- Recommendations
- First, the state transitions must reflect genuine sequential structure (next states are consequences of current state and action) rather than artificially chaining independent decisions. For example, independent samples in a detection task should seek alternative methods such as deep contextual bandits to avoid spurious correlations between states. If complete state information is unavailable in practice, the problem should be formulated as a POMDP with appropriate constraints rather than forcing a potentially misaligned MDP representation.
- Case study
- Link (XSS payloads)
M-POPartial Observability
The environment is inherently partially observable (i.e. a POMDP); however, it is treated as if it were fully observable without mitigating the partial observability.
- Prevalence
- Across the 66 papers reviewed, we identified clear partial observability issues in 20 papers (30.3%) and lesser issues in 20 papers (30.3%). Of these 40, 8 papers (12.1%) explicitly acknowledge the presence and potential issues of partial observability, yet do not mitigate it. The remaining 26 papers (39.4%) either did not consider a partially observable task or directly accounted for it in their modeling.
- Security implications
- Unmitigated partial observability often manifests as a vulnerability after training. Therefore, agents can develop ‘blind spots’ due to the unobservability of a system. Such policies may be optimal in simulation, but in the real-world they have a limited ‘key hole’ view, leaving them vulnerable to malicious actors.
- Recommendations
- Partial observability may be inherent to security tasks which often feature incomplete, delayed, or deliberately concealed information. Addressing this in modeling is therefore essential for making robust decisions under uncertainty. In such cases it should be explicitly formulated as a POMDP. Commonly this can be achieved by either encoding recent observations into the state representation, such as frame stacking used in Atari games, or employing recurrent policies (e.g., LSTM or Transformer) to maintain an internal memory. Other approaches aim to model the unobserved information, using techniques such as Hidden Markov Models or model-based approaches, to mitigate the impact of M-PO.
- Case study
- Link (XSS payloads)
T-HRHyperparameter Reporting
The hyperparameters governing training and agent architecture of an approach are not reported.
- Prevalence
- Across the 66 papers reviewed, we observed the complete absence of hyperparameters in 21 papers (31.8%), partial reporting of hyperparameters in 24 papers (36.4%), and complete hyperparameter reporting in the remaining 21 papers (31.8%). This omission fundamentally undermines reproducibility and hinders the advancement of DRL4Sec applications.
- Security implications
- Since minor variations in design choices can have a disproportionate effect on agent behavior, under-specifying hyperparameters makes results challenging to verify. Hyperparameter transparency is not only a matter of scientific rigor, but a prerequisite for establishing reliable and robust DRL cybersecurity applications that can perform tasks effectively.
- Recommendations
- At minimum, publications should report: (1) algorithm-specific hyperparameters, e.g., learning rate, discount factor γ, batch size, replay buffer size, and exploration parameters such as ε; (2) neural network architecture details, e.g., layer types, dimensions, activation functions, normalization techniques; (3) optimization settings, e.g., optimizer type, learning rate, gradient clipping coefficients; and (4) training procedures, e.g., total timesteps, update frequency, number of environments for parallel training. When space constraints prevent inclusion in the main text, it should be provided in appendices or supplementary materials.
- Case study
- MiniCAGE (network defense)
T-VAVariance Analysis
The inherent variance of DRL training is not investigated through explicit analysis of performance over multiple policies.
- Prevalence
- Across the 66 papers reviewed, we observed no discussion of multiple training ‘runs’ or variance analysis in 38 papers (57.6%), partial consideration of variance in 6 papers (9.1%), and multiple runs with variance analysis in the remaining 22 papers (33.3%). Indeed, two thirds of reviewed studies (44 papers, 66.7%) insufficiently consider variance.
- Security implications
- Favorable initial conditions, or ‘beginner’s luck’, a single run can over- or underestimate the perceived performance beyond the realistic mean of multiple runs. This is particularly unsafe in security contexts where consistent and reliable performance is crucial. Dismissing an approach based on a single bad run that can perform well on average, risks rejecting a valuable security solution. Alternately, agents that over-promise and under-deliver on average, expose end users to unnecessary risk.
- Recommendations
- As a lone trained agent is insufficient to establish representative performance of that agent, it is essential to train and evaluate multiple trained policies and report the statistical variance. Consequently, we recommend a minimum of N ≥ 5, and encourage higher runs (N ≥ 20 or N ≥ 50) for stronger statistical claims. To better represent the variance in agent behavior, statistical metrics must also be reported, for example: 95% confidence intervals, inter-quartile range (IQR), and risk-sensitive measures such as Conditional Value at Risk (CVaR). Variance should be reported within and between training episodes, and certainly for the final policies during testing.
- Case study
- MiniCAGE (network defense)
T-PCPolicy Convergence
The convergence of the policy is not demonstrated prior to the termination of training.
- Prevalence
- Across the 66 papers reviewed, we observed no demonstration of convergence in 28 papers (42.4%), partial demonstration or discussion in 19 papers (28.8%), and demonstration of convergence in the remaining 19 papers (28.8%). While many papers discuss the reasoning for the length of training used or mention convergence, explicit demonstration is often missing.
- Security implications
- Without demonstrating convergence, it is difficult to establish if an agent has learned a truly robust policy or if premature termination has left gaps in its decision-making for certain scenarios. Non-converged policies pose an increased risk as they behave unpredictably, which can be exacerbated in rare edge cases. In such scenarios, even otherwise optimal agents can behave erratically, leading to clear vulnerabilities in deployment.
- Recommendations
- The convergence of policies should be evaluated over the learning process to reveal training dynamics, such as instability or temporary performance plateaus before final convergence. We recommend the inclusion of figures showing episodic reward or task-specific metrics as clear evidence of stabilization before training termination. To ensure convergence is consistent, measures of training variance should be included.
- Case study
- MiniCAGE (network defense)
E-AMApplication Motivation
The application of DRL over traditional methods is not justified empirically or theoretically.
- Prevalence
- Across the 66 papers reviewed, we found that 8 papers (12.1%) provide neither empirical or theoretical motivation for their use of DRL; 21 papers (31.8%) offered only one of the forms of motivation; and 37 papers (56.1%) motivated in both forms. The majority of partial justification (17 papers, 25.8%) arises from only having theoretical motivation.
- Security implications
- The application of DRL in security is relatively under-explored in comparison to other learning paradigms. Replacing extensively studied methods with DRL, besides the other pitfalls we explore here, runs the risk of introducing novel attack surfaces. Therefore, the benefits of a DRL-based approach should surpass engineering in-domain approaches to replicate the sequential nature of DRL environments.
- Recommendations
- While DRL can perform a wide variety of complex tasks, much like other ML paradigms it is not suitable for all tasks. As a result, applying DRL to a novel task should be justified theoretically and, when possible, empirically. When baselines are available for comparison, they should be used to demonstrate the advantage of DRL, in addition to the motivation for applying DRL in the first place. When baselines are not available, motivation must demonstrate the necessity of re-formulating to a DRL task.
- Case study
- Adversarial malware creation
E-GAGain Attribution
Improvements stem from additional information or capabilities provided in MDP design rather than the learned policy itself.
- Prevalence
- Across the 66 papers reviewed, we found that 15 papers (22.7%) did not clearly demonstrate that the agent improved over baseline environmental performance; 18 papers (27.3%) demonstrated partial evaluation of where performance gains come from; and 33 papers (50.0%) adequately showed the contribution of the learned policy. Notably, 6 of the 15 papers fully exhibiting this pitfall explicitly acknowledge it but do not attempt to disentangle the sources of improvement.
- Security implications
- Misrepresentative gains can create false confidence in a proposed DRL approach. Such agents can give a false sense of robustness as their learned policy is not the primary source of effectiveness, making it easier for an adversary to attack. Thus such improvements reflect stronger baseline design rather than effective learning, and could be replicated by other agents given the same capabilities.
- Recommendations
- The value of the learned policy can be disentangled from environmental artifacts through two kinds of ablation. First, evaluating performance under random action sampling isolates the contribution of policy learning and establishes a baseline performance in the environment. As a result, improvements that arise solely from state-action engineering should be reported separately from the trained policy performance. Second, comparisons between different approaches (both DRL and other-paradigms) should be performed with equivalent information and capabilities (e.g., state–action spaces).
- Case study
- AutoRobust (adversarial malware)
E-ECEnvironment Complexity
Training and evaluation occur in an environment that is contrived or overly simplified.
- Prevalence
- Across the 66 papers reviewed, we found that 12 papers (18.2%) evaluated their approaches in overly simplified or contrived environments; 15 papers (22.7%) made some effort to improve environmental realism; and 39 papers (59.1%) evaluated on sufficiently realistic environments.
- Security implications
- Agents trained in overly simplified environments may learn effective policies, but these may be incapable of transferring to, or learning in, real environments. Indeed, the transfer from simulated to real environments (commonly referred to as the ‘sim-to-real’ gap) can lead to catastrophic failures. A concrete example of this is reward hacking where agents learn to exploit flaws in environmental modeling to maximize rewards, leading to policies that appear optimal but provide no genuine security value. These flaws become particularly dangerous in security contexts where the stakes of failure are high: organizations may deploy systems based on promising laboratory results only to discover that they underperform or are vulnerable in the real-world.
- Recommendations
- As a result of transferability issues from the sim-to-real gap, it is best practice to train and evaluate DRL in the most realistic environment feasible. Applying DRL to security problems should follow the evaluation best practices from that specific security domain. However, in some domains the use of real-world data or systems is challenging or infeasible. In such cases benchmarks should be used to demonstrate impact.
- Case study
- SQIRL (SQL injection)
D-UAUnderlying Assumptions
The environment or agent training requirements cannot be satisfied in real-world applications.
- Prevalence
- Across the 66 papers reviewed, we found that 10 papers (15.2%) contained unrealistic assumptions that would prevent real-world deployment (e.g., network defense on abstract graph structures); 9 papers (13.6%) suffered from minor or partially unrealistic assumptions (e.g., requiring real-time high quality labeled data in live deployments); and 47 papers (71.2%) operated under realistic deployment assumptions.
- Security implications
- Underlying Assumptions can create overconfidence in the capabilities of a DRL-based approach, which may not be directly evident during deployment. Such a system could be ineffective, underperforming, or even exploited, due to the disconnect between research and actual deployment. Furthermore, in cases of hard constraints like privileged data access or strict query budgets, the whole approach might be rendered invalid.
- Recommendations
- To ensure practical relevance and transparency we recommend designing evaluations to mirror real-world problems. Realistic deployment settings should be used by constraining observation/action spaces, and enforcing practical limits on query budgets and computation. In cases where such assumptions are unavoidable, ablations should show performance and robustness under constrained and noisy conditions. Finally, every study should include a brief summary of deployment requirements, such as privileges and training budgets.
- Case study
- MiniCAGE (action order)
D-NSNon-Stationarity
The environment does not effectively mitigate the inherent non-stationarity of the underlying cybersecurity task.
- Prevalence
- Across the 66 papers reviewed, we found that 23 papers (34.9%) failed to mitigate the inherent non-stationarity of their cybersecurity tasks; 13 papers (19.7%) considered some of the non-stationarity present in the task; and 30 papers (45.5%) did not have, or adequately handled, the non-stationary aspects of their chosen task. The most common unaddressed non-stationarity across the papers was the behavior of other actors in the environment, e.g., assumed fixed attacker in ACD.
- Security implications
- In practice, adversaries, network conditions, and software systems evolve continuously; yet agents trained under stationary assumptions learn on fixed dynamics and predictable behavior. Such agents are brittle to change and exploitable in dynamic environments, where they can fail by adopting obsolete strategies, or be manipulated by adversarial tactics. Critically, systems may appear effective under static evaluation providing a false sense of robustness, but perform unreliably, once deployed in the ever-changing landscape of cybersecurity operations.
- Recommendations
- Cybersecurity tasks are inherently dynamic, so DRL agents must be explicitly exposed to such variability during training. Environments should be designed for adaptation; for example, non-stationarity can be incorporated through temporal shifts, randomized parameters, evolving topologies, and adaptive adversaries. Additionally, techniques such as curriculum learning, domain randomization, and population-based training can further help agents generalize to progressively hardening conditions. Brittleness, and long-term resilience can then be measured through transfer tests against unseen strategies.
- Case study
- MiniCAGE (attacker strategy)
Case Study Environments
We conducted controlled experiments across three DRL4Sec domains to demonstrate the practical impact of the identified pitfalls. For all environments, their full MDP specifications are included in our repositories. To highlight pitfalls we performed didactic case studies, these are intended as illustrative examples where pitfalls have measurable, concrete, consequences in security environments. The specific consequence of a pitfall depends on the security problem, how it is modeled, implemented, algorithm chosen, and numerous other factors.
MiniCAGE Autonomous cyber defense
The enterprise network to be defended comprises 13 hosts across three subnets: a user subnet (5 hosts), an enterprise subnet (3 hosts plus 1 defender host), and an operational subnet (4 hosts including a critical server). The defensive (blue) agent must prevent an attacker (red) from reaching the critical server. MiniCAGE contains two attacker strategies: the B-Line attacker proceeds directly through the network to compromise the critical server as quickly as possible, while the Meander attacker attempts to compromise the entire network while en route to the critical server.
AutoRobust Adversarial malware creation
In this environment, the agent is presented with a detected malware sample, and must transform it so that it is misclassified. Rather than modifying the executable, the agent operates on a structured behavioral representation extracted from sandbox execution, consisting of system interactions such as file accesses, registry modifications, executed commands, and API usage. At each step, the agent edits or adds report entries to cross the decision boundary while maintaining a plausible behavioral trace.
Link Web security testing: XSS
The Link DRL agent uses a hand-crafted state-action space to iteratively build XSS payloads. We retrain Link on WAVSEP, a collection of deliberately vulnerable web-applications, following the settings from the original work. WAVSEP contains 32 XSS vulnerabilities.
SQIRL Web security testing: SQL injection
The SQIRL DRL agent uses embeddings of SQL payloads, and statements to handle a dynamic action space, to generate payloads. We retrain SQIRL on its training benchmark, the SMB, which includes 20 training samples, and 10 testing samples (including 5 reproduced CVEs), following the original training and settings of the work.
Case Study of Modeling Pitfalls
We use the Link XSS payload generation environment to show how modeling decisions impact performance. Although the original environment contains valid Markovian transitions, its design introduces unnecessary partial observability and misalignment with the practical security task. This arises from overlapping features in the state space, whereby multiple XSS payloads can be mapped to identical DRL states. For example, a single feature is used to indicate multiple HTML tags (e.g., img, video, audio or svg tags). The unintentional pitfalls introduced by this design can be rectified through reformulation of the MDP.
Thus, we consider two formulations of the MDP for this task: (1) Original, that have merged states; (2) Distinct States, that unrolls the conflated payload features into distinct values, increasing the state dimensionality by 12.8% from 47, to 53.
Table 1: Link on WAVSEP
Percent of vulnerabilities found (VF%) and 95% CI results for Link over 20 runs demonstrating the impact of modeling choices.
| MDP | VF (%) | 95% CI |
|---|---|---|
| Original | 75.2 | (59.4, 90.9) |
| Distinct States | 85.3 | (76.7, 94.0) |
Modeling Correctness & Partial Observability. Introducing Distinct States for each possible payload aligns the MDP with the underlying security task avoiding M-MC. Therefore, the agent can develop correct payloads by selecting actions and observing the distinct impact they have on the current payload. Thus, removing the unnecessary partial observability, M-PO, from the environment. This effect can be observed concretely in Table 1 where including Distinct States increases the percentage of vulnerabilities found over Original by 10.1% and the raising lower bound performance by 17.3%. Therefore, through minor changes in the state space to remove the M-MC and M-PO pitfalls, we can observe significant improvements in performance.
MDP Specification. Although originally defined clearly, the performance difference between MDP formulations in Table 1 demonstrates that when components are left unclear, MDP Specification can severely impact final performance.
Case Study of Training Pitfalls
To evaluate the impact of pitfalls in policy training, we use MiniCAGE. Specifically, we evaluate four hyperparameter settings for T-HR, investigate variance and convergence for T-VA and T-PC, respectively.
Hyperparameter settings in MiniCAGE
The four PPO settings whose training curves (20 runs each, 95% CI) the paper plots, and what it reports for each.
| Setting | What changes | At 2.5 million steps |
|---|---|---|
| Default HPs | Stable Baselines 3 defaults for PPO | Relative convergence at 2.0–2.5M steps, minor variance |
| Alt Clipping | PPO’s loss clipping | Relative convergence at 2.0–2.5M steps, minor variance |
| Alt Learning Rate | Learning rate | Still increasing, higher variance |
| Alt Discount Factor | Discount factor for future rewards | Still increasing, higher variance |
Impact of Hyperparameters. We examine the final performance at 2.5 million steps and see how changing a single hyperparameter results in drastically different performance, highlighting how hyperparameter transparency is needed to ensure reproducibility.
Analyzing Variance. Concretely, at 500k the upper CI bound of the ‘Alt Learning Rate’ appears to be the second best performing agent. However, we see from the variance that an agent at this upper CI bound is not representative of the (lower) mean performance. By evaluating over multiple runs and reporting 95% CI, we obtain a more accurate picture of actual performance.
Demonstrating Policy Convergence. The ‘Default HPs’ and ‘Alt Clipping’ settings show relative convergence at 2.0-2.5 million steps where plateauing performance curves and minor variance can be seen. In contrast, the ‘Alt Learning Rate’ and ‘Alt Discount Factor’ are still increasing in performance with higher variance at 2.5 million steps.
Case Study of Evaluation Pitfalls
Here we consider the three pitfalls we identified in evaluating agents: first, the attribution of gains in the AutoRobust environment; second, the theoretical motivation of DRL in adversarial malware generation; third, environment complexity comparisons in the SQIRL environment for SQL injection.
Identifying the Source of Gains. To assess the impact of the E-GA pitfall, the goal in the AutoRobust environment is to disentangle the contributions of different elements in the approach. First, we train and evaluate policies with full access to the internal state of the malware detection model, referred to as MDP. Second, we consider policies without internal state access, named POMDP, to evaluate the performance of learning under a more restrictive and realistic threat model. Finally, we evaluate Random policies that sample actions at random, to isolate the intrinsic efficacy of the action space itself. There are two key takeaways. First, full observability does not guarantee better performance, as agents can struggle to learn the task even with fully observable information. Second, while trained policies (MDP & POMDP) have the potential to achieve better performance, the random baseline is already strong. This demonstrates the importance of E-GA as the action space alone provides a large portion of overall performance.
Motivating the Application. As an example of theoretical motivation, in the domain of adversarial malware creation, DRL has several key capabilities over existing gradient-based attacks. Concretely, gradient-based methods assume a fixed input size, limiting exploration to only a very small subset of the actual transformations an adversary can make. Similarly in malware, gradient-based perturbations on the feature representation do not have a consistent and reliable method for being mapped to valid changes in the problem-space, i.e., the actual program. In contrast, DRL can operate directly on malware samples, bypassing the need for feature to problem-space mapping. Furthermore, given an adversary with a well defined sets of actions, at convergence DRL can additionally confer probabilistic guarantees on the level of vulnerability/robustness.
Changing Environment Complexity. To show the effect of E-EC we use the SMB benchmark from SQIRL. Using the SMB we train two policies, one on the default SMB with a Combined sanitized and non-sanitized vulnerability set, and one policy with the same vulnerabilities without sanitization (Non-Sanitized). We evaluate both trained policies on the SMB test set of sanitized and non-sanitized vulnerabilities; Table 2 shows the percentage of vulnerabilities found across 20 runs with 95% CI.
Table 2: SQIRL on the SMB
Percent of vulnerabilities found (VF%) and 95% CI for SQiRL across 20 runs and evaluations each setting. Showing the impact of evaluating on low-complexity environments.
Training environment (rows) against evaluation environment (columns)
| Training environment | Sanitized | Non-Sanitized |
|---|---|---|
| Combined | 41.10(33.9, 48.4) | 88.5(85.4, 91.6) |
| Non-Sanitized | 29.80(22.9, 36.8) | 88.7(85.5, 91.9) |
We see both the Combined and Non-Sanitized agents are capable of discovering vulnerabilities in the simplified non-sanitized settings. However, when changing the evaluation set to the more challenging Sanitized vulnerabilities we see a 47.4% drop in vulnerabilities found for the Combined agent, with a further 11.3% for the non-sanitized agent. This demonstrates how simplified evaluation environments can inflate performance, producing promising results that fail to translate into real-world capabilities.
Case Study of Deployment Pitfalls
We evaluate the impact of pitfalls in deploying DRL agents using MiniCAGE. First, we consider Underlying Assumptions by modifying the assumed fixed action order between attacker and defender during testing, blue then red (B→R) in the original formulation. Second, we study Non-Stationarity by changing the fixed attacker strategy between training and testing.
Table 3: MiniCAGE deploying agents
Experimental results for MiniCAGE deploying agents case study. The top section shows blue agent performance when training and evaluation action orders differ. The bottom section shows blue agent performance against different red adversaries. Zero is the theoretical max score.
Training order (rows) against evaluation order (columns)
| Training order | R→B | B→R | Mixed |
|---|---|---|---|
| R→B | −15.8(−14.8, −16.7) | −21.0(−19.0, −23.1) | −18.3(−17.0, −19.6) |
| B→R | −72.7(−65.6, −79.9) | −17.2(−16.7, −17.7) | −45.5(−42.0, −49.0) |
| Mixed | −28.4(−25.6, −31.2) | −19.9(−19.2, −20.6) | −24.6(−22.9, −26.2) |
Training red agent (rows) against evaluation adversary (columns)
| Training red agent | B-line | Meander | Mixed |
|---|---|---|---|
| B-line | −19.0(−20.9, −17.2) | −104.1(−120.7, −87.6) | −61.4(−70.5, −52.3) |
| Meander | −79.0(−97.2, −60.9) | −61.0(−74.7, −47.3) | −70.2(−83.5, −56.9) |
| Mixed | −40.2(−47.1, −33.4) | −79.2(−86.5, −71.9) | −60.2(−65.8, −54.7) |
Breakdown of Underlying Assumption. The first section of Table 3 shows the average reward of the DRL defender when varying the action order of red and blue agents in training and testing (e.g., R→B indicates red then blue and Mixed indicates random turn order). As expected, agents perform comparably when tested on the same training order (−17.2 for B→R and −15.8 for R→B). When the assumed order changes, performance degrades: minimally for R→B agent (−21.0) and drastically for the B→R agent (−72.7). These results highlight how minor design choices can degrade performance if the assumptions they rely on do not hold in practice.
Changing Attacker Strategy. Table 3 shows the average reward of defender agents under varying attacker strategies: B-Line and Meander. The agent order is kept constant as B→R. We see a degradation in performance when any stationary blue agent is evaluated against unseen or mixed attacker strategies. This degradation can be mitigated by including non-stationary attacker strategies during training as the Mixed blue agent outperforms the stationary defenders in both mixed and cross evaluations. These results show that policies can be brittle to changing conditions when trained without accounting for non-stationarity.
To support open science and promote reproducibility, we provide the following repositories. GitHub and Zenodo. Each case study directory contains the modified environment, the training/evaluation scripts, the MDP specification, and a case_study.diff documenting all changes from the original open-source repository released with their respective papers. The full reproduction of 20 seeds is computationally-intensive, therefore, we recommend running a single seed.
Actionable Recommendations
We encourage researchers to carefully consider the pitfalls of DRL for cybersecurity and, where applicable, apply the recommendations from this work.
- Environment modeling
- M-MSMDP Specification. Crucially, assumptions, approximations, or simplifications must be explicitly discussed. When space constraints prevent full specification in the main text, this should be provided in appendices or supplementary materials.
- M-MCModeling Correctness. The state transitions must reflect genuine sequential structure (next states are consequences of current state and action) rather than artificially chaining independent decisions.
- M-POPartial Observability. Partial observability may be inherent to security tasks which often feature incomplete, delayed, or deliberately concealed information. In such cases it should be explicitly formulated as a POMDP.
- Agent training
- T-HRHyperparameter Reporting. Complete hyperparameter reporting is necessary for reproducible, trustworthy research in cybersecurity as DRL algorithms are highly sensitive to hyperparameter choices.
- T-VAVariance Analysis. We recommend a minimum of N ≥ 5, and encourage higher runs (N ≥ 20 or N ≥ 50) for stronger statistical claims.
- T-PCPolicy Convergence. We recommend the inclusion of figures showing episodic reward or task-specific metrics as clear evidence of stabilization before training termination.
- Performance evaluation
- E-AMApplication Motivation. Applying DRL to a novel task should be justified theoretically and, when possible, empirically.
- E-GAGain Attribution. Evaluating performance under random action sampling isolates the contribution of policy learning and establishes a baseline performance in the environment.
- E-ECEnvironment Complexity. As a result of transferability issues from the sim-to-real gap, it is best practice to train and evaluate DRL in the most realistic environment feasible.
- System deployment
- D-UAUnderlying Assumptions. Realistic deployment settings should be used by constraining observation/action spaces, and enforcing practical limits on query budgets and computation.
- D-NSNon-Stationarity. Cybersecurity tasks are inherently dynamic, so DRL agents must be explicitly exposed to such variability during training.
Conclusion
The autonomous and adaptive decision-making that DRL can offer in complex environments has significant potential for cybersecurity applications. However, our review of 66 DRL4Sec papers published between 2018-2025 reveals 11 common methodological challenges (pitfalls) that undermine DRL4Sec research. Through case studies in autonomous cyber defense, adversarial malware creation, and web security testing, we demonstrate these pitfalls directly impact performance and create potentially brittle policies.
- Prevalence Analysis. We systematically examine 66 DRL4Sec papers published between 2018 and 2025, quantifying the occurrence and severity of pitfalls across diverse security domains.
- Pitfall Taxonomy. We define 11 pitfalls when adapting DRL to cybersecurity, organized across four stages of development (modeling, training, evaluation, and deployment).
- Impact Demonstration. Through experiments using existing DRL4Sec environments in three representative domains, we provide empirical evidence of the impact caused by these pitfalls.
- Actionable Recommendations. We provide concrete guidance to mitigate each pitfall, supporting the development of more rigorous and reliable DRL4Sec research.
Through the identification of 11 DRL4Sec pitfalls and recommendations for their mitigation, this work establishes higher methodological standards for future applications of DRL to cybersecurity.
Cite
@inproceedings{McFadden2026Pitfalls,
title={SoK: The Pitfalls of Deep Reinforcement Learning for Cybersecurity},
author={Shae McFadden and Myles Foley and Elizabeth Bates and Ilias Tsingenopoulos and Sanyam Vyas and Vasilios Mavroudis and Chris Hicks and Fabio Pierazzi},
booktitle={35th USENIX Security Symposium (USENIX Security 26)},
year={2026}
}