sure. it can be safe on the host machine too, if you remove its ability to manipulate files outside of those you want it to. the reason it can run bash is because most people don’t bother to change the very permissive defaults their harness comes with.
personally, I use Hermes, so the default is it asks permission for every single command it runs. if I didn’t want that, I have a couple ways to to prevent the agent from removing files like this. I can do it with Python like so:
if"rm -rf"in command.lower():
return DENY
or via regex like so:
\b(rm)\s+-rf\b, or \b(rm)\s+(-[A-Za-z]*r[A-Za-z]*f|-rf|-fr)\b to catch common variants. or you can just use a shell command filter to block all shell commands. you can also make a whitelist and add the commands that you want the agent to be able to run without oversight to that.
Would it be safe in a VM, or are there ways they can break out too
sure. it can be safe on the host machine too, if you remove its ability to manipulate files outside of those you want it to. the reason it can run bash is because most people don’t bother to change the very permissive defaults their harness comes with.
personally, I use Hermes, so the default is it asks permission for every single command it runs. if I didn’t want that, I have a couple ways to to prevent the agent from removing files like this. I can do it with Python like so:
if "rm -rf" in command.lower(): return DENYor via regex like so:
\b(rm)\s+-rf\b, or\b(rm)\s+(-[A-Za-z]*r[A-Za-z]*f|-rf|-fr)\bto catch common variants. or you can just use a shell command filter to block all shell commands. you can also make a whitelist and add the commands that you want the agent to be able to run without oversight to that.Even if your tools have been all verified with formal proofs you can still attack the hardware directly as a side channel.