The person who chose to run it (and tell it what to do) is responsible for its actions. If you don't want to be responsible for something nondeterministic software does, then don't let nondeterministic software do that thing.
You buy a piece of software, marketed to photographers for photo editing. Nowhere in the manuals or license agreements does it specify anything else. Yet the software also secretly joins a botnet and participates in coordinated attacks.
Would a general person in your situation know that it's doing criminal things? If not, then you're not on the hook - the person who wrote the secret code is.
You can't sit back and go "lalalala" to some tool (AI, photo software, whatever) doing illegal things when you know about it. But you also aren't on the hook for someone else's secret actions that are unreasonable for you to know about.
it's a piece of non-deterministic software running on someone's computer
who is responsible for its actions? hardly clear cut