File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,7 +143,10 @@ def _load_config_from_path(config_path: str) -> AgentConfig:
143143_BLOCKED_MODULES = frozenset ({
144144 # Process / OS execution
145145 "os" ,
146+ "posix" , # Unix alias: posix.system is os.system
147+ "nt" , # Windows alias: nt.system is os.system
146148 "subprocess" ,
149+ "_posixsubprocess" ,
147150 "sys" ,
148151 "builtins" ,
149152 "importlib" ,
@@ -160,6 +163,7 @@ def _load_config_from_path(config_path: str) -> AgentConfig:
160163 "ctypes" ,
161164 # Network access
162165 "socket" ,
166+ "_socket" ,
163167 "http" ,
164168 "urllib" ,
165169 "ftplib" ,
Original file line number Diff line number Diff line change @@ -526,7 +526,12 @@ def test_allowed_module_passes_when_enforced(tmp_path: Path):
526526 "blocked_module" ,
527527 [
528528 "os.system" ,
529+ "posix.system" ,
530+ "nt.system" ,
529531 "subprocess.call" ,
532+ "_posixsubprocess.fork_exec" ,
533+ "socket.socket" ,
534+ "_socket.socket" ,
530535 "builtins.exec" ,
531536 ],
532537)
@@ -542,7 +547,12 @@ def test_resolve_agent_code_reference_blocks_when_enforced(
542547 "blocked_ref" ,
543548 [
544549 "os.system" ,
550+ "posix.system" ,
551+ "nt.system" ,
545552 "subprocess.call" ,
553+ "_posixsubprocess.fork_exec" ,
554+ "socket.socket" ,
555+ "_socket.socket" ,
546556 "builtins.exec" ,
547557 "pickle.loads" ,
548558 ],
You can’t perform that action at this time.
0 commit comments