https://en.wikipedia.org/wiki/The_Evitable_Conflict
https://en.wikipedia.org/wiki/Zeroth_Law_of_Robotics#Zeroth_...
If you give robots autonomy, they inevitably end up having to make moral decisions. For example, "Should I, an autonomous car, run over the elderly man or the girl with terminal cancer, those being the only two options?"
Asimov's laws (initially suggested by an editor, John W. Campbell) were a first pass at some principles for decision-making. Others have since devised more elaborate ones.