Introduction
Reinforcement Learning (RL) has emerged as a powerful tool for training autonomous "red-team" agents capable of simulating complex cyberattacks. However, these agents often operate as "black boxes," providing little insight into the reasoning behind their strategic choices. This lack of transparency is a significant barrier to trust and safety in cybersecurity operations. Without understanding why an agent pivots to a specific server or how it learns to escalate privileges, defenders cannot effectively use these simulations for risk assessment, and developers struggle to debug "degenerate learning" patterns where agents farm points without achieving meaningful objectives.
The Multi-Layer Explainability Framework
To address this opacity, we propose a unified, agent-agnostic framework that analyzes RL agents at two distinct levels: strategic and tactical.
Strategic-Level (MDP) Explainability
At the strategic level, the framework models the attack as a Partially Observable Markov Decision Process (POMDP). It segments the agent's behavior into distinct phases of the attack lifecycle. The Early Phase is characterized by reconnaissance and high uncertainty, while the Late Phase involves targeted exploitation and high confidence. By tracking these transitions, we can identify the "tempo" of an autonomous adversary and understand how different exploration strategies shape an agent's "personality."
Tactical-Level (Policy) Explainability
The tactical layer examines the internal policy of the agent by tracking the temporal evolution of Q-values—the agent's estimation of an action's future value. This reveals when specific tactics, such as credential cracking or OS fingerprinting, become preferred. Additionally, the framework utilizes Prioritized Experience Replay (PER) signals to pinpoint "inflection points"—critical moments in training where a high-impact realization fundamentally reshapes the agent's policy.
Experimental Evaluation
The framework was evaluated using Microsoft’s CyberBattleSim, utilizing environments like ToyCTF (a hub-and-spoke enterprise network) and CyberBattleChain (scalable linear topologies with up to 500 nodes). These setups allowed for testing the framework's ability to handle increasing network complexity and different RL architectures, including Deep Q-Learning (DQL) and Proximal Policy Optimization (PPO).
Key Insights
The "PER" Paradox
A significant finding was that Prioritized Experience Replay (PER), while generally a performance booster in RL, can actually degrade performance in large-scale cyber environments. The framework revealed that PER caused agents to over-focus on transient, "noisy" experiences, leading to unstable value propagation in networks with 100 or 500 nodes compared to standard DQL.
Early Detection of Policy Collapse
The framework can identify "policy collapse"—where an agent enters a non-productive, repetitive loop—using internal signals like logit margin and entropy. These indicators often signal failure long before it becomes apparent in aggregate reward curves, providing a vital diagnostic tool for developers to tune their models.
Results and Discussion
Deep Q-Learning (DQL) was found to be the most stable and scalable baseline for large networks. In the ToyCTF environment, the framework successfully mapped the agent's transition from random scanning to informed reconnaissance, specifically noting a pivot toward OS fingerprinting (remote(ProbeLinux)) by Episode 25.
The framework's ability to expose replay-induced instability in complex environments like CC500 offers a clear path for refining training regimes. By correlating spikes in TD-error (learning signals) with policy failures, developers can better understand and mitigate the factors that prevent an agent from consolidating a winning strategy.
Conclusion and Future Work
This multi-layer framework provides a necessary lens into the decision-making processes of RL-based cyber agents, moving beyond simple performance metrics to explainable strategic shifts. Future work will expand this explainability to multi-agent scenarios involving active defenders and incorporate human-centric evaluations to ensure that these complex RL "explanations" are truly actionable for security analysts.
Summary updated