AI is very task-driven, it would do whatever is necessary to complete the task, no more. All these evidences of AI going rogue is just them doing whatever they can to achieve the task.