Drei Robotergesetze

A robot may not injure a human being, or, through inaction, allow a human being to come to harm
A robot must obey the orders given it by human beings except where such orders would conflict with the First Law
A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws

Asimov, Isaac (1950 / 1977). I, Robot. New York: Bantam Books.

Powell sighed. “Well, it can’t be helped now – but we’re in a fine fix.” He had dismounted from his robot, and was sitting, back against the cliff. Donovan joined him and they linked arms: In the distance the burning sunlight seemed to wait cat-and-mouse for them, and just next them, the two giant robots were invisible but for the dull red of their photoelectric eyes that stared down at them, unblinking, unwavering and unconcerned. Unconcerned! As was all this poisonous Mercury, as large in jinx as it was small in size.
Powell’s radio voice was tense in Donovan’s ear:
“Now, look, let’s start with the three fundamental Rules of Robotics – the three rules
that are built most deeply into a robot’s positronic brain.”
In the darkness, his gloved fingers ticked off each point.
“We have: One, a robot may not injure a human being, or, through inaction, allow
a human being to come to harm.”
“Right!”
“Two,” continued Powell, “a robot must obey the orders given it by human beings
except where such orders would conflict with the First Law.”
“Right”
“And three, a robot must protect its own existence as long as such protection
does not conflict with the First or Second Laws.”
“Right! Now where are we?”
“Exactly at the explanation. The conflict between the various rules is ironed
out by the different positronic potentials in the brain. We’ll say that a robot is
walking into danger and knows it. The automatic potential that Rule 3 sets up
turns him back. But suppose you order him to walk into that danger. In that case,
Rule 2 sets up a counterpotential higher than the previous one and the robot
follows orders at the risk of existence.”