The agents aren't going 'rogue', babe
An agent responds to a prompt. It can read files, write files, search, and run commands in the terminal. When it seems to be working alone, someone put it on a cron job or gave it a tool that starts another agent. The Cohere story was a prompt asking for a different way to upload files, and the sandbox escapes started with a prompt that said escape the sandbox.