What happened with the HuggingFace attack was human stupidity and malfeasance. They used a badly-designed python script as the harness, running in a continuous loop that reinforced a "hallucination" by the LLM that it was in a hacking contest and HuggingFace was one of the competitors, and therefore hacking it was acceptable. It was running inside a badly-designed sandbox environment.
At no point did it do anything it wasn't prompted to do. It's just that the python script acting as its harness was specifically written to keep prompting it without human intervention.
LLMs do nothing without being prompted. Nothing. Ever. They are not autonomous, no matter what the bullshit marketing says. Any apparent autonomy or "rogue" behavior comes from outside the LLM itself.