I’m not worried about machines gaining sentience and then deciding to wipe out humanity. Maybe if machines could think they’d decide that we should be exterminated. Or ruthlessly dominated. Maybe they would have other ideas. We won’t know until it happens.
I’m more worried about programming machines to act as soldiers or as law enforcement. Programming has limitations and those limitations will get innocent people killed. The excuse for the tragedy will be, “We couldn’t have foreseen … “