From 38b9bbf13ee684c3439a314f436d53070093f750 Mon Sep 17 00:00:00 2001 From: Sebastian K <30296124+DocDriven@users.noreply.github.com> Date: Wed, 28 Jan 2026 01:57:16 +0100 Subject: [PATCH 1/2] Fix env.get_action_mask function --- nasim/envs/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nasim/envs/environment.py b/nasim/envs/environment.py index dcd74be4..65d4481d 100755 --- a/nasim/envs/environment.py +++ b/nasim/envs/environment.py @@ -424,7 +424,7 @@ def get_action_mask(self): mask = np.zeros(self.action_space.n, dtype=np.int64) for a_idx in range(self.action_space.n): action = self.action_space.get_action(a_idx) - if self.network.host_discovered(action.target): + if self.current_state.host_discovered(action.target): mask[a_idx] = 1 return mask From 278b4d80487830adf0110dcafade31852c207820 Mon Sep 17 00:00:00 2001 From: Sebastian K <30296124+DocDriven@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:43:01 +0100 Subject: [PATCH 2/2] Fix exploit probability upper limit in loader.py --- nasim/scenarios/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nasim/scenarios/loader.py b/nasim/scenarios/loader.py index 16b5c3ae..05f4c9a9 100755 --- a/nasim/scenarios/loader.py +++ b/nasim/scenarios/loader.py @@ -310,7 +310,7 @@ def _validate_single_exploit(self, e_name, e): (f"{e_name}. Exploit target OS is invalid. '{e[u.EXPLOIT_OS]}'." " Should be None or one of the OS in the os list.") - assert 0 <= e[u.EXPLOIT_PROB] < 1, \ + assert 0 <= e[u.EXPLOIT_PROB] <= 1.0, \ (f"{e_name}. Exploit probability, '{e[u.EXPLOIT_PROB]}' not " "a valid probability")