You're anthropomorphising the machine. An AI will do what it's programmed to do, not develop free will and decide on its own destiny.
Correctly programming something that takes into account all of the nuances of the human condition might be impossible, and the results of mistakes are uniformly terrifying, but the result is entirely in the hands of humans (and human mistakes).
Correctly programming something that takes into account all of the nuances of the human condition might be impossible, and the results of mistakes are uniformly terrifying, but the result is entirely in the hands of humans (and human mistakes).