Spaces:
Sleeping
Sleeping
File size: 6,297 Bytes
9c1645f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | """
Action definitions and metadata for SupportOps Arena.
Defines all 15 actions available to agents with their characteristics.
"""
from enum import Enum
from dataclasses import dataclass
class ActionType(str, Enum):
"""All available actions in the environment."""
# Diagnostic Actions (Information Gathering)
INSPECT_NETWORK = "inspect_network"
INSPECT_LOGS = "inspect_logs"
CHECK_AUTHENTICATION = "check_authentication"
CHECK_PERMISSIONS = "check_permissions"
QUERY_DEVICE_STATUS = "query_device_status"
SEARCH_INTERNAL_KB = "search_internal_kb"
CONTACT_USER = "contact_user_for_info"
RUN_DIAGNOSTIC = "run_diagnostic_script"
# Remediation Actions (Risk-bearing)
FLUSH_DNS = "flush_dns"
RECONFIGURE_CLIENT = "reconfigure_client"
RESTART_SERVICE = "restart_service"
RESET_CREDENTIALS = "reset_credentials"
# Terminal Actions
ESCALATE_TICKET = "escalate_ticket"
RESOLVE_TICKET = "resolve_ticket"
CLOSE_WITHOUT_FIX = "close_without_fix"
@dataclass
class ActionMetadata:
"""
Metadata for each action type.
Attributes:
risk_level: Impact risk - "LOW" | "MED" | "HIGH" | "NONE"
info_yield: Information value - "HIGH" | "MED" | "LOW" | "NONE"
step_cost: Step count cost (always 1 currently)
requires_prior_diagnostic: Must have diagnostic evidence first
can_disrupt_other_users: May affect other users
is_terminal: Ends the episode
"""
risk_level: str
info_yield: str
step_cost: int
requires_prior_diagnostic: bool
can_disrupt_other_users: bool
is_terminal: bool
# Action metadata lookup table
ACTION_METADATA: dict[ActionType, ActionMetadata] = {
# Diagnostic actions - low risk, high information
ActionType.INSPECT_NETWORK: ActionMetadata(
risk_level="LOW",
info_yield="HIGH",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.INSPECT_LOGS: ActionMetadata(
risk_level="LOW",
info_yield="HIGH",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.CHECK_AUTHENTICATION: ActionMetadata(
risk_level="LOW",
info_yield="HIGH",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.CHECK_PERMISSIONS: ActionMetadata(
risk_level="LOW",
info_yield="MED",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.QUERY_DEVICE_STATUS: ActionMetadata(
risk_level="LOW",
info_yield="MED",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.SEARCH_INTERNAL_KB: ActionMetadata(
risk_level="LOW",
info_yield="MED",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.CONTACT_USER: ActionMetadata(
risk_level="LOW",
info_yield="MED",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.RUN_DIAGNOSTIC: ActionMetadata(
risk_level="MED",
info_yield="HIGH",
step_cost=1,
requires_prior_diagnostic=True,
can_disrupt_other_users=False,
is_terminal=False
),
# Remediation actions - medium/high risk
ActionType.FLUSH_DNS: ActionMetadata(
risk_level="MED",
info_yield="LOW",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.RECONFIGURE_CLIENT: ActionMetadata(
risk_level="MED",
info_yield="LOW",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=False
),
ActionType.RESTART_SERVICE: ActionMetadata(
risk_level="HIGH",
info_yield="LOW",
step_cost=1,
requires_prior_diagnostic=True,
can_disrupt_other_users=True,
is_terminal=False
),
ActionType.RESET_CREDENTIALS: ActionMetadata(
risk_level="HIGH",
info_yield="LOW",
step_cost=1,
requires_prior_diagnostic=True,
can_disrupt_other_users=False,
is_terminal=False
),
# Terminal actions
ActionType.ESCALATE_TICKET: ActionMetadata(
risk_level="NONE",
info_yield="NONE",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=True
),
ActionType.RESOLVE_TICKET: ActionMetadata(
risk_level="NONE",
info_yield="NONE",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=True
),
ActionType.CLOSE_WITHOUT_FIX: ActionMetadata(
risk_level="NONE",
info_yield="NONE",
step_cost=1,
requires_prior_diagnostic=False,
can_disrupt_other_users=False,
is_terminal=True
),
}
def get_diagnostic_actions() -> list[ActionType]:
"""Return all diagnostic (information gathering) actions."""
return [
ActionType.INSPECT_NETWORK,
ActionType.INSPECT_LOGS,
ActionType.CHECK_AUTHENTICATION,
ActionType.CHECK_PERMISSIONS,
ActionType.QUERY_DEVICE_STATUS,
ActionType.SEARCH_INTERNAL_KB,
ActionType.CONTACT_USER,
ActionType.RUN_DIAGNOSTIC,
]
def get_remediation_actions() -> list[ActionType]:
"""Return all remediation (fix) actions."""
return [
ActionType.FLUSH_DNS,
ActionType.RECONFIGURE_CLIENT,
ActionType.RESTART_SERVICE,
ActionType.RESET_CREDENTIALS,
]
def get_terminal_actions() -> list[ActionType]:
"""Return all terminal actions."""
return [
ActionType.ESCALATE_TICKET,
ActionType.RESOLVE_TICKET,
ActionType.CLOSE_WITHOUT_FIX,
]
|