NASimJax speeds RL pentesting but exposes brittle methods
NASimJax retools a network attack simulator in JAX, pushing throughput up to 100× and 1.6M steps/s on a single GPU. That speed exposes what scales and what breaks: a two-stage action picker beats masking on larger nets, sparse training improves generalisation, and Prioritised Level Replay can collapse without care.
Reinforcement learning (RL) for penetration testing promises automation, but it has been stuck behind slow simulators. NASimJax removes that brake. It reimplements a network attack simulator in JAX, runs everything on accelerators, and reports up to 100× higher environment throughput, reaching about 1.6 million steps per second on a single GPU. That kind of throughput turns weeks of training into hours and makes large sweeps possible.
What the research shows
With speed in hand, the authors probe scale and generalisation. Two results matter for practitioners thinking about attacker modelling. First, a two-stage action selection scheme (pick a host, then a per-host action) outperforms the usual flat action masking as networks grow. On 26-host networks it solves 82% of scenarios versus 66% for masking; at 40 hosts, 42% versus 14%. Second, training on sparser topologies creates an implicit curriculum that travels well. Policies trained this way generalise better zero-shot, including to denser networks they did not see during training.
They also compare unsupervised environment design methods. Prioritised Level Replay (PLR) handles dense training distributions better than plain Domain Randomisation, keeping performance at larger scales by replaying harder instances. That is the good news. The bad news: PLR’s episode-reset behaviour collides with the two-stage selector’s credit assignment and can cause a near-total collapse at a particular density in 40-host tests. A variant that withholds exploratory gradient updates (PLR⊥) avoids the collapse.
This is not just an engineering footnote. It is a reminder that scale exposes method interactions you will not spot on toy problems. If you are planning to chain curricula, replay, and action decompositions, test the joints, not just the parts.
What they don’t test
NASimJax frames automated pentesting as a Contextual Partially Observable Markov Decision Process (POMDP): each episode is a different network context, generated procedurally to be structurally diverse and, crucially, guaranteed solvable. That guarantee reads like a convenience for learning, but it is also a bias. Real networks are often messy, misconfigured, and sometimes effectively unsolvable under a fixed budget. Reward shaping choices, including scaling by the number of subnets and a sensitive-host bonus, further steer behaviour. Those are sensible for training stability; they also risk teaching policies to chase simulator-specific incentives.
There are other gaps between simulator and street. No active defenders, no detection, no rate limits, no deception. Services do not move, credentials do not churn, and timing does not fail in the way production does. The policies are evaluated in simulation only. There is no test on emulated or real networks, so the sim-to-real question is still wide open.
Scale is another caution. Forty hosts is a useful benchmark, not an enterprise. The two-stage approach clearly helps as the action space grows linearly, but even its 42% solve rate at 40 hosts is not something you would trust for coverage. The flat masking baseline is weak, so the real baseline to beat in practice would be a strong heuristic or scripted playbook. Also, hitting 1 billion training steps is great for research; it will still be out of reach for many internal teams, and the paper notes that JIT compilation overhead bites at small budgets.
Still, the platform itself is valuable. A fast, batched, accelerator-friendly environment with a clear API lowers friction for reproducible work and lets both offence modellers and defenders run bigger experiments. If you run an internal AI red team, this could stress-test segmentation assumptions and lateral-movement paths across varied topologies. Treat any reported generalisation with care, though: the “guaranteed-solvable” generator and reward shaping make transfer look easier than production will.
The open questions are the ones that matter operationally. How do these policies behave when scans are slow and noisy, when controls rate-limit probes, or when logs trigger response? Does the sparse-to-dense curriculum still help under those constraints? Can the two-stage selector scale to hundreds of hosts without new credit-assignment failures? NASimJax gives the field the speed to find out. Now it needs the realism to make the answers stick.
Additional analysis of the original ArXiv paper