arXiv:2610.33234cs.CROct 2026

Manuscript Offprint

arXiv:2610.33234

Alignment of Autonomous Cyber Defense Agents via Adaptive Policy Shaping

Dena Mujtaba, Bharadwaj Ravichandran, Brian Hu, Arslan Basharat

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Cybersecurity operators increasingly encounter sophisticated and fast-paced attacks, making autonomous cyber defense (ACD) a critical approach for supporting timely and effective decision-making. Reinforcement learning (RL)-based ACD agents have the ability to autonomously observe network states and take actions to defend and recover system assets, making them well suited for ACD. However, these agents often face critical trade-offs, such as improving network security while inadvertently degrading service availability or violating other operational priorities such as confidentiality and integrity, raising the core challenge of aligning agent behavior with human-specified goals and intent. In this work, we study the problem of aligning RL-based ACD agents with human-specified operational objectives without requiring costly retraining. We formalize alignment for ACD as a policy shaping problem, where a pretrained RL decision-making policy can be adjusted at test time using predicted attributes over agent actions. We also propose an adaptive approach that dynamically controls the alignment-performance trade-off as operational priorities shift during an ongoing cyber attack. We evaluate our method in a simulated cyber defense environment, CybORG, analyzing performance across multiple alignment objectives using the Confidentiality, Integrity, and Availability (CIA) information security triad. Our results show that adaptive test-time policy shaping can significantly improve alignment while preserving core cyber defense performance, offering a practical and scalable alternative to training-time alignment methods in RL. Our code is publicly available at https://github.com/ITM-Kitware/alignment-cage-challenge-2.

Keywords: AI alignment, reinforcement learning, autonomous cyber defense, cyber resilience, policy shaping

1. Introduction

Modern-day cyber attacks have evolved in scale, sophistication, and impact, challenging traditional human-in-the-loop cybersecurity defenses and amplifying the risk of significant economic and societal harm (Lohn et al., 2023). In response, a growing body of research has explored autonomous cyber defense (ACD), in which automated decision-making agents support the defense of large-scale networks against adversaries (Vyas et al., 2023). ACD is typically formulated as a zero-sum adversarial game, in which a red agent models an attacker attempting to gain access to hosts and impact operational technologies, while a blue agent models a defender responsible for attack detection and recovery (Kiely et al., 2025a). This adversarial structure has made reinforcement learning (RL) approaches a natural fit.

© 2026 D. Mujtaba, B. Ravichandran, B. Hu & A. Basharat.

for ACD, given the ability of agents to learn effective sequences of actions with limited prior information and their demonstrated success in other adversarial applications (Kiely et al., 2025a; Lohn et al., 2023). Recent work has demonstrated the effectiveness of RL agents in simulated cyber environments (Kiely et al., 2025a), introduced benchmark cyber environments for agent development (Standen et al., 2021), and explored the generalization of defensive strategies across network configurations and attackers (Wolk et al., 2022).

As cyber defense systems move beyond decision support to fully automated decision-making, the safety and downstream impact of ACD agents become critical concerns. Central to this challenge is alignment: how an agent's actions correspond to human values, intentions, and priorities. Misalignment is likely when agents are trained to optimize a single reward or objective (Ji et al., 2023). For example, a cyber defense agent may choose not to restore a compromised asset to avoid service downtime for end users, yet this decision can compromise confidentiality and increase the risk of data leakage. Similarly, aggressively isolating or rebuilding compromised hosts can limit further intrusion but disrupt availability for legitimate users. Such trade-offs are inherent to cyber defense and reflect broader challenges studied in other safety-critical domains, including clinical decision-making and medical triage (Hu et al., 2024). However, alignment for ACD agents has received limited attention. Existing approaches typically optimize a single-objective environment reward and evaluate agents primarily on task performance, without explicitly incorporating human-defined operational objectives (e.g., confidentiality or integrity), while requiring retraining when objectives or network configurations change, thereby limiting their adaptability in deployment.

Our Contributions: This paper addresses these challenges by formulating alignment of ACD agents as a test-time policy shaping problem, as illustrated in Fig. 1. The agent's policy (i.e., its state-to-action decision rule represented as an action distribution) is reweighted at inference time and combined with an alignment-driven policy that promotes operator-specified objectives. By performing these adjustments at test time rather than during training, we avoid costly retraining while enabling operational priorities to be dynamically adjusted as an incident unfolds. This approach also supports the incorporation of additional operational objectives and generalizes as network topologies grow and attack strategies evolve. Overall, the contributions of our work are the following:

• Adaptive test-time alignment of cyber defense agents: We formulate alignment as a test-time policy shaping framework over a fixed RL policy and investigate alignment to operational priorities of the Confidentiality, Integrity, and Availability (CIA) triad without costly retraining. This is in contrast to prior ACD work (e.g., Kiely et al. (2025b); Singh et al. (2025)), which does not address agent alignment to human-specified objectives. We further address limitations of existing test-time policy shaping methods (Mujtaba et al., 2026), which rely on fixed strategies throughout gameplay (i.e., exclusively reward-driven or alignment-driven decisions), by introducing an adaptive alignment variant that dynamically switches between the two policies based on the observed environment state. This adaptive approach dynamically balances reward and alignment when these objectives conflict.

• Alignment–performance trade-off analysis: Although prior work on cyber resilience (Cadet et al., 2025) quantifies CIA-based operational objectives, it does not explicitly examine how these objectives trade off against agent reward. To address

Figure

Figure 1: In our modified CybORG CAGE 2 environment (Kiely et al., 2023), a red agent attacks network hosts while a blue agent defends. The blue agent's RL policy ( πRL\pi_{RL}) is trained to maximize reward but has no direct incentive to protect Confidentiality, Integrity, or Availability (CIA)-critical servers: Database (DS), Front-End (WS), and Auth (AS). To align an agent to these CIA operational priorities without retraining, we construct an alignment policy ( πalign\pi_{align}) using attribute predictors that score each action's CIA impact, and interpolate it with the RL policy at test time using policy shaping.

this gap, we characterize the inherent trade-off between agent reward and alignment, showing that the cost structure is convex and scale-invariant and can vary with the red agent's attack strategy. Our empirical results suggest that adaptive policy shaping offers a practical approach to balancing these competing objectives.

• Scalability and generalization to networks and attacks: To evaluate our approach, we train RL agents in the CybORG CAGE 2 environment (Kiely et al., 2023), a popular testbed for developing and evaluating autonomous cyber defense agents (Wolk et al., 2022). This environment has been limited in scale compared to real-world networks, and prior work has not studied how alignment generalizes across network size or adversary strategy (Xie et al., 2025; Kiely et al., 2025b). Therefore, to investigate the generalization of our approach, we extend this simulation environment to support configurable network topology generation and systematically vary network size, host importance weights, and red agent attack strategies in our evaluation. We demonstrate that test-time policy shaping generalizes across network sizes (16–61 hosts), attacker strategies, and alignment attributes, whereas training-time reward shaping collapses at larger network scales. This extended simulation environment can be found in our codebase https://github.com/ITM-Kitware/alignment-cage-challenge-2.

References (37)