Skip to content

ActionSpace

Bases: CybORGLogger

Action Space of the agent

Attributes:

Name Type Description
actions Dict[Action, bool]

mapping of agent actions to their validity in the environment

action_params Dict[Action, _]

mapping of actions to params

allowed_subnets List[str]

list of allowed subnets for that action

subnet Dict[IPv4Network, bool]

mapping of subnet networks to the validity of their use in the action

ip_address Dict[IPv4Address, bool]

mapping of IP addresses to the validity of their use in the action

server_session dict
client_session Dict[int, bool]

mapping of client session number to validity

username Dict[str, bool]

mapping of username and validity

password dict
process Dict[int, bool]

mapping of process number to validity

port dict
hostname Dict[str, bool]

mapping of hostname to validity

agent Dict[str, bool]

mapping of agent name to validity

Functions

__init__

__init__(actions, agent, allowed_subnets)

Loads the inital information the agent knows about.

Parameters:

Name Type Description Default
actions List[Action]

list of actions that the agent can take

required
agent str

agent name

required
allowed_subnets dict

subnets the agent is allowed to access

required

get_action_space

get_action_space()

Gets all class attributes.

Returns:

Name Type Description
max_action Dict[str, dict]

a dictionary of class attributes names and values

get_max_action_space

get_max_action_space()

Gets all the max integer values for class attributes.

Returns:

Name Type Description
max_action Dict[str, int]

a dictionary of class attributes and maximum integers

reset

reset(agent)

Resets all class attributes to state after __init__.

Parameters:

Name Type Description Default
agent str

agent name

required

update

update(observation: dict, known: bool = True)

Updates the ActionSpace class attributes depending on the observation parameter and whether the attribute info is known.

Parameters:

Name Type Description Default
observation dict

the current observation to update the action space with.

required
known bool
True