you are viewing a single comment's thread
view the rest of the comments
[–] 5 points 3 months ago (2 children)

Would it be safe in a VM, or are there ways they can break out too

  • source
  • hideshow 2 child comments
  • [–] 5 points 3 months ago* (last edited 3 months ago)

    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.

  • source
  • parent