Abstract
A significant challenge for autonomous cyber defence is ensuring a defensive agent's ability to generalise across diverse network topologies and configurations. This capability is necessary for agents to remain effective when deployed in dynamically changing environments, such as an enterprise network where devices may frequently join and leave. Standard approaches to deep reinforcement learning, where policies are parameterised using a fixed-input multi-layer perceptron (MLP) expect fixed-size observation and action spaces. In autonomous cyber defence, this makes it hard to develop agents that generalise to environments with network topologies different from those trained on, as the number of nodes affects the natural size of the observation and action spaces. To overcome this limitation, we reframe the problem of autonomous network defence using entity-based reinforcement learning, where the observation and action space of an agent are decomposed into a collection of discrete entities. This framework enables the use of policy parameterisations specialised in compositional generalisation. We train a Transformer-based policy on the Yawning Titan cyber-security simulation environment and test its generalisation capabilities across various network topologies. We demonstrate that this approach significantly outperforms an MLP-based policy when training across fixed-size networks of varying topologies, and matches performance when training on a single network. We also demonstrate the potential for zero-shot generalisation to networks of a different size to those seen in training. These findings highlight the potential for entity-based reinforcement learning to advance the field of autonomous cyber defence by providing more generalisable policies capable of handling variations in real-world network environments.
Introduction
Enterprise networks are inherently dynamic; devices constantly join, leave, and move, creating a shifting landscape for security. For autonomous cyber defence agents, this variability presents a major technical hurdle. Traditional Deep Reinforcement Learning (RL) typically relies on Multi-Layer Perceptrons (MLPs), which require fixed-size input vectors. If an agent is trained to defend a 10-node network, it cannot inherently process an 11th node. Furthermore, MLPs lack "exchangeability"—they assume a feature at a specific index always represents the same object. In a real network, a node at index $i$ might be a critical server today and a peripheral device tomorrow. This brittleness prevents standard RL agents from being effectively deployed in evolving real-world environments.
Methodology: Entity-based RL
To address these limitations, we reframe network defence as an Entity-based Reinforcement Learning problem. Instead of viewing the network as a single, rigid vector, we treat it as a collection of discrete "entities" (nodes).
The Framework and Architecture
We utilize Entity Gym, an interface designed for environments with a variable number of objects. For the policy architecture, we employ RogueNet, a Transformer-based model. Unlike MLPs, Transformers use attention mechanisms to process a "bag" of entities. This approach is naturally permutation-invariant; the model focuses on the relationships between node features rather than their specific index or the total count of nodes. Training is conducted using Proximal Policy Optimization (PPO).
Experimental Evaluation
We evaluated our approach using Yawning Titan, an open-source graph-based cyber-security simulation. Networks were generated using the Erdős-Rényi model to create realistic, connected graphs of varying scales.
We compared the entity-based agent against a standard MLP-based PPO baseline across two primary training modes:
- Static: The agent trains on one fixed network topology.
- Random: The agent encounters a new, randomly generated network topology every episode.
Key Results
Compositional Generalization and Exchangeability
The entity-based approach allows the agent to learn the concept of a node and a threat rather than memorizing a specific map. In the Random topology environment, the MLP-based agent failed to find a consistent strategy due to the lack of exchangeability. In contrast, the entity-based RogueNet thrived, achieving near-perfect episodic rewards (~95-98).
Zero-Shot Scaling
A critical finding of this research is the ability to scale. An agent trained exclusively on 10-node networks was tested on 20-node and 40-node networks without further training. This agent performed almost identically to agents trained natively on those larger sizes, demonstrating true "zero-shot" generalization.
Performance Parity
In static environments, where MLPs might be expected to have an advantage by memorizing the fixed map, the entity-based approach matched the MLP's performance. This indicates there is no "flexibility tax" for adopting the more generalizable Transformer architecture.
Conclusion and Future Work
Entity-based RL offers a promising path toward deployable autonomous cyber defence. By moving away from fixed-size vectors to compositional entities, agents can handle the dynamic nature of real-world networks.
Future research will focus on incorporating network connectivity (edges) more explicitly, perhaps through Graph Neural Networks (GNNs) or attention masking. Additionally, testing these agents in higher-fidelity environments with more complex action spaces and diverse node types (e.g., servers vs. workstations) will be essential for moving toward real-world application.
Summary updated