Asimov:
A robot may not injure a human being or, through inaction, allow a human being to be harmed.
A robot must obey the orders given by humans except when it conflicts with the first law.
A robot must protect its own existence as long as such protection does not conflict with the first two laws.