MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / is_dangerous

Function is_dangerous

tools/shell_tools.py:11–20  ·  view source on GitHub ↗
(command: str)

Source from the content-addressed store, hash-verified

9]
10
11def is_dangerous(command: str) -> bool:
12 cmd_parts = command.split()
13 if not cmd_parts:
14 return False
15 base_cmd = Path(cmd_parts[0]).name
16 if base_cmd in DANGEROUS_COMMANDS:
17 return True
18 cmd_lower = command.lower()
19 dangerous_patterns = ["sudo ", "> /dev/", "| sh", "| bash", ":(){:|:&};:"]
20 return any(p in cmd_lower for p in dangerous_patterns)
21
22def shell(command: str, yolo: bool = False, timeout: int = 1800) -> str:
23 """

Callers 1

shellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected