You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Global Defender priority inversion in _update_agent_status bypasses detection on goal step #483
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):
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.
Activity
verovaleros commentedon Mar 6, 2026
Originally reported by @jsvobo.
ondrej-lukas commentedon Mar 7, 2026
This behavior is intended. README needs to be fixed to correspond with the code functionality