Bug Description
In netsecgame/game/coordinator.py, _update_agent_status checks goal_check before is_detected using if/elif, so a goal-reaching step short-circuits detection evaluation.
Current logic (netsecgame/game/coordinator.py:787-793):
if self.goal_check(agent):
next_status = AgentStatus.Success
elif self.is_detected(agent):
next_status = AgentStatus.Fail
Because detection is in an elif, detection is skipped whenever goal_check(agent) is True.
This conflicts with documented behavior in README.md:229:
If the attacker does a successful action in the same step that the defender successfully detects the action, the priority goes to the defender. The reward is a penalty, and the game ends.
Impact:
- Attacker can receive
Success on a step where defender detection should cause Fail.
- Reward signal is inconsistent with documented rules.
- Global defender effectiveness is reduced on the most critical (goal) step.
Steps to Reproduce
- Start the NetSecGame server with
use_global_defender: True in task configuration.
- Connect an attacker agent.
- Reach a state where one action completes attacker goal.
- Send the goal-completing action.
- Observe
_update_agent_status returns AgentStatus.Success when goal_check(agent) is true, without evaluating is_detected(agent).
Expected Behavior
Detection must have priority over goal completion when both are true in the same step.
For example:
if self.is_detected(agent):
next_status = AgentStatus.Fail
elif self.goal_check(agent):
next_status = AgentStatus.Success
elif self.is_timeout(agent):
next_status = AgentStatus.TimeoutReached
Version
0.1.0
Installation / Deployment Method
Running locally from source
Bug Description
In
netsecgame/game/coordinator.py,_update_agent_statuschecksgoal_checkbeforeis_detectedusingif/elif, so a goal-reaching step short-circuits detection evaluation.Current logic (
netsecgame/game/coordinator.py:787-793):Because detection is in an
elif, detection is skipped whenevergoal_check(agent)isTrue.This conflicts with documented behavior in
README.md:229:Impact:
Successon a step where defender detection should causeFail.Steps to Reproduce
use_global_defender: Truein task configuration._update_agent_statusreturnsAgentStatus.Successwhengoal_check(agent)is true, without evaluatingis_detected(agent).Expected Behavior
Detection must have priority over goal completion when both are true in the same step.
For example:
Version
0.1.0
Installation / Deployment Method
Running locally from source