• Luminous5481 "Enemy of the State"@anarchist.nexus
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    12 days 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.