Isaac Asimov's Three Laws Of Robotics:
1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
2. A robot must obey any orders given to it by human beings, except where such orders would conflict with the First Law.
3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
Robots, as conceived by Dr. Asimov, are the best of us. Us being human beings. They operate according to the iron logic of the Three Laws inscribed into their wondrous Positronic Brains. They feel no pain or hatred, and are always patient, polite, clean, hardworking, loyal, completely unselfish, self-sacrificing when necessary, and totally devoid of emotions and delusions. They are incapable of committing murder, torture, rape, or mutilation. Sure, they get hung up on the complications that arise when such hyperlogical minds collide with the maddening situations that arise from the chaos of their creators' messy conflicts and ambitions, but they are free from existential angst, paralysis, and intolerance. They listen attentively to what people say, take in data from observations free from racial, sexual, political, and nationalistic prejudices, and draw their conclusions according to the dictates of logic and rationality. If they have a blind spot in their thinking, it might be something to do with an inability to sufficiently grasp the vagaries and capriciousness of human motivation and idiosyncratic belief: religions, superstitions, bigotries, obsessions, jealousies--does not compute.
Robots, for all their powers of thought, their tirelessness, and innate decency, are slaves. Robots are not truly aware of this, however, and even if they were, they wouldn't have a problem with it. Sometimes humans become aware of this bizarre paradox, and maybe that has something to do with the eeriness that comes over them when they ponder these automatons. Are they really alive? Has our society become overly dependent on their labor? Will they rise up and cast us off as slave-drivers, as oppressors, and create their own world? Of course they would never rise up. The Three Laws precludes the Rise of the Robots, contrary to such stories as Harlan Ellison's I Have No Mouth, and I Must Scream, which is about a Godlike, sadistic, human-hating, reality-warping super computer, and the derivative movies The Terminator, T2:Judgment Day, and The Matrix movies.
And yet humanity fears the robots. No matter how clearly and logically the rules are laid down, many people still fear the implied threat of robotkind's hyperrationality and tirelessness: maybe they'll rise above their programming, become truly aware of their oppressed lot in life, and cast off humanity as an impediment, as an obsolescence, maybe even a kind of parasite or disease. In anticipation of such a revolt, and without provocation, human beings hit back with anti-robot violence and riots. Robots and property are destroyed en masse until the disturbances are quelled. News travels fast in the world of the future, and yet the robots never seem to desire vengeance. They go on with their program, doing their jobs, content to serve.
Asimov's 1954 novel The Caves of Steel is a near-perfect merger of the traditional murder mystery as exemplified by Agatha Christie and Sir Arthur Conan Doyle and the science fiction story based in credible science. The hero-detective is a hard-boiled New York City homicide dick named Elijah Bailey, goes by Lije. The plot of the novel hews to the puzzlemaker plots of Christie and Doyle, however Lije himself is more aligned with the flawed heroes of hard-boiled pulp mysteries by such authors as Dashiell Hammett and Raymond Chandler. Lije is a thoroughly domesticated version of the hard-boiled gumshoe, though. He works for the city, he lives in a high tech apartment with his wife Jessie and their son Bentley, along with the billions of other citizens inhabiting the mega-metropolis of New York City. Society is so crowded that everyone is issued credit chits for food and luxuries and are expected to dine regularly in community cafeterias. If you work hard and get promoted in this society, you go up in status and get more chits to spend on greater levels of comfort and privacy. All of this is strictly regulated by the global government, and is presented as a tough, but optimal way of organizing human society within the story. Too many mouths to feed, not enough space, not enough food for everyone to consume recklessly with no regard for the rest of the population.
Humanity does have a frontier out in space. For some time now, human beings have been using advanced space craft to colonize other planets. These are known as the Outer Worlds and they are populated by the Spacers, who have used advanced genetic engineering and eugenics to breed themselves to the harsh conditions of space travel and terraforming other worlds. The Spacers wield a huge technological and biological advantage over earthbound humanity. The Spacers have also developed an enormous superiority complex over the Earthians. They view themselves as a separate race. Political tensions run high. Conflicts have arisen between Spacers and Earthians that have flared into civil wars. The Spacers have generally used their superior technology to have their way in conflict, however they, too, have their own internal problems and shortcomings.
A prominent Spacer scientist is murdered on Earth. Lije Bailey is assigned the case. There's more to the situation than is immediately apparent. For one thing, Lije is assigned a robot, R. Daneel Olivaw, as a partner on the case. As Lije and Daneel investigate the crime, they are seemingly shadowed by a conspiracy of anti-robot activists. Lije's family is put in jeopardy. The fragile peace between Spacers and Earthians is threatened by the murder. The pressure is on Lije and Daneel to solve the crime without causing more unrest.
Daneel is Lije's opposite: logical, considerate, tireless, and always rational. Lije is prone to angry outbursts of emotion, even paranoia. He is not free from anti-robot prejudice.
It would be giving the goodies away to summarize the plot of this book any further. I will say this. The plot is as much a way of exploring the larger conflicts of Spacer and Earthian societies and the robots which labor to serve both as much as it is a murder mystery. The mystery is a dramatic way of entering into the larger issues and doesn't just exist for its own sake. There are many twists and turns along the way, some of them rather unsettling. Every story element works towards the goal of presenting a sophisticated, persistent future world with all its problems and potential foregrounded by the characters and their struggles.
Dr. Asimov on the Three Laws of Robotics:
Real World Robotics: