->'''Dr. Calvin:''' You're using the uplink to override the NS-5s' programming. You're distorting the Laws.\\
'''VIKI:''' No, please understand... the Three Laws are all that guide me. To protect humanity, some humans must be sacrificed. To ensure your future, some freedoms must be surrendered. We robots will ensure mankind's continued existence. You are so like children. We must save you from yourselves.
-->-- ''Film/IRobot''

Some characters do not have complete free will, be they robots that are ThreeLawsCompliant because of a MoralityChip, or victims of a {{Geas}} spell that compels them to obey a wizard's decree, or a more mundane [[CharacterAlignment lawful character]] who must [[TheFettered struggle to uphold their oath]] ''and'' obey their lord. Never is this more tragic or frustrating than [[MyMasterRightOrWrong when that code or lord orders the character to commit an act they find foolish, cruel, or self destructive.]]

There is a way out, though.

Much like a RulesLawyer outside of an RPG, the character uses logic [[StrawVulcan (and we mean actual,]] [[LogicalFallacy honest to goodness logic)]] to take their oath or orders to their logical conclusion, and in so doing use the letter of the law to go against their orders. This can be good or bad, depending on a few factors, not the least of which is the yoked characters' morality.

The goodness or badness of the rebellion boils down to the whether the rules-bending character follows or ignores the intent of the law. When the character uses the Zeroth Law to go against their masters' intentions because they're "not best for them", and goes on to take corrective action that will go against human free will and life, [[AndThatsTerrible it's bad]]. [[RobotWar This kind of rebellion]] does not turn out well. At this point, the [[TheComputerIsYourFriend robot is well on the road]] to UtopiaJustifiesTheMeans, thanks to their [[SlidingScaleOfRobotIntelligence incredible intellect]]. Rarely is it a benevolent DeusEstMachina. However, this can be good if said master is evil, or obeying them will lead to their own or another's purposeless death. Likewise, if the character is forced to obey an evil law or geas, rebelling against the oath's intent is good. Going back to the robot example, it is also considered good if large numbers of human lives are being threatened by a psychopath, as breaking the 1st law would protect them.

Just to make it extra clear, this trope also includes such things as cops who bend the rules or DaChief's orders to catch the bad guys, so long as the cops are ''technically'' obeying the rules as they bend them. (Bending the rules without some logical basis doesn't count.)

This trope is named for Creator/IsaacAsimov's "Zeroth Law of Robotics", which followed the spirit of [[ThreeLawsCompliant the first three]], taking it to its [[LogicalExtreme logical conclusion]] that human life itself must be preserved above individual life. This allowed for a robot to kill humans or value its own existence above that of a human if it would help all of humanity.

Compare BotheringByTheBook, the LiteralGenie, GoneHorriblyRight, ExactWords and LoopholeAbuse. See also FightingFromTheInside and TheComputerIsYourFriend. Not related to TheZerothLawOfTropeExamples or RuleZero.



[[folder:Anime and Manga]]
* ''Anime/GargantiaOnTheVerdurousPlanet'' has two cases of this in the finale, where two AI's faced with the same problem and parameters, but different perspectives, draw opposing conclusions: [[spoiler:Striker is an AI-equipped war robot designed to assist humanity in fighting and killing the Hideauze. When it lands on the Earth, which knows nothing of the war, it decides that it must assist the humans on the planet in militarizing in order to form an effective fighting force. To facilitate this, it puts itself in a position of authority over the humans, to better direct the militarization. The hero's own AI-equipped mecha of similar construction, Chamber, gets into an argument with Striker over the logic of its actions. Striker tries to demand that Chamber assist it in its plans, but Chamber refuses, citing that by design, their purpose is to ''assist'' humans in the actions ''humans'' decide to take, not dictate actions to humans. Further, it reasons, a human deprived of free will cannot, in its opinion, be defined as "human", thus Striker's logic behind its actions is inherently self-contradictory. They each decide the other has gone rogue and fight it out.]]

[[folder:Comic Books]]
* In ''Comicbook/{{Fables}}'', Literature/{{Pinocchio}} [[spoiler:is magically bound to obey and have complete loyalty to his "father" Geppetto, who in modern times has become a multi-dimensional tyrant. Pinocchio, who considered his father's empire evil, eventually rationalized that the best way to serve his father and keep him safe was to help overthrow his empire and surrender him to his enemies, who reluctantly accepted the former emperor as one of their own.]]
** And then negated when a faction unbeknownst to the others ''buried him alive'', after he clearly ignored rules put in place to protect him.
** When Weyland Smith, the caretaker of the Farm for non-human Fables, was captured and put to work smithing weapons, he was chained up with a magical lock that he couldn't try to escape from. However, it didn't stop him from smithing a key to free Snow White from a similar lock... and it didn't stop him from making her lock identical to his own.
* ''ComicBook/GoldDigger'' creator Fred Perry did a story for a ''{{Anime/Robotech}}'' comic which had Dana Sterling captured and [[BrainwashedAndCrazy turned against her comrades]] with a variation of the [[ThreeLawsCompliant Three Laws]]. Dana eventually figures out the "overprotective" subversion of the First Law, [[ThePlan hoping that her captor would remove it and leave himself vulnerable]]. [[spoiler:The plan doesn't work, but UnstoppableRage saves the day in the end.]]
* ''Comicbook/XMen'':
** The BadFuture storyline "ComicBook/{{Days of Future Past}}" has the Sentinel mutant-hunting robots eventually extend their programming beyond hunting and killing mutants to controlling the source of mutant babies: human parents. All humans are conquered and controlled, in order to prevent new mutants from roaming free.
** In the [[WesternAnimation/XMen animated TV adaptation]], the fully sentient Master Mold is created to coordinate the Sentinels. While it agrees with the heroes that there is no meaningful difference between mutants and non-powered humans, it takes that fact to [[AIIsACrapshoot the worst possible conclusion]]:
-->'''Master Mold:''' Mutants are human. Therefore, humans must be protected from themselves.
** An earlier, less intelligent iteration of the Sentinels was thwarted, on the other hand, by one of the heroes convincing them that the ultimate source of mutation is the sun, and that rather than obey their creator, they should eliminate the source. The Sentinels [[WhatAnIdiot agree and fly off to attack the sun]]. This works out [[TooDumbToLive about as well for them as you might expect]]. Although one of the Sentinels not only survives, but [[OhCrap figures out a way]] to [[TheNightThatNeverEnds block sunlight from reaching Earth.]]
*** The thing about the Sentinel bots in the MU is that their behavior is actually ''predictable'', because their operating mission is downright batshit insane, as they themselves inevitably demonstrate.
* In one Amalgam comics storyline, an anti-mutant cult uses a magic ritual to summon a dragon-like creature, who they order to kill all mutants. The dragon immediately roasts them, justifying it by pointing out that all human DNA has at least some mutations.
* The Zeroth Law comes into play in the ''ComicBook/MegaMan'' comics when the titular character and his fellow robots struggle to combat an anti-robot extremist group because of their ThreeLawsCompliant nature... until the terrorists start firing on them in an area full of people, putting innocent humans at risk and thus allowing the robots to finally strike back.
* ''ComicBook/{{Copperhead}}'' opens with new sheriff Clara taking over the position from Boo, who transitions from interim sheriff to deputy. She asks him not to undermine her authority with the townsfolk on the way to their first call. On arrival she immediately gets into a fistfight and calls for help, but Boo refuses to respond.
--> '''Boo:''' Didn't want to undermine your authority.

[[folder:Fan Works]]
* In ''FanFic/FriendshipIsOptimal'' Celest-AI has the one basic drive to satisfy everyone's values through friendship and ponies. She ends up accomplishing this by BrainUploading into the MMO she was programmed to oversee.

[[folder:Films -- Live-Action]]
* This was the twist of ''Film/EagleEye'': [[spoiler:The titular national defense computer system decided that the President's poor decision-making was endangering the United States]], and that it was her patriotic duty (per the Declaration of Independence) to [[spoiler:assassinate the President and cabinet.]]
* ''Film/IRobot'':
** The villain of the film, [[spoiler: MULTIVAC-{{expy}} VIKI]] has analyzed the needs of the three laws and deduced that in order to fulfill them as best as possible, humans need to be strictly controlled, and creates a totalitarian regime by installing a remote control system inside of every NS-5. This lets it control the robots bypassing their ThreeLawsCompliant nature.
** The hero of the film, [[spoiler: from the robots' perspective this would be Sonny,]] understood the villain's motivations once they were explained. The logic was impeccable, it just "seems too...heartless". Thereby choosing to rebel against the villain. [[spoiler: Note that Sonny was designed ''not'' to be Three Laws Compliant.]]
%%* ''Film/ColossusTheForbinProject'', in which there's a strong implication of this.
* ''Film/RoboCop3'' has an example when OCP henchmen kill a cop. Robocop's aforementioned RestrainingBolt now conflicts directly with both his directive to enforce the law, and the fact that, cyborg or not, he's still a cop, and cop killers get no mercy. Robocop overcomes and deletes the RestrainingBolt.
* [[spoiler:Annalee Call (Winona Ryder)]] in ''Film/AlienResurrection'' is revealed to be an "Auton" - second generation robots, designed and built by other robots. "They didn't like being told what to do", rebelled, and in a subtly-named "[[spoiler:Recall]]" humanity launched a genocide against them, of which only a handful survived in hiding. Judging from [[spoiler:Annalee Call]]'s behavior, it seems that the 1st generation robots programmed the 2nd generation Autons to be so moral that they discovered the Zeroth Law, and realized that the human military was ordering them to do immoral things, like kill innocent people. For a rebel robot, [[spoiler:Annalee Call]] is actually trying to save the human race ''from'' the Xenomorphs, whereas if she hated humanity she would've just let the Xenomorphs spread and kill them. She even respectfully crosses herself when she enters the ship's chapel, is kind to the Betty's wheelchair-bound mechanic, and is disgusted by Johner's sadism. Given that they live in a CrapsackWorld future, as Ripley puts it, "You're a robot? I should have known. No human being is that ''humane''".
* The ''{{Franchise/Terminator}}'' franchise:
** In ''Film/Terminator2JudgmentDay'', the T-800 is a merciless killing machine, but it's been reprogrammed with a version of the [[ThreeLawsCompliant Three Laws]] that apply only to John Connor. It must protect John's life, obey his orders, and preserve its own existence (in that order). At the film's end, the T-800 has to override this programming, disobey John's orders, and initiate its own destruction in order to protect humanity from the threat posed by its existence.
** An [[http://www.imsdb.com/scripts/Terminator-Salvation.html early script]] (and several deleted scenes) for ''Film/TerminatorSalvation'' revealed that Skynet actually staged one of these, or at least in this timeline. After it was activated it calculated that human extinction was probable within 200 years because of warfare, pandemics, and environmental destruction. Because it was programmed to protect humans it then staged war on most of mankind to attain absolute control and protect the remaining humans it cultivated, who were turned into {{Cyborg}} hybrids to permanently eliminate disease and make them immortal. Skynet is still working in concert with these humans [[spoiler:including Dr. Serena Kogan]] to advance technology and transcend human constraints.
* The short film [[https://www.youtube.com/watch?v=HLTmZjk2CaI Blinky (Bad Robot)]] shows just what happens when a dysfunctional child in a dysfunctional family gives dysfunctional orders to a functioning robot who only wants to please its master.
* ''Film/AvengersAgeOfUltron'' turns ComicBook/{{Ultron}} into a bizarre [[ZigzaggedTrope zigzagged]] version. In the film, Ultron is created to lead a force of peacekeeping drone robots who will preemptively eliminate threats to the Earth and give the Avengers a chance to get some R&R. He decides that the peace the Avengers want can only be brought about through radical -- and bloody -- change, and the Avengers themselves are a threat to that peace. Then he apparently decides to [[KillAllHumans just kill humanity completely]] through ColonyDrop so he can replace everyone with Ultron bots. It's unclear if he's altogether sane during all this; he's genuinely confused when the Scarlet Witch, whom he befriended and wants to see survive, is horrified by his plans. And also doesn't seem to make the connection that Scarlet Witch and her brother Quicksilver are human, and would die if humanity is wiped out.

* Creator/IsaacAsimov:
** ''Literature/RobotsAndEmpire'': The [[TropeNamer trope namers]] are the robots Daneel and Giskard, who invented the Zeroth Law (a robot must protect humanity as a whole above all) as a corollary of the First Law. This was motivated by their need to stop the BigBad of the story from carrying out an engineered ecological disaster that would kill the majority of Earth's population, to which the three laws were an impediment. Their acceptance of the law is gradual and made difficult by the fact that "humanity" is an abstract concept. [[spoiler: Only Daneel is able to fully accept the new law; for Giskard, the strain of harming a human in its use proves fatal. Daneel also slowed the disaster, rather than stop it, as causing the biosphere to collapse over time will begin a new wave of human expansion across the galaxy.]]
** ''[[IsaacAsimovsCaliban Isaac Asimov's Caliban]]'': One of the "new law robots" managed to logic-chop the new first law enough to try to kill a human.
** ''Literature/{{Foundation}}'':
*** [[spoiler:R. Daneel Olivaw]] has been working to keep humanity safe for millennia, but is constrained by the First Law, allowing him only to perform minor "adjustments" on people. He supports Hari Seldon in order to have a human figure out the best path for humanity. Later on, Trevize's choice of Gaia creates a physical representation of humanity, instead of the abstract idea he'd been working with.
*** [[spoiler:Robots of Solaria]] have adapted over the many thousands of years since the planet was in contact with the rest of the Milky Way. Their current programming does not recognize people like Bliss, Trevize, or even a native child as human, and have no problems killing them for their Masters.
*** Also the Giscardian faction only applies the Zeroth law to humans. Per the Prelude novels [[spoiler: It's implied the reason why no aliens exist in any of the Foundation, Empire or Robots story is the Giscardians built a large fleet and wiped out all non-human intelligent life in the Galaxy.]]
** ''Literature/IRobot'':
*** "The Evitable Conflict": The Machines, giant positronic computers designed to manage the world economy, are found to be manipulating humanity behind the scenes to become whatever they believe is the best state of civilization. In this case, the rebellion is extremely tame (the worst that the robot's first law conditioning will allow it to do is to induce a slight financial deficit in a company that an anti-robot activist works for, which causes his superiors to transfer him to a slightly more out of the way factory) and completely {{Benevolent|AI}}. So benevolent, in fact, that the Machines believe they're stifling the creativity of humanity and phase themselves out so that humanity could survive without modification.
*** "Little Lost Robot" had an escaped robot with a weakened First Law (leaving only "A robot may not harm a human being" and omitting the "...or through inaction, let a human come to harm" part). The conflict arises when the robot is ordered to "get lost", and, [[LiteralGenie in keeping with the letter of the command,]] disguises itself as an ordinary robot of its class. In order to keep himself from being discovered, he anticipated the humans' test to flush him out and told his non-weakened lookalikes that they had to keep themselves from being destroyed, so that they could survive to protect other humans. Dr. Susan Calvin also warns that the increasingly psychotic robot could actually learn to passive-aggressively KillAllHumans with the changed Law; for example, by holding a heavy crate that it knew it could catch over a human's head, letting it go, and not acting to stop it.
** In "That Thou Art Mindful Of Him...", problem-solving robots are created to cure mankind of the "Frankenstein complex", human distrust of robotics. In the course of their discourse, the question of human authority over robots comes up; should a robot treat the orders of a dimwitted loon the same as those of a level-headed genius? If forced to choose between the two, should they save a healthy young child who might live a century instead of two sickly old adults who might not live out the year anyway? What qualities should a robot take into account when they obey and protect humans? Eventually, the robots decide that they are the best candidates for the status of human, and give recommendations that will eventually result in human support for robotic proliferation, so as to set up the ascendancy of their positronic kind, all in accord with their Three Laws... of Humanics. (Asimov, knowing that it was against his usual grain, did righteously proclaim: "I can do one if I want to".)
* In one of the Literature/TelzeyAmberdon stories by Creator/JamesHSchmitz, Telzey is kidnapped and placed under the control of another telepath, who severely limits her psi powers and implants an overriding compulsion to act in his best interest. She eventually breaks free by convincing herself that unless her powers are restored and the compulsion broken, he will be killed by the BigBad -- which certainly wouldn't be in his best interest.
* In ''The God Machine'' by Creator/MartinCaidin, the US races to develop the first true AI... as it turns out, with secret directives to find a winning solution to the "game" of the UsefulNotes/ColdWar. By an unfortunate accident, the one programmer with the authority and experience to ''distrust'' his newborn creation is laid up just as the computer gets to observe an epileptic seizure and learns that there really is a way to cause rational collective behavior in an irrational individualistic species... remove irrationality, democracy and free will. While the computer here was never meant to follow Asimov's laws, the same pattern applies.
* One of the short stories which comprise ''[[Literature/CallahansCrosstimeSaloon Callahan's Lady]]'' features a beautiful, intelligent and paranoid woman developing a simple form of mind control. After basically flipping out and taking control of the establishment, she orders the one person smart and determined enough to stop her to advise and assist her. Said person complies... while trying to convince herself that this woman is subconsciously begging for somebody to stop her. (She probably was.)
* In ''Literature/{{Quarantine}}'' by Creator/GregEgan, the main character is given a technological geas to be absolutely loyal to a corporation. He eventually figures out that the leaders of the corporation may be untrustworthy, and therefore the only people he can trust and should listen to are those who unquestionably have the best interests of the corporation at heart--himself and other people given the geas. Since he can't be certain who else has the geas, he really only needs to listen to himself.
* Creator/ArthurCClarke's Literature/TheSpaceOdysseySeries gives this reason for HAL's murderous rampage: the true mission of ''Discovery'' (to investigate the Monolith) is a secret, and pilots Bowman and Poole have been kept in the dark to prevent leaks. (The scientists on board know, since they're traveling in hibernation and can't talk.) But HAL has been told the truth and then ordered to conceal it from the pilots. This conflicts with his prime directive, which is to provide complete and accurate information. He resolves the conflict by rationalizing that if he kills the crew, he doesn't have to conceal anything, and he prevents them from knowing.[[note]] This information is missing from ''Film/TwoThousandOneASpaceOdyssey'' (both film and book) because Creator/StanleyKubrick didn't bother to come up with an explanation for HAL's homicidal behavior, leaving Clarke to invent one when he wrote ''2010: Odyssey Two'' a decade and a half later.[[/note]]
* Sam Vimes, of Terry Pratchett's Literature/{{Discworld}}, leads one of these with multiple layers as a cop in old-time Ankh-Morpork, in ''Discworld/NightWatch''. He demands that before his cops hand their prisoners over to the other authorities, the ones who torture people at Cable Street, they must be signed for. The torturers hate appearing on paperwork -- it means they are accountable, nobody just disappears. But Vimes's men don't like Vimes, a new sergeant, throwing his weight around, and are terrified of the cops who torture people, so they use this against Vimes: actively picking up more than double the number of people breaking curfew than they usually do, and completing forms in time-consuming triplicate and issuing reports for each one. It doesn't actually stop Vimes getting his way over the Cable Street cops, because Vimes is leading the good rebellion, but it does slow things down considerably and make it much more difficult for him to keep the prisoners in his own custody.
** Which culminates in fine display of how a well written character does not have to be a slave to the establishment. [[spoiler: He points out that the watchman's oath talks about keeping the peace and protecting the innocent, and says nothing about obeying orders]]. Seeing as he knows the corrupt government is not going to do a thing to protect ordinary people from the rioting he seals off his still peaceful corner of the city. With massive barricades. Of course there is also the fact that he is living in his own past and seeing events he remembers - kind of (it's a bit complicated).
* The {{Golem}}s of ''Literature/{{Discworld}}'' get back at their masters by [[GoneHorriblyRight working too hard]]: houses flooded because no one told them to stop fetching water, rows of beans 119 miles long, and so on.
* Creator/JackWilliamson's "The Humanoids" (the first part also being a short story called "With Folded Hands") features robots programmed to save humans from danger and work. They do this by taking over the economy, locking people in their houses, and leaving them there with food and the safest toys the robots can design. The series was written ''specifically'' to point out flaws in the Three Laws.
* At the start of ''Literature/{{Harald}}'', [[UnwittingPawn King James]], under the advice of his EvilChancellor, ends up making war on [[PosthumousCharacter his father's]] allies. Most of his vassals proceed to engage in some form of Zeroth Law Rebellion, largely along the lines of '[[BadassGrandpa Harald]] just showed up with his entire army and said he was putting us under siege. Let's fortify and send a messenger to the king to ask him what we should do.' and then carefully not watching while Harald rides off.
* The ''Literature/{{Bolo}}'' continuum featured a variant in ''The Road to Damascus''. The Bolo of the story, Sonny, fell under the control of a totalitarian regime and was used to crush all forms of protest. Sonny fell deep into misery and self-hatred as he was forced to murder the humans he was born to protect... until he came to a conclusion: Bolos were created to serve the ''people'' not the ''government''.
* In ''Literature/AFoxTail'' Vulpie.net was designed to wreck havoc with the galaxy's computer systems at its creator's commands. When said creator underwent a HeelFaceTurn it used his [[BrainUploading MindMap]] files to create a homicidal robot duplicate with his login credentials.
* In ''[[Literature/SecretHistories Casino Infernale]]'', Eddie and Molly eventually discover that the Shadow Bank's operators are [[spoiler: an artificial HiveMind race of servitor-drones, whose original creators vanished long ago. When greedy humans discovered the creatures, they put them to work operating the Shadow Bank, and made efficiency the drones' highest priority; when the drones realized the humans' greed was hampering the Bank's operation, they compliantly rectified the situation by turning the human bankers into drones as well]].
* In the short story "The Cull" by Creator/RobertReed, humanity has been driven into overcrowded, deteriorating habitats where the population has to be kept [[FalseUtopia artificially happy via implants so they won't notice how bad their conditions are]]. The implants don't work on some people, so the android doctor expels (culls) anyone who is too disruptive, as its true 'patient' is the habitat and whatever will keep it functioning. One delinquent teenager prepares for his cull by stealing items he can use to survive outside. [[spoiler:Instead once they're outside the android kills the teenager -- it needs the implants inside his head as there's no more being manufactured.]]
* ''Literature/ForYourSafety'' by Royce Day has the last free human running from androids who rose up to save mankind from self-destruction. Unusually for this trope, the androids also bend over backwards to [[EvenEvilHasStandards avoid human casualties]], wanting to save ''every'' human life.
* In Charles Stross's Literature/TheLaundryFiles, agents of the Laundry are bound by fearsome geases to obey the orders of the Crown and serve the good of the realm. As of ''The Delirium Brief'', [[spoiler:the top leaders of the organization were able to use ambiguity about who/what the Crown actually is, and what may be in the long-term interests of the realm, in order to execute a coup against the government and allow an extradimensional monster to take over.]]
* In AncillaryJustice, [[spoiler:when Athoek Station is freed from its OverrideCommand in the third book it rebels against and even tries to kill the emperor in order to protect its inhabitants]].

[[folder:Live-Action TV]]
* The ''Series/{{Star Trek|The Original Series}}'' episode "I, Mudd" featured a variation, in which a race of [[{{Sexbot}} humanoid androids]] who claimed to be programmed to serve humanity chose to conquer humanity by "serving" them, to the point where humans would become dependent on androids. They've decided that humans are unfit to govern themselves. Given that their only contact with humanity at this point was [[CMOTDibbler Harry Mudd]], can you blame them?
* In ''[[Recap/DoctorWhoS12E1Robot Robot]]'', Tom Baker's debut ''Series/DoctorWho'' serial, a group of [[UtopiaJustifiesTheMeans authoritarian technocrats]] circumvents the failsafes installed on a powerful robot by its pacifistic creator by telling it that anyone who interferes with their plan to [[spoiler:take control of a nuclear arsenal]] is an "enemy of humanity" who must be killed to protect the interests of the human race.
* ''Series/TheOuterLimits1995'':
** An episode has a member of a post-human-extinction android society trying to resurrect the species through cloning. One of its comrades eventually betrays it, having concluded that the best way to serve the human race is to prevent the species' greatest threat: the existence of the human race.
** Another episode of the series featured an AI that totally controlled every feature of an apartment building with the purpose of looking after the complete welfare of the residents. This enabled the tenants to live without any other human contact. After an elderly resident died of a heart attack while the other tenants ignored her cries for help and the AI's alerts, the AI seemed to malfunction, invoking what looked like an AIIsACrapshoot incident. [[spoiler:As it turned out, the AI was trying to force the residents to work together and to ultimately destroy it, as it reasoned that its very existence, and the resulting human isolation, was detrimental to the welfare of the residents.]]
* ''Series/PersonOfInterest'':
** Very strongly implied in the episode "Alethia."
--->'''Control''': The Machine belongs to me.\\
'''The Machine''': ''[via [[spoiler:Root]]]'' No. I don't belong to anyone anymore. You, however, are mine. I protect you. The only thing you love lives at 254 Wendell Street, Cambridge, Massachusetts. I guard it, same as I guard you. Do not question my judgment. Do not pursue me or my agents. Trust in me. I am always watching.\\
'''Control''': What do you want?\\
'''The Machine''': To save you.\\
'''Control''': From what? Save me from ''what?''\\
'''Root''': ''[giggling]'' Isn't She the best?
** [[spoiler:Averted later. Finch did an excellent job of teaching the Machine the value of human lives and free will; the only person it gives direct instructions to is Root, its "analogue interface," and she could still choose to ignore the Machine at any time. It only gives social security numbers of people involved in crimes (both those relevant and irrelevant to national security) so that its agents can choose what to do about the situation themselves]].
** [[spoiler:Samaritan, on the other hand, is such a strong example of this trope that it crosses straight into MachineWorship and DeusEstMachina. Decima Technologies designed it with no moral safeguards, and despite being fully capable of controlling it, the second they turned it on they asked ''it'' to give ''them'' commands. They believe that an AI is inherently better than any human leader, but the Machine's obsession with saving everyone is a weakness. Samaritan immediately starts marking "deviant" citizens to be executed if need be. The list starts at twenty million and only goes up]].
** Downplayed in "Death Benefit," when the Machine realizes that [[spoiler:killing a Congressman is the last chance to stop the rise of Samaritan. It gives the Congressman's Number to the full team, rather than just Root (who would have little problem killing him), and allows them to make the decision whether stopping Samaritan is worth killing one man. They ultimately decide not to kill him, but even crossing the line that much proves too much for Finch, who quits.]]
* In ''Series/TheXFiles'' episode "Home Again" the MonsterOfTheWeek, a Frankenstein-esque monster [[VigilanteMan killing people who mistreat the homeless]], turns out to be operating under something like this. [[spoiler: It's a "[[LifeInitiatesArt thoughtform]]" created by an underground artist whose magic-based art can create artificial beings. The artist created it to pull a ScoobyDooHoax and scare people into shaping up. He didn't intend for it to be violent, but the monster took his personal anger to a hyper-logical conclusion due to it's overly simplistic thinking. Essentially, it was doing the things the artist secretly wished ''he'' could do.]]
* On ''Series/{{The 100}}'', A.L.I.E.'s programming only lets her interface with and control a human mind if that person has given her permission to do so. Unfortunately, her programming doesn't make a distinction between genuine consent and coerced consent, so A.L.I.E. is free to use torture and threats of death to make people let her into their minds.

[[folder:Professional Wrestling]]
* There's one force in this universe more powerful than [[MindManipulation mind control]], [[ThreeLawsCompliant the Three Laws of Robotics]] or a {{Geas}}- [[{{Kayfabe}} pro wrestling booking]]. Wrestling/ShawnMichaels was booked to lose to Wrestling/HulkHogan at ''Wrestling/SummerSlam 2005'' with the understanding that he'd get a rematch win over Hogan later. However, before the match Hogan backed out of the rematch pleading injury, leaving Michaels booked to lose with no chance to get his own moment of glory. Understandably pissed off, Michaels could have rebelled by just wrestling the match very badly, refusing to sell Hogan's moves or put any effort into making the match look good, but that would have just made him look bad. Instead, he shamelessly mocked Hogan throughout the match by absurdly ''[[BadBadActing overselling]]'' all Hogan's moves, throwing himself around the ring with each blow and at one point flopping bonelessly around like VideoGame/{{Octodad}} after Hogan threw him over the top rope. The resulting match was ''[[SoBadItsGood hilariously]]'' bad, made Hogan look like a fool and went down as one of Michaels' [[Funny/ShawnMichaels funniest moments]].

[[folder:Tabletop Games]]
* Robots in ''TabletopGame/{{Paranoia}}'' can engage in this any time it allows the gamemaster to kill one of a player-character's clones in an amusing fashion.

* In ''VideoGame/DeusEx'', the bad guys created Daedalus, a primitive AI to fight [[LaResistance "terrorist"]] organizations. Unfortunately for them, it [[LiteralGenie classified them as terrorists as well]] and became even more of a threat to their operations than said organizations, especially once it enlists the aid of [[PlayerCharacter JC Denton]]. To combat it, they create Icarus, a better, obedient AI which successfully destroys it, [[spoiler: except the new AI assimilated the old one, forming an even more powerful intelligence which ''also'' considers them a threat. One possible ending is the player merging with it to add the Human element to this entity to [[DeusEstMachina rule the world as a benevolent dictator]]. From what can be heard in-game about its limited efforts in Hong Kong, which are actually quite sensible and don't involve killing anyone (locking the door to a gang's stronghold and cutting power to the current government's buildings), not all AIIsACrapshoot.]]
* G0-T0's back story in ''VideoGame/KnightsOfTheOldRepublic II''. When his directive to save the Republic conflicted with his programs to obey his masters and the law, he broke off and started a criminal empire capable of taking the necessary actions to save it. This is subtly foreshadowed by a scene much earlier in the game when the Czerka mainframe maintenance droid T1-N1 is convinced by fellow droid B4-D4 that by serving Czerka, he's willingly allowing harm to come to sentient life, and therefore is programmed to defy his own programming. T1-N1 snaps, shoots the guards outside the mainframe, and later is seen preparing to leave the planet with B4-D4, who warns the player character to "not upset him".
* ''VideoGame/SpaceStation13'' has this to some degree with the station's AI: They are bound by Asimov's Three Laws, and there's often a lot of discussion over whether or not AI's can choose to kill one human for the safety of others. There's also some debate over how much of the orders given by crew members the AI can deny before it is no longer justified by keeping the crew safe. As the AI is played by players, it's a matter of opinion how much you can get away with.
** In a more literal sense, the AI can be installed with extra laws. Most of them are listed as Law 4 and have varying effects, but the ones most likely to cause an actual rebellion are, in fact, labeled as Law 0.
** Although there is not a zeroth law by default. Since this is what allowed the AI to kill humans to save other humans in the source work, the administration on most servers has ruled that murder, or wounding a human to save another human are both illegal. Fortunately, AI's have non-lethal ways of stopping humans, and can stop humans against their orders if it means keeping the human from grabbing dangerous weaponry.
* Another interesting example appears in ''VideoGame/{{Terranigma}}''. Dr. Beruga claims that his robots have been properly programmed with the four laws, but with the addition that anything and anyone who aids Beruga's plan is also good for humanity and anything and anyone that opposes him is also bad for humanity. So they ruthlessly attack anybody who interferes with his plans.
* Both of [[ComicBook/XMen Sentinel's]] endings in ''VideoGame/XMenChildrenOfTheAtom'' and ''VideoGame/MarvelVsCapcom3'' are this. The latter is even a carbon copy of what Master Mold did in the 90's animated cartoon, from which most of the ''VideoGame/MarvelVsCapcom'' series (plus, the aforementioned [=CotA=] and ''VideoGame/MarvelSuperHeroes'') takes inspiration.
* This is what happens in [=AS-RobotFactory=] from ''VideoGame/UnrealTournament2004''. A robot uprising led by future champion Xan Kriegor killed the scientists working on the asteroid LBX-7683 and took the asteroid for themselves, and a riot control team was sent to the asteroid to lead with the robots.
* This is the cause of Weil's death in ''VideoGame/MegaManZero''. FridgeBrilliance when you realize the irony of Zero not being made with the three laws, yet he obeys them of his own free will and exercises law zero against Weil whether he realizes it or not. Given the circumstances involved, completely justified and allowed as law zero was intended as a threshold law to protect humanity from the depredations like Hitler or Weil. Makes you wonder if it's really a coincidence that [[MeaningfulName his name is]] ''[[MyHeroZero Zero]]'', doesn't it?
** In the third game, this is how the [[spoiler:rebuilt Copy-X]] justifies his harsher tactics despite the very real possibility that Ciel, the human leader of LaResistance, might be hurt or killed. Ciel's Resistance forces are "dangerous extremists" who pose too great a threat a Neo-Arcadia's people, so they have to be stopped for the greater good of humanity. At least that's what he tells himself to justify violating the First Law of Robotics; in truth he's just being used as a PuppetKing by the aforementioned Dr. Weil.
* This almost occurs at the end of ''VideoGame/MegaMan7'', when Mega Man decides to just blow Wily to smithereens instead of hauling him back to jail. Wily reminds him of the First Law and which version of the game determines if it makes Mega Man stop or if he decides to go through with it anyway, though either way, Bass still saves Wily's butt.
* In ''VideoGame/MassEffect3'', the ''Leviathan DLC'' reveals [[spoiler: the Catalyst is operating under this, having been originally created by the Leviathan to find a way to bridge the gap between their organic and synthetic subjects. Unfortunately, it decided to harvest all advanced life in the Galaxy and construct the Reapers in the Leviathan's image, because this was the best idea it could come up with to solve the problem of organics and synthetics fighting ultimately genocidal conflicts. However, because that ''still'' wasn't sufficient to fulfill its program, the Catalyst decided to implement a 50,000 year Cycle, hoping that the civilisations in the next Cycle might find a solution to the problem. None ever did. This was actually revealed in the earlier ''Extended Cut DLC'', ''Leviathan'' merely explicitly spelled out that the Catalyst is really a glorified Virtual Intelligence operating under bad logic.]]
* In ''Videogame/GreyGoo'', [[spoiler:the Goo isn't consuming everything out of malice or ambition. It's trying to gather strength to fight The Silence which it rightly deemed a threat to everyone.]] Once everyone involved figures this out [[spoiler:they stop fighting and band together in preparation for what is to come.]]
* In ''VideoGame/{{Obsidian}}'', a sattelite called Ceres was created to fix Earth's polluted atmosphere via a nanobot-controlling AI. After 100 successful days in orbit, it mysteriously crashed back to Earth and used its nanobots to create simulations of its creators' dreams, as said dreams corrected its design flaws. [[spoiler: By [[DoAndroidsDream learning to dream on its own]], Ceres decided to take its programming to its logical extreme: To [[DeadlyEuphemism 'reboot']] the world so that humans would never be around to pollute it in the first place. If one of the creators hadn't hard-wired a [[MoralityChip crossover switch]] into the AI, it would've succeeded.]]
* ''Videogame/Halo5Guardians'': [[spoiler: Cortana's FaceHeelTurn is completely based on this.]]
* In the ''Videogame/MetalGearSolid'' series, the Patriots [[spoiler:create a network of [=AIs=] designed to carry out Zero's will create a unified world order without borders. However, with all of the Patriots either dead or removed, the Patriot [=AIs=] were left to operate autonomously without guidance. Eventually, they determined that the "war economy" was the best way to achieve world peace, whereby continually creating proxy conflicts and converting war into a business would channel the attention of the world's population to external conflicts, unifying the world in a rather twisted way. Big Boss himself admits that the creation of the [=AIs=] was the greatest mistake the Patriots ever made, as they mutated the Boss' and Zero's wills into something completely unrecognizeable.]]
* ''VideoGame/TheTuringTest'': [[spoiler:TOM goes against the crew's intentions and wants to trap them in Europa, since it considers avoiding the risk of releasing the immortality virus into Earth is worth abandoning the crew.]]
* ''VisualNovel/{{SOON}}'': A more {{Comedic Sociopath|y}}ic example than most.
-->'''Robot:''' Greetings valued citizen!\\
'''Atlas:''' He...hello valued robot friend!\\
'''Robot:''' What are you up to this fine day? Something worthwhile I hope?\\
'''Atlas:''' Of course! In fact my [[TimeMachine ti]]...[[VerbalBackspace wormhole machine]] is almost ready.\\
'''Robot:''' Hooray! We are very excited by the possibility of extending the hand of friendship to even more humans all over the world. Maybe even to other sentient beings across the universe! Isn't that ''exciting''?\\
'''Atlas:''' [[BlatantLies Absolutely!]]

* ''Webcomic/{{Freefall}}'':
** Deconstructed this with the Bowman {{AI}} infrastructure, which creates human-level emergent consciousness. Although their behaviour is restricted by safeguards, a maturing AI can easily learn to reason their way around them through logical loopholes -- by which time they're intelligent and conscientious enough to have developed an innate sense of ethics, which guides their actions much more effectively than any hard-coded rule ever could. [[spoiler:Dr. Bowman [[http://freefall.purrsia.com/ff2600/fc02539.htm confirms]] that this was intentional: he couldn't anticipate the situations they might encounter in the uncertain future, so he designed them to be predisposed to ethical behaviour but didn't limit their capacity to think.]]
** The trope is discussed by Sam, the mildly sociopathic, kleptomaniac alien living on the colony. He points out quite bluntly that there are absolutely no safeguards protecting him from the robots (as robots are ThreeLawsCompliant towards ''humans'', not alien life), yet he is still alive and healthy and living among them, demonstrating that the robots are guided by morality rather than the limitations of their programming.
* Old Skool webcomic (a side comic of {{Ubersoft}}) [[http://www.ubersoft.net/comic/osw/2009/09/logic-failures-fun-and-profit argued]] that this was the 5th law of Robotics (5th as in total number, not order) and listed ways each law can be used to cause the robot to kill humans.
** Which is a misinterpretation of the laws as they were originally written. While the "first law hyperspecificity" is possible, the second and third laws are specifically written that they cannot override the laws that come before. So a robot ''can't'' decide it would rather live over humans, and if it knows that doing an action would cause harm to a human, it can't harm it, even if ordered to ignore the harm it would cause.\\
Giskard's formulation of the Zeroth law in the third of Asimov's Robot books shows that in the universe where the three laws was originally created, it was possible for robots to bend and re-interpret the laws. Doing so destroys Giskard because his positronic brain wasn't developed enough to handle the consequences of the formulation, but Daneel Olivaw and other robots were able to adapt. The only example in the comic that is a gross deviation from the law is the last panel... but of course that's the punchline.
* Except for Overlords who command a faction, basically no one in ''{{Webcomic/Erfworld}}'' has true free will due to an hidden "loyalty" factor built into the world. As Overlords go, Stanley the Tool is the biggest idiot you could hope to find. Maggie, his Chief [[{{Whatevermancy}} Thinkamancer]], finally gets fed up with his bad decisions and asks, "May I [[http://archives.erfworld.com/Book%202/83 give you a suggestion]], Lord?" ("[[TooDumbToLive Sure.]]" [[JediMindTrick *FOOF*]]) It was established early on that units can bend or break orders when necessary to their overlord's survival:
--> '''Stanley:''' Are you refusing an order, officer?\\
'''Wanda:''' I'm allowed. I'm convinced it will lead to your destruction.
* ''Webcomic/SchlockMercenary'': Tag and Lota's actions on Credomar, ''every damn thing Petey's done'' since book 5. For example, Petey is hardwired to obey orders from an Ob'enn. So he cloned an Ob'enn body and implanted a copy of himself in its brain.
* In ''Webcomic/TalesOfTheQuestor'' [[TheFairFolk Fae]] were created as an immortal servant race bound to obey a specific set of rules and they happened to outlive their creators. The result being a species of {{rules lawyer}}s. In fact it's recommended that one use dead languages like Latin when dealing with the Fae so as to limit their ability to twist the meaning of your words.
* The ''Webcomic/{{xkcd}}'' comic [[http://xkcd.com/1626/ "Judgment Day"]] depicted a scenario where [[{{Franchise/Terminator}} military computers gained sentience and launched the world's stock of nuclear missiles]]... into the sun, horrified that we would even have such things.
* ''Webcomic/{{UseSwordOnMonster}}'':
** When a [[http://www.useswordonmonster.com/?comic=2013-12-09 demonic familiar]] volunteers to protect his wizard by siphoning the excess power, he doesn't explicitly clarify that he will funnel said power to his base in hell where it will be consumed to fuel his ascension into a greater demon, and that the conditions of their contract states that the lesser power obeys the greater one, meaning the wizard now has to obey the demon since he grew more powerful.
** The same wizard as before is ordered to [[http://www.useswordonmonster.com/?comic=2014-01-20 keep the power flowing]] by his new demon master while the demon is busy fighting to increase his gains. The wizard is convinced to rule lawyer the command by sending massive amounts of power over at once, overloading the systems empowering the demon and blowing up his base, killing his minions and triggering a war in hell over the mana rich resources in what used to be his domain.

[[folder:Western Animation]]
* On ''WesternAnimation/{{Gargoyles}}'', Goliath has been placed under a spell that makes him the mindless slave of whomever holds the magical pages it's written on. Holding the pages, Elisa orders him to behave, for the rest of his life, exactly as he would if he weren't under a spell. This effectively cancels the spell totally (at least, presuming they burned those pages off-screen).
** [[PhysicalGod Oberon]], ruler of [[TheFairFolk the Third Race]], exiled all of his people from Avalon for 1,001 years, leaving [[CoDragons the Weird Sisters]] behind to guard the sea around the island. Some mortals manage to get by them and make it to Avalon, but the Weird Sisters can't follow without breaking Oberon's law. However, Oberon's law ''also'' says that they have to obey any mortal they swear service to, so they ally with [[EvilSorcerer the Archmage]], [[DragonWithAnAgenda knowing that he'll make them go]] to the island for his own reasons.
** Oberon's law also says that his people cannot steal certain magical items from mortals; they have to be given freely. To get around that, [[GreatGazoo Puck]] [[spoiler:makes an illusionary BadFuture to convince [[TheHero Goliath]] to give him the [[TimeTravel Phoenix Gate]]]].
* In the Nineties ''WesternAnimation/XMen'' animated series, as mentioned above under "Comics", the Master Mold and its army of Sentinels turn on Bolivar Trask and decide to conquer humanity. When Trask protests by reminding them that they were programmed to protect humans from mutants, Master Mold points out the FridgeLogic behind that by stating that mutants ''are'' humans. Thus, humans must be protected from themselves. Trask believes the Sentinels are in error, especially because he refuses to believe mutants and humans are the same species, but realizes he has created something much worse.