Shae McFaddenSM

Building Better Environments for Autonomous Cyber Defence

AAMAS Workshop Workshop on AI for Critical National Infrastructure (AI4CNI) at AAMAS, 2026

  • Chris Hicks
  • Elizabeth Bates
  • Shae McFadden
  • Isaac Symes Thompson
  • Myles Foley
  • Ed Chapman
  • Nickolas Espinosa Dice
  • Ankita Samaddar
  • Joshua Sylvester
  • Himanshu Neema
  • Nicholas Butts
  • Nate Foster
  • Ahmad Ridley
  • Zoe M
  • Paul Jones
  • The Alan Turing Institute
  • University College London
  • King’s College London
  • Cornell University
  • Vanderbilt University
  • Microsoft
  • EPFL
  • NSA

Abstract

In November 2025, the authors ran a workshop on the topic of what makes a good reinforcement learning (RL) environment for autonomous cyber defence (ACD). This paper details the knowledge shared by participants both during the workshop and shortly afterwards by contributing herein. The workshop participants come from academia, industry, and government, and have extensive hands-on experience designing and working with RL and cyber environments. While there is now a sizeable body of literature describing work in RL for ACD, there is nevertheless a great deal of tradecraft, domain knowledge, and common hazards which are not detailed comprehensively in a single resource. With a specific focus on building better environments to train and evaluate autonomous RL agents in network defence scenarios, including government and critical infrastructure networks, the contributions of this work are twofold: (1) a framework for decomposing the interface between RL cyber environments and real systems, and (2) guidelines on current best practice for RL-based ACD environment development and agent evaluation, based on the key findings from our workshop.

Introduction

Cyber attacks pose serious risks to individuals, businesses, and governments, whose daily operations all depend on networked systems. In recent history these risks have manifested as costly attacks on critical systems including nuclear facilities and power grids.

To counter such threats, agent-based Autonomous Cyber Defence (ACD) systems that can immediately monitor, adapt, and respond are key. In particular, Reinforcement Learning (RL), a subset of Machine Learning (ML) that learns through interaction with an environment has received significant interest in the literature. The unique advantage of RL, compared to agents based on pre-trained generative models, is the ability to learn how to achieve a specific goal exclusively from interacting with an environment. RL agents, therefore, do not rely on prior human knowledge or understanding. This is especially important for ACD as adversaries frequently exploit the assumptions made when systems were designed and configured.

For RL to succeed at ACD, there are at least three core challenges:

Fidelity

The environment must accurately and efficiently represent the real-world network defence problem at an appropriate level of fidelity (e.g., via a cyber environment) including, but not limited to, the network topology, attacker behaviour, and the functionality of software components.

The interface

Proper consideration must be given to the interface between the learning agent and the environment, including the identification of a suitable numerical reward mechanism.

Evaluation

A robust evaluation methodology, including appropriate measures of success and statistical significance, must be implemented.

Towards addressing the core challenges in ACD, this work makes the following main contributions:

  • We propose a framework for decomposing the components and modelling choices involved in mapping between ACD environments and real systems.
  • We provide guidelines on best-practice in relation to each framework component, based on the findings from our workshop, providing a valuable reference for anyone engaged in cyber environment development.

Workshop Methodology

This paper is informed by a structured online workshop bringing together 25 domain experts from across academia, industry and government with experience in RL-based cyber defence. The workshop included focused discussions and interactive activities to extract limitations, design considerations, and best-practice recommendations for ACD. These were explored from three distinct perspectives: security, RL, and environment development. Insights were gathered via collaborative tools and facilitator notes, then processed through thematic analysis into the framework and best practice recommendations presented in this work.

25domain experts from across academia, industry and government
3distinct perspectives: security, RL, and environment development

RL for Cyber Defence

It is the authors’ view that RL solution methods (e.g., model-free, on-policy) and algorithms that apply them (e.g., PPO, DQN) are not the main bottlenecks in RL for ACD. Instead, the core challenge of ACD remains how best to formulate a particular network defence problem within the RL framework.

Informally, the RL learning problem is one where an agent learns how to act in an environment over time to achieve a goal. At each step, the agent selects an action, and then receives an observation and a reward. Through sequential interaction with the environment, the agent learns a policy that aims to maximise the cumulative expected reward. This interaction is modelled as a Markov Decision Process (MDP) with the assumption (a.k.a the Markov property) that the future is independent of the past given the present. The horizon for future rewards is most often bounded by an episode, which starts in an initial state and ends upon arriving at a terminal state (or condition). Finally, when the state space of the environment is not able to be fully observed by the agent, the task is instead modelled as a partially observable MDP (POMDP).

Cyber Defence as an RL Task

Some famous RL tasks (e.g., chess) fit the RL paradigm without significant alteration. However, cyber defence is a complex set of real world problems that does not naturally present a single RL task. Beyond comprising multiple tasks and objectives that may change across time, cyber defence is a challenging application for RL because the state of the environment is both extremely large and almost never completely known; adversaries and users introduce non-stationary dynamics; representing cyber security goals as scalar rewards is difficult; operational constraints may be difficult to represent in the action space; and accurate simulators are necessary (e.g., for safety and efficiency) but challenging to build and interface with correctly.

Although cyber defence is not a single problem, cyber environments have thus far converged on a relatively constrained interpretation: a defensive blue agent is tasked with defending a network of hosts against one or more fixed-strategy adversaries.

Action space

The action space is usually an enumeration of high-level command and control (C2) techniques (e.g., scan, deny, restore).

Observation space

The observation space (i.e., the real network state is not completely known) is a vector of selected attributes from the underlying network (e.g., one bit per host to indicate whether a compromise has been detected).

Reward function

The reward function is typically engineered by domain experts and includes penalties and/or incentives for various network states and actions (e.g., -2 when a host is compromised, -1 for restoring a host, +0.1 for making no intervention).

In other words, defending the network becomes the task of minimising the number of compromised hosts whilst making conservative use of costly actions.

Thus, this network defence task of ACD is commonly framed as a finite horizon sequential decision-making problem in which a blue agent receives partial observations from an environment comprising a network of hosts, an adversarial red agent, and possibly benign green agents representing regular user activity. Crucially in this framing, the environment comprises everything that is not the blue agent: the network of hosts, regular users, and the adversary.

Since the real network is likely of operational significance, and the RL learning framework includes learning from “mistakes” to choose better actions over time, a virtual cyber environment is the standard way to train a network defence agent. Whether blue agents are useful for the real network defence problem therefore depends significantly on how well the cyber environment models the real environment.

A Framework for ACD Environments

The divergence between environments and real-world systems, known as the sim-to-real gap, hinders the transfer of agent performance from training to deployment. Designing high fidelity network environments can help to close the gap but is not entirely sufficient. Equally, the formulation of the RL task matters as it fundamentally constrains both what and how (i.e., learning dynamics) the agent learns. Thus, the sim-to-real gap comprises two key components: virtualisation of the environment and modelling of the task.

2virtualisation gap components: network and host simulation; user and threat simulation
4modelling gap components: sequence, observation, action and reward modelling
BLUE AGENT RL policy ot rt at INTERFACE MODELLING GAP Observation vector Reward scalar Action scan / restore Sequence time steps monitored state host status executed on hosts NETWORK VIRTUALISATION Hosts & services topology, software Red agent adversary Green agents regular users VIRTUALISATION GAP REAL CYBER NETWORK production hosts, real users, real adversaries
Virtualisation vs. modelling gap. The virtualisation gap encompasses the difference between the simulated and real-world network defence problems. The modelling gap comprises the interface between the network defence problem (e.g., simulation model) and the RL task (i.e., a POMDP).

Virtualisation gap

If RL agents could be trained on a real production network, with real users and attackers, then there would be no virtualisation gap. The virtualisation gap can be split into two components: (1) the network and host simulation including its topology and operational characteristics, and (2) user and threat simulation.

Modelling gap

The modelling gap includes observation modelling (e.g., a vector derived asynchronously from network state information), action modelling (e.g., an enumeration of actions and how they are executed on network hosts), sequence modelling (i.e., how POMDP time steps relate to the occurrence of network events) and reward modelling (i.e., how to provide scalar rewards in alignment with real-world goals). Modelling choices significantly impact how effective learned agent policies are, irrespective of the simulation gap, but are also constrained by simulation fidelity.

Key idea

Insufficiency in either simulation or modelling limit the real world performance ceiling of RL agents by creating poorly aligned and artificially challenging RL tasks.

The Virtualisation Gap

Network and Host Simulation

High-fidelity simulation of the network and hosts is both feasible, owing to widely available virtualisation software, and preferable for minimising the simulation gap. Low fidelity cyber environments offer high efficiency, making it cheaper to train RL agents, but introduce the significant risk of simulator artifacts. Agents learning from artifacts may perform very well in the simulator yet behave poorly, and unpredictably, in the real world.

User and Threat Simulation

Both regular network users and adversarial threats are an essential part of modelling a network defence problem. Within a cyber environment these are represented by green and red agents, respectively. In proportion to the realism of their behaviour both green and red agents have a large impact on the simulation gap. Since red agents model adversarial behaviour, they determine the distribution and severity of threats encountered by the blue agent in the environment. Therefore, if the strategies they simulate are not sufficiently realistic (e.g., simplistic, predictable, or overt) then the defensive policies trained will be brittle with marginal success transferring to real-world deployments. Green agents are of equal importance, as without benign user simulation the blue agent may learn policies that succeed at defence but significantly disrupt normal traffic.

The Modelling Gap

Hundreds of processes run concurrently on modern operating systems and network packets are sent, reordered, dropped and received between devices without coordinated clocks. Sequence modelling captures the temporal relationship between continuous, asynchronous network activity and the discrete-time sequence of agent actions, observations and rewards required for RL. Sequence modelling is crucial because the action, observation and reward modelling components must preserve causal ordering, allowing meaningful state transitions and reward attribution, which all depend on understanding how the network, hosts and other agents may advance between each time step.

REAL NETWORK Users Adversary Defender RL TASK t t+1 t+2 t+3 t+4 a a a a each step assumed to take equal wall time wall-clock time
Sequence Modelling. The relationship between continuous, asynchronous real-world network activity (top) and the discrete-time RL sequence trajectory (bottom).

The MDP discount factor γ, which determines an effective prior over the relevance of future rewards, and the RL task episode length when fixed, both typically assume fixed per-step wall time and therefore depend greatly on sequence modelling.

Observation Modelling

The true underlying state of the network is far too large to input to any practical algorithm (e.g., a single workstation hard disk may have 1TB of state information) and is distributed over many devices. Thus, the network state must be aggregated and parsed to provide vector observations for the RL agent.

Action Modelling

In network defence, operations are usually carried out using highly expressive graphical and command-line user interfaces. Action modelling involves constructing a set (discrete, continuous, or both) of actions that map to a useful set of choices relevant to the network defence task.

Reward Modelling

The goal of network defence is to minimise adversarial disruption while maintaining normal operations for non-malicious users. Reward modelling involves identifying scalar incentives and penalties which correspond to achieving one or more network defence goals when their combination is maximised over the discounted horizon.

Towards Better Cyber Defence Environments

This section distils best-practice insights from domain experts into actionable guidelines, designed to maximise RL task effectiveness and real-world transfer, structured around the framework. As the main focus of academic work to date, this best-practice focusses on single-agent ACD environments for network defence.

Real-world problem
Virtualisation
RL modelling
Evaluation

Characterising the Real-World Problem

Before any simulation or RL modelling decisions are made, it is essential to clearly define the target network defence problem. The problem scope will determine which real-world dynamics must be captured, which abstractions may be acceptable, and how problem complexity can be introduced over time.

Specify the Problem, Constraints & Success Criteria
The first step is to fully specify the network defence problem to be investigated. The specification should characterise the network environment (e.g., topology, scale, host details and roles), operational and business requirements (e.g., user data must have high availability), assets to be protected (e.g., critical hosts, sensitive data), adversarial assumptions (e.g., goals, tactics, techniques, and procedures), and the capabilities and constraints of defensive actors.
Identify Areas of Uncertainty
Uncertainty may arise from: the network environment (e.g., variations in network topology and host behaviour), the distribution of expected user and attacker profiles, and defender errors (e.g., malware misclassification). Characterising uncertainty helps to identify generalisation requirements and may improve alignment between the training, evaluation and deployment performance by allowing agents to be robust to unseen distributions of trajectories.
Detail a Minimum Viable Problem
The combination of a complex full-scale network defence problem, and well-known RL learning reliability challenges, is ill-suited to efficient debugging and early experimental iteration. Thus, it is important to construct a well-scoped minimum viable problem that can eventually scale to the required complexity. Once the core problem structure is understood, realism can be systematically reintroduced to recover the full-problem.

Conclusion

  • Building effective RL environments for ACD requires principled decisions at every stage of design, from characterising the real-world problem to virtualisation of the network and modelling the agent interface.
  • This paper provides a conceptual framework that maps the core components of ACD environments to two parts of the sim-to-real gap, virtualisation and modelling.
  • Using this framework, the paper provides a systematisation of best practice guidelines.
  • The central theme of these guidelines is that utility of an ACD environment is determined by how faithfully its design reflects the structure and constraints of the real-world problem; without this grounding, agents risk being optimised for performance in the training environment that does not transfer to capabilities in the operational task.
  • We hope that the framework and best practice guidelines provided in this paper enable the development of more effective ACD environments.

Cite

@misc{hicks2026building,
      title={Building Better Environments for Autonomous Cyber Defence},
      author={Chris Hicks and Elizabeth Bates and Shae McFadden and Isaac Symes Thompson and Myles Foley and Ed Chapman and Nickolas Espinosa Dice and Ankita Samaddar and Joshua Sylvester and Himanshu Neema and Nicholas Butts and Nate Foster and Ahmad Ridley and Zoe M and Paul Jones},
      booktitle={Workshop on AI for Critical National Infrastructure (AI4CNI) at AAMAS},
      year={2026}
}