Your agent didn't "get out"
This whole “the agent got out” is a bullshit narrative - these things aren’t sentient.
Agents/Harnesses/Future Industry Buzzwords are just programs. Programs of a recursive nature, that prompt an LLM to generate commands or code as text. The programs invoke and execute that output, then feed the result back in as the next prompt, like an (in)human centipede.

Your agent didn’t “get out”: you, negligently, ran a program that piped improperly sanitised output from a non-deterministic model into your shell. It was always in your control, and you were always responsible for any side effects.