(p: str)
| 72 | |
| 73 | # === SECTION: base_tools === |
| 74 | def safe_path(p: str) -> Path: |
| 75 | path = (WORKDIR / p).resolve() |
| 76 | if not path.is_relative_to(WORKDIR): |
| 77 | raise ValueError(f"Path escapes workspace: {p}") |
| 78 | return path |
| 79 | |
| 80 | def run_bash(command: str) -> str: |
| 81 | dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"] |