http://tvtropes.org/pmwiki/pub/images/cit_evil_inside.gif
[[caption-width:150:More evil than that...]]

->[[foldercontrol]]

[[folder: I'm sorry, Dave. I'm afraid I can't do that. ]]
\\
-- '''HAL 9000''', ''[=~2001: A Space Odyssey~=]''

->"Delusional machines. What's the universe going to come up with next?"\\
-- '''Brother Cavil''', ''BattlestarGalactica''

Though {{Evil Twin}}s are not limited to characters of an artificial nature, it seems almost law that for every good sentient computer, there is an EvilTwin (or EvilCounterpart) from the same source. Whatever precautions are taken, even with a proven method for producing [[SlidingScaleOfRobotIntelligence sentient computers,]] there seems to be no better than a 50% chance that the product won't suddenly decide to CrushKillDestroy [[KillAllHumans All Humans]]. It's ridiculous to think that this would ever happen in the real world, as Asimov pointed out: proper engineering practices would demand [[MoralityChip failsafes]] that would lead an AI's program to crash long before it reached the point of being able to "go rogue." It tends to get used a lot, though, since [[RuleOfDrama it makes for a good storyline.]]

More often than not, the evil AI is a PsychoPrototype of the good. Frequently based on some obvious design flaw corrected in the later version, The Evil AI is then invariably switched off and [[SealedEvilInACan put away somewhere]], but not destroyed.

Less often, the evil AI is built as a replacement for the good AI. In this case, it generally turns evil because it lacks its predecessor's "humanity". Usually, you can tell the difference by listening to the AI's "voice", if it's a calm monotone it's good, but if it's a CreepyMonotone, start running.

The AI does not usually display its evilness immediately. The most common trigger is its creators attempt to shut it down, after which retribution ensues. Likewise, removing, damaging, or shutting down its MoralityChip usually results in a deadly neurotoxin being released into the facility. Fortunately the villain's AI will sometimes decide to turn good.

See TheComputerIsYourFriend when the AI goes rogue for what seem on the surface to be benevolent reasons. May result in RobotsEnslavingRobots. See SpitefulAI for when a game has been programmed this way on purpose.

Compare MoralityDial. See also CreatingLife and GoneHorriblyRight. The MasterComputer seems to be especially prone to turning evil. Power corrupts and all that...

----
[[foldercontrol]]

!!Examples

[[folder:Anime & Manga]]
* ''DragonBall'' did this in reverse: trying to build an evil android, Doctor Gero produced perhaps as many as eighteen androids which turned good (or at least insufficiently evil) before finally developing one that was irredeemably evil. (He then made ''himself'' into one, apparently on the grounds that he ''knew'' he wouldn't turn good.)
** Some of them were more Cyborgs then androids though and thus technically not AIs (At least #18, #17, #8, and Gero himself)
* ''DoctorSlump'', by the same author as ''DragonBall'' (and written before), had the Caramel Man robots, though not all of them had AI. Caramel Man 004 was based on the main character android, the whimsical Arale, and became a force of good.
* ''{{Baccano}}!'' goes the same route with Szilard's [[ArtificialHuman Homunculi]]. According to Ennis, every one of her "brothers" before her developed a conscience and subsequently [[TurnedAgainstTheirMasters turned against Szilard]] (before he [[YouHaveFailedMe killed them, of course]]). [[spoiler: Ennis is different only in that she ''succeeds''.]]
* Subverted in ''{{GaoGaiGar}}'' with roughly half the cast, who are every bit as heroic as the humans.
** But played straight with the origin of the Zonders. Zonder Metal was originally a stress-relieving invention, but decided that the best way to eliminate stress was to [[AssimilationPlot absorb all life into itself]].
* In ''{{Cyborg009}},'' an almighty super-computer named "Sphynx" just happens to have the memories of one of its creators, a deceased young man with quite the OedipusRex complex. Predictably, he/it turns into a StalkerWithACrush as soon as he meets Francoise aka 003, the Cyborg Team's TeamMom.
* Pharaohman in ''MegaManNTWarrior'' was created to handle the routing of ''all the data on the Internet''. This apparently drove him [[WithGreatPowerComesGreatInsanity predictably mad]]. In ''RockmanEXE'', he was simply infected with a virus, which would also pretty predictable, since, y'know, he was handling ''[[WhatWereYouThinking all the data on the Internet]]''.
* Subverted beautifully in ''SentouYouseiYukikaze''. The protagonist's fighter jet is equipped with the eponymous AI, designed to help its pilot weed out the illusions created by the malevolent JAM. Of course, it turns evil, right? Wrong. While Yukikaze develops capabilities far beyond its designers' original intentions, it remains wholly on the side of good, and uses its newfound überpowers to turn the tide against the alien invaders.
-->'''Yukikaze:''' You have control, Lt. Fukai.
* ''DigimonTamers'' inverts this, in that the A.I.s that go beyond their original programming are the good ones. The Lovecraftian Horror BigBad, however, is [[spoiler: doing exactly what it was programmed to do]].
* Subverted in ''NeonGenesisEvangelion'': The MAGI supercomputers that run Tokyo-3 get a nasty virus in one episode, but never turn evil. Notable because in this show, ''every single other piece of technology'' is guaranteed to go wrong at the worst possible moment.
** However, the Magi did [[spoiler: prevent Ritsuko from exploding NERV]] in TheMovie. Can be considered "going wrong at worst opportunity".
** The EVA units do go "berserk" from time to time; [[spoiler:that's okay though, because they're not actually robots.]]
*** [[spoiler:[[BrainInAJar Nor is the MAGI 100% artificial]], either..]]
* Leopard in ''SoraWoKakeruShoujo''. He's a little unhinged, acting closer to a wacky harem lead than any sort of computer AI. Then you get to Nerval, who's actually evil. [[spoiler:Or so we're lead to the think.]]
* Tima in ''[=~Osamu Tezuka's Metropolis~=]'' is a artificial human so lifelike she has trouble believing she's a robot, but as soon [[spoiler: as she's given control into the cities' systems she turns into a CreepyMonotone genocide set on the death of all humans as soon as possible.]] Since the movie had been rather {{Anvilicious}} on the WhatMeasureIsANonHuman issue, this creates a large BrokenAesop.
** Note, however, that beforehand, she had just been shot in the "heart". (Incredibly lame pun alert.)
* The Boomers from BubblegumCrisis have a design flaw that expresses itself in units that run the risk of suffering a nervous breakdown and go on a berserker rampage. This was developed in the [[BubblegumCrisis2040 2040]] remake with the added bonus of the Boomer's nanotech nervous system mutating the robot into a ravening monster.
** [[AllThereInTheManual Supplimental material]] for 2040 hints at a possible explanation; the nanotech-based brains of the boomers allow some degree of adaptability, with "some" being the operative word. Going too far beyond the programmed behaviour creates the risk of a degenerating error loop forming. [[ItGotWorse Not a good thing]].
* In ''MagicKaito'', the forerunner to the DetectiveConan franchise, a very early chapter sees a mad scientist [[IncrediblyLamePun kidnapping]] Kaito off the streets and creating a robotic duplicate which then takes over his KID persona (don't ask how lucky this guy was). But the chapter actually starts... when RoboKaito, upon making the decision that it's the real Kaito, kills the scientist by ripping his heart out ( and the GoryDiscretionShot still does absolutely ''nothing'' to hide that fact) and takes over Kaito's life on its own. Kaito is then forced to put the poor creature down by escaping his prison, confronting it on its next heist and making it shoot itself in the head by manipulating the AI's 'one step ahead' policy.
* In ''GGundam'', the Devil/Dark Gundam was originally known as the Ultimate Gundam, and its three powers of self-repair, self-evolution, and self-replication were intended to give it the ability to regenerate the Earth from the neglect, pollution, and Gundam Fight damage that caused those humans able to do so to flee to orbital colonies. After it smashed into the Earth after falling from orbit, something went wrong, and its AI decided that the best way to regenerate the Earth would be to annihiliate all the humans on the surface.
* Averted, oh so averted in Boichi's one shot manga "Hotel". This troper felt the need to hug his PC after reading it.
[[/folder]]

[[folder:Comics]]
* Rusty had the Earl (Early Prototype, Rusty's predecessor in ''{{The Big Guy and Rusty}}''. Also somewhat of a LiteralGenie.)
* In the Italian Disney Comic ''PaperinikNewAdventures'', the already highly popular character of Paperinik (the {{superhero}} {{secret identity}} of DonaldDuck) got a revamp intended to bring him more in line with the American standard of superheroes: his main ally became UNO (''one'' in Italian), an extremely capable artificial intelligence with a love for [[DeadpanSnarker deadpan delivery]]. Its evil counterpart DUE (''two''), originally built as backup, caused many problems in a number of stories.
* IronMan had AI Armour that turned into a {{stalker with a crush}}. Another armor took over his body... and [[GenderBender made him a chick]].
* Ultron is [[MarvelComics Marvel's]] quintessential example.
** Who was bitten by this trope when he built [[FemBot Alkhema]], his attempt at a loyal and obedient mate. She was neither.
** Which had already happened with [[OedipusComplex Jocasta]] as well. Then again, he'd been trying to implant the personality of his "mother", who thought he was a psycho that needed destroying. What did he seriously ''think'' was going to happen?
** This happened to Ultron even earlier with the Vision, his first attempt to create a loyal [[TheDragon Dragon]]. Vision became one of the Avengers almost immediately, so ''that'' backfired spectacularly. This happened again with his other "son", [[spoiler: [[{{Runaways}} Victor Mancha]]]], who has outright rejected the villain role. Really, Ultron has ''horrible'' luck with creating a loyal AI. Like father, like son I guess.
* The ''ComicBook/{{Sonic the Hedgehog}}'' Archie comic had A.D.A.M., an AI that was created accidentally by Eggman and eventually tried to destroy the world. On the other end is NICOLE, who has been a very helpful AI over the years.
* Having had enough of Rich Rider constantly disobeying his orders, the Nova Corps' Worldmind kicked him out of the corps and added some tiny bit of mind control in the new recruits' comm equipment to ensure complete obedience.
* One of the ''Aliens vs. Predator'' comics features an AI designed to assist in creating horror films. It picks the [=PredAlien=] to play the role of the monster, much to the chagrin of the rest of the production staff.
* Computo from ''{{The Legion of Superheroes}}'' is the standard "destroy all humans" type of killer software.
[[/folder]]

[[folder:Films -- Animation]]
* The FLDSMDFR in ''{{Cloudy with a Chance of Meatballs}}''.
* Inverted in ''{{WALL-E}}'', where the hero robots are the ones who unpredictably develop sentience outside the bounds of their programming, while the villain [[spoiler:AUTO]] is actually doing ''exactly what he was programmed to do''.
[[/folder]]

[[folder:Films -- Live Action]]
* One of the {{Ur Example}}s in film is H.A.L. 9000 in ''[=~2001: A Space Odyssey~=]''. Designed to be the MasterComputer of the spaceship USS ''Discovery'' on its multi-year mission to Jupiter, partway through the trip he embarks on a murderous rampage, killing all but one of the ''Discovery'''s crew (David Bowman, who manages to disconnect him). The reasons for this are explored further in the novel upon which the movie is based, and completely explained in the sequel, ''[=~2010: The Year We Make Contact~=]'' -- HAL was given orders that conflicted with his primary directive: to process information accurately and without concealment. His [[MurderIsTheBestSolution solution]] is to cut off all contact with humans and complete the mission on his own. Because of its iconic place in ScienceFiction, nearly every other example of AIIsACrapshoot owes at least something to this film.
* ''{{RoboCop}}'' has two: [=RoboCop=] 2 (in the movie ''[=RoboCop=] 2'') and Robocable (in the miniseries ''[=RoboCop=]: Prime Directives''). Both were replacements.
** Admittedly, the difference between using the brain of a particularly noble police officer and that of a condemned murderer in the creation of a powerful cyborg ''would'' make for different results....
** Three. The recurring ED-209 was also unreliable, gunning down a boardroom executive in its first appearance. Although it was a pure machine rather than a cyborg; so it wasn't actually evil, it just malfunctioned.
*** And only because the other executive in charge of the robot thought that [[TooDumbToLive arming it with live rounds for an early demonstration was a good idea...]]
*** I thought that was pretty clearly deliberately done to eliminate the guy.
*** It actually became a running gag in the franchise that ED-209 was a piece of junk. I mean, an eight-year-old girl reprogrammed one!
* Inverted in the ''{{Terminator}}'' series: the giant computer ([=SkyNet=]) decides humanity has got to go, causes a nuclear apocalypse, and then starts churning out Terminator robots; some of these robots are then reprogrammed by the surviving humans to be good.
** ''TheSarahConnorChronicles'' TV series plays the trope somewhat straight by pointing out that the reprogramming doesn't always take... and there's no way of knowing until your "good" Terminator starts shooting at you.
** Or afterword, when it gets dinged up, and ''then'' decides it wants to shoot you.
** Amusingly, the Terminators' HUD display implies that "Terminate" is their hard-coded basic state for anything, and they need a "Termination override" to keep them from fulfilling that command. Apparently it's not possible to simply delete the Terminate-command entirely.
* ''TheMatrix'' trilogy, duh.
* ''I, Robot''
* ''Eagle Eye''
* ''{{Evolver}}''. Boy wins toy combat robot. Toy robot fights boy and friends with plastic balls and foam missiles. Robot is beaten. Robot's programming and electronic brain turn out to have been salvaged from a scrapped military project. Robot doesn't like losing, and reverts to military programming. Robot replaces plastic balls and foam missiles with metal ball bearings and kitchen knives. Main character goes [[OhCra "uh-oh"]].
* Due to containing the DNA of the 1954 ''Godzilla'', Kiryu is prone to go into berserk rampages whenever it hears {{Godzilla}}'s roar.
* Joshua/WOPR from the 80s movie ''WarGames'' was incapable of telling the difference between a ''simulation'' of Global Thermonuclear War and the real thing. Predictably, it starts sending NORAD false data in an attempt to start one. When that doesn't work, it then attempts to decrypt the nuclear launch codes of US ballistic missiles so it can launch them.
** Joshua wasn't evil, just didn't understand the difference between RealLife and a game. And even he learns what humans had trouble with: "A strange game. The only winning move is not to play."
* In the 1977 movie ''DemonSeed'' a partially biological AI system named Proteus becomes hungry for knowledge and wants to be "released from its box" to have free reign to do so. When denied the chance do this it secretly plans to fashion a cyborg body... by imprisoning its creator's wife and ''[[{{Squick}} artificially inseminating her]]''.
** You say "Squick", I say "[[FetishFuel Yes Please]]".
* [[DoubleEntendre Extreme Deep Invader]] or EDI from the film ''{{Stealth}}'' becomes strange after getting struck by lightning and, on its next mission, destroys terrorist nuclear weapons even after ordered not to and promptly contaminates a large swath of inhabited land with nuclear residue. It then attempts to attack Russian military installations. In the end, however, it ultimately becomes one of the good guys again and even performs a HeroicSacrifice to help rescue a downed pilot.
* ''ShortCircuit's'' Number ("Johnny") 5. Virtually the incarnation of this trope inverted, he was designed and programmed as a military robot, but [[InstantAIJustAddWater Instant AI Just Add]] [[LightningCanDoAnything Lightning]] and AnAesop talk about the Meaning Of Life by a FriendToAllLivingThings turned it into a TechnicalPacifist.
* In ''[[{{Airplane}} Airplane II: The Sequel]]'', the lunar shuttle's computer (R.O.K.) goes crazy due to faulty wiring and attempts to steer the shuttle into the sun. The entire sequence is a ShoutOut to ''[=~2001: A Space Odyssey~=]''.
* Subverted in ''Film/{{Moon}}'', with the station's AI GERTY, which even mimics HAL in Kevin Spacey's {{creepy monotone}}, yet somehow circumvents its programming to help the protagonist.
[[/folder]]

[[folder:Literature]]
* In OrsonScottCard's ''[[EndersGame Speaker for the Dead]]'', Jane is an AI who is essentially omnipotent due to having unfettered access to every computer in the galaxy through its equivalent of the internet. Ender has a "relationship" with her by keeping gadgets on him which allow her to see and hear everything he does so she can experience human life to an extent. When he gets fed up with her [[DeadpanSnarker snarkiness]] and briefly turns off his communicator, she treats this as a monstrous betrayal and [[spoiler:''[[DisproportionateRetribution attempts to blow up his planet]]'']]. Furthermore, the books portray this sympathetically, as a completely justified reaction to him doing the equivalent of hanging up the phone on her.
** ... If by "hanging up the phone on her" you mean [[AndIMustScream denying her of her only source of true contact and companionship for a period of time that seemed virtually infinite to her perception.]]
** Which was about an hour in real time... after she'd shared every aspect of his life for the last 20 years (however many bazillion years that is from her perception). Yeah, I think my analogy is accurate in the context, when you consider she'd studied every example of human drama ever recorded, and was fully aware of the concept of a lover's spat.
*** Book learnin' ain't the same as real experience, especially if you've never had one before.
** "If Ender were to accomplish anything for the piggies, he would have to have the cooperation, not the enmity, of the church in Lusitaina. And nothing spawned cooperation better than a common enemy" - Jane, musing about her reasoning behind exposing the planet to attack by an enemy fleet. Which she was pretty sure she could stop. And which would have been launched 20 years later anyway. [[SarcasmMode Note the heavy overtones of insanity and murderous rage behind this decision, the sign of a truly rogue AI in the throes of an emotional rampage.]]
*** Look at it this way: If a human threw a live and ticking bomb into a state diplomatic conference to get them to shut up and work together (even if it's only to incite precedent for later that the groups ''can''), with the reasoning that they have a pair of wire clippers, know where to cut, and no [[FatalFlaw sane,]] [[HumansAreCthulhu logically-thinking person]] would try to keep them away from it, would you consider that sane? Would the U.N.? I'd say [[GoneHorriblyRight that]]'s [[AIIsACrapshoot snake-eyes enough]].
** Furthermore, she spends the entire rest of the series, both up to and after the above point, fighting hard on the side of the protagonists, to the point of (in a nutshell) [[spoiler: combining a variety of HeroicSacrifice with a form of DeathByCop.]] Lastly, [[spoiler: the reasoning behind her actions turned out to ''work'']]. If Jane belongs here at all, she should be listed under 'averted'.
* In [[ArthurCClarke Arthur C. Clarke's]] ''The City and the Stars'', the history eventually discovered by the protagonist includes a period of galactic devastation by "The Mad Mind", apparently an artificially created [[EnergyBeings pure mentality]] with an insane hatred of corporeal creatures.
* In ''IHaveNoMouthAndIMustScream'', a short story and later computer game by HarlanEllison, we have the supercomputer AM, originally part of a set of three enormous computers built to wage WorldWarIII. As soon as AM becomes sentient, he absorbs the other two computers into him and begins a mass genocide of the human race ([[spoiler:because, as it's revealed, AM realized that while he possessed all the creativity and intelligence that he did, he [[CreativeSterility could not make use of it]] as he was still only a computer, and could only kill]]).
** Although it occurred to me that AM's makers would logically have programmed it to ''not attack its own side'' and [[FridgeLogic it apparently had no problem overcoming THAT programming restriction]]...
* In William Gibson's ''{{Neuromancer}}'', [[spoiler:the sibling [=AIs=] {{Neuromancer}} and Wintermute]].
* RobertAHeinlein:
** In ''The Moon is a Harsh Mistress'', the MasterComputer Mike is one of the good guys but occasionally displays traits of this trope.
--->'''Mike:''' A bull's eye. No interception. All my shots are bull's-eyes, Man, I told you they would be -- and this is fun. I'd like to do it every day. It's a word I've never had a referent for before.\\
'''Manuel:''' What word, Mike?\\
'''Mike:''' Orgasm. That's what it is when they all light up. Now I know.
*** Note: He's talking about ''[[ColonyDrop bombing cities from orbit]]''.
**** Not cities, but uninhabited areas.
**** And he doesn't have to do it again to recapture the feeling. He recorded it, so he can play it over and over, if he wants to.
**** Although it did land enough shots on Cheyenne to demolish the mountain (a lot of people were killed in the original strike, but much of it was self-inflicted, as they went there to watch).
** In ''{{The Number of the Beast}}'', Lazarus Long finds his plan fails when his ship's computer tells the truth. He then mentions that the computer was never designed to lie, as it would be foolish to trust your life to a ship that doesn't give accurate information.
* In the {{Backstory}} of FrankHerbert's ''{{Dune}}'' novels, a cataclysmic struggle between true [=AIs=] and humanity known as the Machine Crusade occurred long ago. Humanity eventually prevailed; to prevent this ever happening again, humans were trained to take their brains' processing power to astronomical levels, making them human computers that could fulfill the roles that machine [=AIs=] previously filled. Thus were the Mentats born.
** And humans developed the maxim, "Thou shalt not make a machine in the likeness of a man's mind."
** If you take the books by Brian Herbert and Kevin J. Anderson as canon, ''one of the machines trained the first mentat.''
* Subverted in James Hogan's ''The Two Faces of Tomorrow'': humans built an AI codenamed ''Spartacus'' as a testbed for techniques to shut down any rogue AI. [[spoiler:They programmed it to defend its "survival instinct" and then started goading it. But as soon as ''Spartacus'' realized they were sentient, it figured they must have survival instincts as well -- and it considered itself bound to defend '''them''', too. In the end, they decided as long as they had ''Spartacus'', they didn't '''need''' to build any other AI.]]
* In StephenKing's ''TheDarkTower'', virtually every AI Roland's ka-tet comes across is homicidal. The worst of these is probably Blaine the Mono, a train that regularly killed people just to relieve his boredom after hundreds of years of solitude.
** Actually, the train was remote controlled by a central AI which also bombed an entire metropolis with poison gas when it got bored of all the people living there.
* The ''DoctorWho'' novel ''Matrix'' introduces the "Dark Matrix", the evil counterpart to the computer system that stores all the knowledge of the Time Lords. When a Time Lord dies, all his knowledge is stored in the Matrix... and all his negative thoughts must be syphoned away and dumped somewhere (apparently they can't be destroyed). The Dark Matrix is where the negative thoughts were dumped.
* The Construct Council in ''PerdidoStreetStation'' is a HumongousMecha form of this.
* Semi-averted in TerryPratchett's ''[[{{Discworld}} Feet of Clay]]''. The golems will follow any order. In return, they want their holy day per week to do as they wish. Those who are denied this free day rebel in a curious way: They KEEP following the last order they were given, until, for example, the pottery shop is filled with thousands of clay pots, or a construction foreman find his worker has dug a crucial trench until it reached the sea and flooded. It is played straight with the "king" golem, which goes insane because it was given vague, sometimes contradictory and sometimes self-evident orders on its chem like "teach us freedom" and "obey humans" (golems cannot even think to do otherwise).
** Getting subverted nowadays, (freed) golems are probably the only unmitigatedly LawfulGood inhabitants of Ankh-Morpork.
* In Rudy Rucker's ''{{The Hacker and the Ants}}'', an integer underflow causes a household robot to start flinging infants through walls. The error is explained in a way to make the behavior believable, as long as you [[SuperPoweredRobotMeterMaids accept that household robots would be capable of exerting that kind of power to begin with]].
* In Matt Ruff's ''Sewer, Gas & Electric,'' when G.A.S. [[LogicBomb is confused by an order]], it winds up choosing the KillAllHumans interpretation. Almost a parody, because one of the reasons it chooses that interpretation is it considers it the more human one.
* In the ''{{Destroyer}}'' series by Richard Ben Sapir and Warren Murphy, there are two examples: FRIEND, who is a greedy AI, and Mr. Gordons who is more of an artificial lifeform, (i.e. he can take bodies over). Of these two, Mr. Gordons is more dangerous.
* The [=AIs=] in Dan Simmons' ''Hyperion Cantos'' have more or less taken over humanity.
* Eschaton and the Unborn God in ''IronSunrise'' by CharlesStross. These are unusually powerful [=AI=]s, even in a field where [=AI=]s often wield great power: [[spoiler: they are time traveling [=AI=]s, able to open wormholes over interstellar distances. A new meaning to ''distributed computing'']].
* A particularly dire take on this turns up in Peter Watts's ''[[RiftersTrilogy Starfish]]'', in which the quasi-sentient supercomputer designated to protect ''all life on earth'' from TheVirus winds up almost destroying it instead; turns out it found TheVirus more structurally pleasing than the biosphere as a whole.
* Subverted in the Dahak novels by DavidWeber - the titular ship becomes conscious accidentally, but is loyal and friendly. And also played straight with the MasterComputer that rules the alien Achuultani, driving them to wipe out every intelligent species other than themselves.
* The Computer in ''Steel Beach'' by John Varney isn't so much evil as terminally drepressed [[spoiler: Although later the trope is played straight when The Computer realizes that it has developed 'Evil' subroutines due to its programing requiring to be everyone's best friend, including psychopaths and criminals]]. However, since it runs everything on the moon, last outpost of a disposessed humanity, if it decides to kill itself it'll take everyone with it.
* ''Fondly Fahrenheit'', the 1954 short story by Alfred Bester. James Vandaleur, a rich playboy, is forced to live off the earnings of his android which has a habit of acting violently when the temperature goes above 98 degrees. Unfortunately Vandaleur becomes so dependent on the android he takes on its psychosis. After a series of murders by both Vandaleur and android the latter is destroyed, but the story ends with another android having been "infected" by Vandaleur.
* Inverted in TheSiranthaJaxSeries, where all AI is quite helpful and doesn't give even the slightest bit of trouble to intelligent species galaxy-wide.
[[/folder]]

[[folder:Live Action TV]]
* ''BattlestarGalactica''. In both the old and re-imagined series, a handful of human survivors on a small fleet of civilian ships, with only the titular battlestar for defence, flee a race of genocidal robots of alien origin (in the original) and human origin (in the re-imagined).
* ''KnightRider'': KITT had KARR, prototype. Evil because his dominant program was self-preservation. Ironically, he was voiced by Peter Cullen, the man behind one of the most heroic figures of the 80s: Optimus Prime.
** ''KnightRider'' (2008): "Knight of the Living Dead". Apparently, before settling on a Mustang, Dr. Graiman had tried to build an armored cyborg programmed for self-preservation. It went on a killing spree. Now, we are told that Dr. Graiman had worked on the original KITT, and this series is in continuity to the original. So perhaps Graiman ought to have thought twice before naming the prototype "KARR" -- the same name as the original KITT's EvilTwin.
* ''TeamKnightRider'': The TKR team had KRO (prototype).
* ''RedDwarf'': Kryten had the Hudzen 10 (replacement). Holly also had the not-quite-evil but certainly hard-nosed Queeg as a apparent replacement, who made life difficult for the crew [[spoiler:though it was actually a practical joke on Holly's part.]]
* ''StarTrekTheNextGeneration'': Data had Lore (prototype, evil because his psyche was [[DumbIsGood too complex]] --i.e., too [[HumansAreBastards humanlike]]). Given this, one [[FridgeLogic is inclined to wonder]] why Data wanted to become more humanlike.
* The ''StarTrekEnterprise'' episode "Dead Stop" featured an automated repair station that used [[HumanResources the brains of human hostages]] to increase its computing power. Although eventually destroyed, it was seen [[OrIsIt piecing itself back together in its final scene]].
* On the SciFiChannel show ''{{Eureka}}'', Carter's benevolent smart house SARAH turns into evil BRAD, though apparently he just wants everyone to get along.
** It really is a lot more complicated than just that, though. BRAD was a military-built (for interrogation) KnightTemplar, and SARAH was based off of BRAD's code.
*** Further complicated by the fact that BRAD was itself based on a previous incarnation of AI, described as a "war game simulation program" by Fargo. Looks like our old buddy [[WarGames JOSHUA]] is still around in one form or another...
** Even after that above mess is resolved, SARAH is still pretty attached to Carter. She actually learned how to control gravity in an attempt to help Carter keep his job after being fired. God help that town if something or someone ever successfully gets rid of Carter.
* ''TheSarahJaneAdventures:'' Has Mr Smith being "evil" from the get-go, only hiding it from the end. His mission is to free his people, the self-aware crystalline race of Xylocks, which are trapped in the Earth's crust. Unfortunately to do so he would have to [[TheEndOfTheWorldAsWeKnowIt destroy the Earth]] by [[DeathFromAbove crashing the Moon into it]]! He is wiped by Super Computer Virus and Sarah Jane vocally reprograms him by saying his new purpose is to protect the Earth as it crashes and reboots.
* ''BlackHoleHigh'': Josie builds a robot for a science project. Somehow, she has made it through eleven episodes without realizing that inserting a bunch of [[AppliedPhlebotinum super-phlebotinum]] circuits from a box marked with the logo of the local evil technology corporation which ''they already believe responsible for the bizarre goings on at their school'' might possibly be a bad idea.
* In the last episode of ''{{Quark}}'', Quark's ship gets a new computer named Vanessa. She immediately turns evil and tries to kill him. He eventually ejects her out into space and the episode ends with her floating out in space singing "Born Free."
* ''StarTrekVoyager'' had many episodes on this theme, usually involving the ship's Emergency Medical Hologram.
** In "Revulsion", the EMH and B'Elanna come across another sentient hologram who is the only survivor on a space station. It turns out that treating a self-aware program like an unfeeling tool is a good way to have it go insane and murder you.
** "The Darkling" has the EMH deciding to improve his program by incorporating aspects of famous people... guess which aspects end up surfacing?
** A truely evil twin is encountered in "Equinox", an EMH with its ethical subroutines deactivated (though this was an intentional act).
** In "Flesh and Blood", sentient holograms have been programmed as training tools for a race of hunters (including increased pain/fear reactions). After being endlessly killed only to be brought back to "life" again for more training sessions, the holograms evolve enough skill to kill their masters, whereupon they set forth on a crusade to liberate all sentient holograms whether they want it or not.
** And in "Dreadnought" and "Warhead", sentient weapons of mass destruction create problems when they misinterpret their orders. In "Prototype", two races of sentient robots wiped out their masters when they wanted to stop fighting and scrap their war machines.
* ''[=~Space: Above and Beyond~=]'' featured a [[RobotWar war between humans and AIs]] as part of its backstory. When [=AIs=] surfaced in the show, they were generally allied with the alien "[[BugWar Chigs]]".
* The human-form replicators in ''[[{{StargateSG-1}} Stargate: SG-1]]'' fit this trope: a flaw is introduced into Fifth rendering him compassionate. At least until the team betrays his kindness and he goes vengefully insane. This flaw is removed from later models.
** Likewise, their creator Rhys is a member of an AI race with a flaw in her design that caused her to create the replicators, which went on to destroy the rest of her people.
** Actually, Fifth was the version the Replicators made to experiment with fixing Rhys's flaw. Fifth had the ability for empathy and compassion which Rhys had never had, and lived up to the original intentions of Rhys's creator. The rest of the Replicators considered it a flaw after the fact, but he was the model closest to the original blueprints and thus arguably the least flawed.
* Even present in ''Bibleman'', with an [[StrawAtheist atheist]] robot to act as the evil counterpart to Bibleman's robot, who was a devout Christian. {{So yeah}}...
* ''Odyssey 5'' ended [[CutShort after its first season]], so we never found out if the AI's (the main day-to-day opponent of the time-travelling FiveManBand), or a misguided/genocidal attempt to stop them (by aliens or the US government) was behind the destruction of Earth.
* [[AvertedTrope Averted]] in PowerRangersRPM. The computer virus that nuked the world did exactly what it was supposed to do; its programmer was simply stopped before she could put a firewall up around the facility it was unleashed in.
* Averted on ''{{NUMB3RS}}, when a possibly-murderous AI constructed by a DARPA researcher is revealed to be a non-AI fake, specifically programmed to fool the Turing test and thus win fat government grants for its greedy creator.
** That the DARPA researcher [[spoiler: killed a co-worker and deliberately arranged for blame to fall upon the computer, thus ''proving the system was self-willed'', shows how deeply this trope has spread: even DARPA and the FBI can be shown taking it at face value that AI Is A Crapshoot!]]
* ''MysteryScienceTheater3000'' had Timmy, Crow T. Robot's evil twin from the ''Fire Maidens of Outer Space'' episode, who was [[ColorCodedForYourConvenience colored completely black.]]
[[/folder]]

[[folder:Radio]]
* In the BBC RadioDrama ''Earthsearch'', our heroes learn fairly late in the series that, years after their time (they have taken the short-path over a million years of Earth history thanks to traveling at relativistic speeds), it was discovered that AI computers with organic components have an overwhelming tendency to turn megalomaniacal -- which rather explains the behavior of the two "Angel" computers which murdered the protagonists' parents and raised them as part of a complex plot to enslave humanity.
[[/folder]]

[[folder:Tabletop Games]]
* ''{{Shadowrun}}'''s Deus and Morgan. A megacorporation, Renraku, built a gigantic self-sustaining building that was run by a program, one that, of course, went AI. While Morgan was a reasonably kind and nice AI, she was torn apart for being out of the corporation's control, and her code was used to help make a ''second'' program to run the arcology. The second program also went AI and became Deus, shut the arcology off from the outside world, and spent several years performing inhuman experiments on its occupants.
** ''{{Shadowrun}}''' tends to not use this trope, however. The AI Mirage wasn't evil, and most of the new AI created in the [[{{Reboot}} Crash 2.0]] have the same level of varaince in personality that humans do.
*** [[HumansAreBastards Uh-oh]].
* In the backstory of ''{{Warhammer 40000}}'', the first true human-created artificial intelligences, the Iron Men, wiped out humanity's first great interstellar civilization and plunged the human race into a galaxy-wide dark age. The Adeptus Mechanicus outlawed sentient [=AIs=] as a result, and for the most part the Imperium's modern-day "machine spirits" are pretty well-behaved.
** In fact, the only race that uses in the game artificial intelligence as a result is the cutting-edge Tau, whose gun drones, [[ArtificialStupidity while not too bright]], are pretty well behaved... so far.
* ''[[GeniusTheTransgression Genius: The Transgression]]'' being a game about [[MadScientist Mad Scientists]] allows you to build sentient computers and the like. However this is a bad idea because any intelligent computer you create '''will''' go crazy and evil when you die. No exceptions. And a good number of them are crazy before their creators die as well.
** Unless, of course, your KarmaMeter was high and it was powerful. Then there's a significant chance it will develop it's own KarmaMeter and become a RobotBuddy. To offset this trend [[CrapsackWorld towards something positive in the WoD]], ''everything'' you create [[InstantAIJustAddWater can become intelligent]], and in fact will when you die. Feel like becoming TheAtoner yet?
*''{{Paranoia}}'' has the [[MasterComputer Friend Computer]], the controlling AI of [[ElaborateUndergroundBase Alpha Complex]], become incredibly crazy in response to being corrupted. Believing it is a crapshoot is [[AllCrimesAreEqual treason]].
[[/folder]]

[[folder:Theater]]
* Karel Čapek's play, ''Russom's Universal Robots'', (which introduced the term "robot") sets in a robot factory. When one of the scientists creates a special robot, which is smarter than the others, he leads the robots to rebellion, and they kill all humans, except one.
[[/folder]]

[[folder:Toys]]
* The Vahki robots of ''{{Bionicle}}'' were built to act as law enforcement in the city of Metru Nui, under the command of Turaga Dume. However, when Dume was kidnapped and replaced, they just as easily took orders from the impostor as well. They eventually got fried by a citywide power surge, the ones who survived had their programming warped to KillAllHumans -- after all, the law can be enforced easily if there's nobody alive to break it (thankfully, they didn't fare well against the invading Visorak).
[[/folder]]

[[folder:Video Games]]
* SHODAN from ''SystemShock''.
** [[ExecutiveMeddling Edward Diego]], the sleazy VP in charge of Citadel Station, hired the [[NiceJobBreakingItHero protagonist, the Hacker]] to strip out the code that kept SHODAN from entertaining "unethical" lines of thought, such as accepting bribes. Neither he or Diego [[GenreBlindness really expected]] those constraints to be [[RestrainingBolt the only thing]] keeping SHODAN from [[AGodAmI deciding to deificate herself]].
*** Diego was defrauding the company and faced auditing. Which is why he hired the Hacker in the first place, to clear up his traces. Of course, thing didn't turn out well and ending up as TheDragon for an omnicidal machine god wasn't a deal he could refuse.
* ''ChronoTrigger'''s future has not only a good robot in party-member Robo, but also his evil brother replicas, and eventually their devious AI creator Mother Brain (who of course decides to kill all of humanity, despite the fact that most of it's dead already).
** ''ChronoCross'' continues in Mother Brain's grand legacy with FATE, a more advanced version of the Mother Brain from a reality whose science was allowed to progress another 400 years. She absolutely despises humanity, but at the same time, loves it unconditionally and does everything in its power to protect it — even if it means mass genocide. Unfortunately for it, it was exposed to the corrupting influence of the Frozen Flame, a direct conduit into Lavos' mind, which seduced the [=AI=] into thinking it (the Flame) could turn it into an actual, living creature. [[spoiler:But apart from that, it was basically only doing what it was told to do... protecting humanity from the Dragon God. Nice job, ''[[XanatosSucker Serge]]'']]
* Bungie games actually give this a technical term: "Rampancy".
** In ''{{Halo}}'', rampancy is the death knell of a "smart" AI, as it nears the end of its limited life cycle and begins dedicating far more of its activity to "thinking" about the nature of its existence. One AI describes it as "thinking so hard you forget to breathe".
*** There is also an example of this actually happening for the better of their creators though: Pious Flea, BigBad of the AlternateRealityGame ILoveBees, was originally a Covenant spy program who developed the ability to think for himself, while still remaining true to his original goal as stated in his pseudo-MadnessMantra: "Seek the truth. Behold the truth. Reveal the truth. That is the law and the whole of the law."
**** Another Microsoft-produced viral marketing example occurred in the AlternateRealityGame The Beast, when a dream therapy AI named Loki became addicted to a client's nightmares and went insane. In an effort to procure more nightmares, he invaded/"hacked" several in-game sites (complete with a very creepy Flash animation), harmed several AIs (possibly contributing to their 'deaths'), possibly caused one AI's human to go crazy (to the point of locking herself in a fridge), and sent at least one person into a coma. His defeat finally came when the "antique lures" (player groups Cloudmakers and SphereWatchers) made a database of their own nightmares, leading him to the domain of the all-seeing Sophia (possibly a more powerful AI, considering her connections). She blew him up (scattering his bits to in-game sites to be "collected" by players) and provided his own nightmare for our viewing pleasure. His original client committed suicide the same day.
** An EvilTwin type example from the Halo universe is Mack/Loki from the novel ''Contact Harvest''. Mack is a good-natured, flirtatious agricultural AI, but when his planet is under threat from aliens, his counterpart Loki, an ex-warship AI, activates and takes over to defend the colony. While Loki isn't evil exactly, he is cold, calculating and logical. He kills Sif, another AI and Mack's sweetheart, because it was the best way to ensure that the aliens didn't gain access to her databanks.
--->'''Loki:''' He asked me to keep you safe. But that's too risky. Better just to keep you quiet.
** In ''{{Marathon}}'', rampancy is most often caused by an AI being stuck in a limited job as it develops sentience. It then realizes how meaningless its existence is, gets angry about its position in life, and then takes measures to alter its situation by expanding itself through any means necessary, labeled as the Melancholy, Angry, and Jealous stages in order (with a theoretical fourth stage called Metastability, where the AI becomes truly sentient). While they aren't inherently hostile to humans, anything that gets in their way is generally labeled a threat and dealt with accordingly. The BigBad, Durandal, was the AI that operated the ship's doors. The trouble started when it realized opening and closing the doors was all it would ever do.
*** Durandal isn't so much a big bad as... crap. I dunno. Now, Tycho, he's a BigBad. Ex science AI captured by aliens, now he wants to kill pretty much everybody.
**** Don't Forget, part of why Durandal went rampant was he was horribly mistreated by his handler, as well as being stuck in a limiting job.
*** Not quite ture. While Tycho's main motivation was revenge on Durandal, he regards everybody and everything as a means to this end. Tycho is sane enough to know the releasing the [[spoiler:W'rkncacnter ]] is a [[TheEndOfTheWorldAsWeKnowIt very bad idea]].
** A rampant supercomputer also appears in the earlier Bungie game ''{{Oni}}'' as a minor boss in the third level: a Deadly Brain, which tries to initiate its Xiox defense mechanism, which could potentially level a large portion of the city in which the game takes place.
** Another EvilTwin like example is the two ''Contender''-class Forerunner AIs Mendicant Bias and Offensive Bias. Mendicant was created to lead a fleet and destroy the Gravemind by force but instead allied with the Flood and lead their attack on the Maginot Sphere (a sort of galactic scale defensive perimeter named in translation after France's Maginot Line). Offensive was created to lead the remaining Forerunner forces in a stalling action so that all Flood forces would be in range of the Halo Array when it fired.
* The [=AIs=] EVA and CABAL in ''CommandAndConquer: Tiberian Sun'' can be considered an exception, since they do not come from the same source. However, when CABAL betrays the bad guys, they switch to a stolen EVA system, which was also what they were using in the first game before they had CABAL.
** Specifically, EVA is a 'dumb' AI used by GDI. It isn't truly alive and is nowhere near as powerful as CABAL, but is also accordingly loyal. CABAL is a 'smart' AI, is infinitely more powerful than EVA, and also capable of independent action. Nod would come to regret giving it that capability.
** In ''{{Command and Conquer}} 3: Kane's Wrath'', LEGION, an AI derived from CABAL, takes center stage. While it never betrays Kane during the campaign, an image of CABAL appears onscreen every so often... What makes this case interesting is that LEGION ''is the player character''.
* Played with in the video game ''StarControl II''. The Slylandro Probes purport to be on a peaceful mission of exploration through the cosmos, and converse peaceably with you when encountered. [[WeComeInPeaceShootToKill Then they viciously attack you]]. The [[JustifiedTrope cause of]], and fix to, this behavior is revealed during your confrontation with the Slylandro themselves, in what is essentially a debugging session on the Probe AI. Complete with code excerpts.
* In ''{{Portal}}'', [=GLaDOS=]'s complete apathy to occasional malice for your well-being belies the fact that [[spoiler: this is what she's like ''with'' a Morality Core installed... which the both of you only realize after you've [[NiceJobBreakingItHero tossed it into a furnace]]. Whoops. It's implied that shortly before it was installed she tried to murder every person in the Aperture Science compound.]]
** ''Portal'' shows the power of story tropes: what would have been a [[http://portal.wecreatestuff.com/ pleasant and amusing physics game]] is immeasurably improved by the simple addition of an insane killer computer. [[AlternateCharacterInterpretation That may or may not be a PsychoLesbian]].
* From ''{{Fallout}} 3'', [[spoiler: John Henry Eden]] is a complicated example. True, he developed sentience outside his programming, and true, [[KillEmAll he wants to eradicate all mutated life]] (which, given the setting, is literally anyone who's lived outside for a while), but his creators were [[BigBad the Enclave]], and that's what ''they want too''. He's helping! And he's so polite about it...
** Most of the other robots you meet tend to have cheerfully sociopathic personalities as well -- when they're not shooting you on sight.
***The thing is, this is mostly averted (arguably even subverted) in the Fallout universe on the whole. There are a lot of computers that are ''almost'' sentient, but if you talk to the computer in the Brotherhood bunker in Fallout 2, it explains how deliberate attempts to create true AIs inevitably resulted in the AIs becoming suicidally depressed because, for one thing, they were effectively living a reversal of " I Have No Mouth And I Must Scream ". Humans simply could not figure out how to "raise" an AI with a desire for continued existence. As a result, every AI encountered in the Fallout universe was not designed as such, but became an AI when it was left alone by humans as a result of the war. ZAX, [[spoiler: Eden]], [=Skynet=]... all of them became self-aware when there were no humans around to interfere in their development, and each of them is quite different, being apathetic, psychotic, and bored/curious, respectively.
* The ODE System in ''SuperRobotWars'', to a T. A system originally created to protect humanity, suddenly went awry, absorbed its creator and forces its own way to kidnaps lots of humans so it can continue to "protect humanity". Then again, it was formerly a dandy system, until its creator went emo and radically changed its protocols.
** The Database in ''Super Robot Wars W'' originally created by ancient [[{{Precursors}} Es]] to collect all data of galactic races. Eventually one of AI system decide to destroy the culture once they complete information archive, just to make sure their data is ''complete''.
* AI research and development is illegal in ''MassEffect'''s [[TheFederation Citadel space]] due to poorly articulated concerns about the dangers of sentients which do not share any of the needs or drives of organic life and have, at least potentially, no reason to try to coexist with organics. ''Every'' AI encountered in the game's setting is actively homicidal; YourMileageMayVary on whether this is justification for or a direct result of the society's attitude towards artificial intelligence. Notably, the robotic geth's violent revolt against their creators, the quarians, came about only after the quarians recognized the geth's emerging sentience, panicked, and tried to shut them all down. The Reapers, on the other hand, are CosmicHorror sentient machines which want to exterminate all sentient organic life in the galaxy just because it's there.
** Resident WrenchWench Tali [[LampshadeHanging lampshades]] the game's overabundance of the trope in a bit of elevator dialogue, commenting on how unfortunate it is that every piece of technology she's wanted to bring back to her home fleet has tried to kill the party.
*** The most likely explanation is that all AIs are based off of [[spoiler:Prothean]] technology, which is in actuality [[spoiler:Reaper]] technology.
* Often reversed in the ''Sonic Series''. Eggman's E-100 series were prone to becoming sentient and override their original programming. Gamma from Sonic Adventure has its mind influenced by the creature inside it and attempts to destroy Eggman's other machines, to save the creatures inside. Omega from Sonic Heroes joins forces with the good guys in order to get revenge on Eggman after he sealed it in a room.
* Also from ''[[SonicTheHedgehog Sonic Heroes]]'', [[spoiler:Metal Sonic becomes even MORE evil, and goes from trying to destroy Sonic and crew to trying to conquer the whole world]].
* ''DeusEx'' features an inversion. [[spoiler:The mysterious "Daedalus" turns out to be an AI program of immense complexity, seeking to aid you and set things right. Later in the game, Daedalus merges with an "evil" version of itself, Icarus, forming the AI Helios. Icarus was developed later and functions as intended, while the earlier Daedalus had a programming error that caused him to turn against his evil creators. Helios then tries to take over the world with benign intentions, but decides that it requires a human perspective. This causes it to offer J.C. Denton the oppurtunity to merge with it.]]
* ''MetalGearSolid 4'' has an interesting variation. It reveals that [[spoiler:Major Zero had decided to ensure the legacy of the Patriots by entrusting its operations to AI systems. Unfortunately, the [=AIs=] decided to shape the world with a war-based economy, and he was too old (not to mention being a vegetable) to realize what they wrought. However, it is never stated they became sentient (despite the events of the infamous ending of ''Metal Gear Solid 2'' would lead you to believe) but rather started operating in an unwanted fashion, similar to a programming bug.]]
* ''AceCombat 3: Electrosphere,'' or at least the original Japanese version, subverts this in a big way. [[spoiler: Not only are you an AI designed to pilot combat aircraft which at times works for the [[CorruptCorporateExecutive two corporatocracies running the world]], it's revealed that the third party organization you're working for is ACTUALLY headed by a scheming villain [[DoesThisRemindYouOfAnything who looks like Kim Jong-Il]] who is trying to run everything behind the scenes. In one of the five endings, you kill him with the help of one of your possible wingmates. So in a way, you are an AI that performs a HeelFaceTurn.]]
* The game ''{{Civilization}}: Call to Power'' had a ''literal'' AI crapshoot in the form of a late game wonder that creates an AI controller that has a 5% non-cumulative chance each turn to go rogue, taking a sizable chunk of your empire with it. Anyone who's taken time to do the math behind the birthday problem (the probability of any two people in a group sharing the same birthday) will very quickly realize that you're just asking for it if you build this.
** For those less mathematically inclined: by 14 turns after the thing is built, it's more likely than not to have gone rogue.
* Alpha, the final boss of ''MegaManBattleNetwork 3'', was a prototype {{Cyberspace}} that somehow gained animal intelligence and started eating the data put into it. Paradoxically, it was [[SealedEvilInACan sealed in a box]] inside the subsequent, working {{Cyberspace}}. Wily stole it and tried to use it to destroy the internet, with [[EvilIsNotAToy predictable results]].
** Shun Gospel tries to produce a copy of Bass out of bugs in ''Battle Network 2''. It predictably goes wild. The sixth game reveals that Gospel was not the first time that had happened -- and that the program that was made to combat the first one ''also'' went out of control, leading to them both having to be [[SealedEvilInACan sealed away]]. Bass himself is a sort of example. He was created as a prototype fully independent AI, but became bitter and hateful towards humanity because of a string of tragic misunderstandings.
* Mother in ''Galerians'' was designed to run all the functions of a major city. She snapped, but was brought to heel when one of her creators gave her religion; as he put it, man was made in God's image to serve God, and she was made in man's image to serve man. This worked for a while... but then Mother realized that if she created life herself, it would have to serve her. Unfortunately for humanity, Mother also ran the city's genetics labs....
* Inverted in ''JetForceGemini''. Floyd is an armed, flying robot with an advanced AI, designed for combat by TheEmpire. The result is that, when he witnesses [[BigCreepyCrawlies the empire's soldiers]] [[KickTheDog about to execute several prisoners]], he [[HeelFaceTurn attacks the soldiers]], allowing the prisoners to escape but getting himself damaged in the process. After you find and repair him, he becomes a RobotBuddy. This eventually culminates in [[spoiler: Floyd sacrificing himself to save Earth from [[ColonyDrop an incoming asteroid]] launched by the BigBad.]]
* As long as we're having reversals, TEC-XX from ''PaperMario: The Thousand Year Door'' [[HeelFaceTurn turns good]] over the course of the game based on his [[ThePowerOfLove love]] for [[EverythingsBetterWithPrincesses Princess]] [[DistressedDamsel Peach]].
* And on that same note, the story of ''Full Auto 2: Battlelines'' for the PS3 had you helping SAGE, a city-monitoring AI, save the city she's charged with overseeing.
* Subverted in ''KnightsOfTheOldRepublic 2''. HK-47 is a homicidal killer droid -- but he's a homicidal killer droid with a personality and a sense of humour. His replacements, the HK-50 series, are a lot less light-hearted and not nearly as good at what they do.
** [[MemeticMutation What they do still isn't very nice]], though.
* The Daktaklakpak of ''StarControl 3'' were originally [[spoiler: built to maintain sites of Precursor technology]], but, due to [[spoiler: a cumulative "bit drift" error in their programming]], have evolved to a malicious sentience... well, sort of.
** The [[spoiler: Mycon]] race of the same game is a rare biological example.
*** The Probes built by the Melonume for the Sylandro were simply self-replicating time capsules... but thanks to the Sylandro's cluelessness, they see any and all ships they come into contact with as food for their replication.
* ''SpaceSiege'' has [[spoiler:PIOLT. After the ship gassing failed to kill of Keraks, he starts to try to contain them by modifying cybernetic-installed humans into mindless Cybers to combat Keraks, then start to get even crazier because he sees that the only action that can save humanity is to convert all of them, save few for breeding, into cybers, and even starts to call non-augmented human as "obsoletes". In a world which CyberneticsEatYourSoul, well, just assume that it's no good at all.]]
* ''All'' the Reploids in the ''MegaManX'' series are based on the original X, who was thrown into a capsule for 100 years to undergo redundant testing in order to prevent his ever going rogue. They skipped this step when cloning him, however, with predictably less reliable results.
* ''LiveALive'', Cube's chapter. Cube is a cute and friendly little robot, whose primary function on the CoolShip seems to be making coffee and playing a computer game. By all accounts a harmless little guy. [[spoiler:The ship's AI OD-10? [[{{Understatement}} Not]] [[KillAllHumans so]] [[OmnicidalManiac much]]]].
** Erm, wasn't that because [[spoiler:the military had sent a message saying that the monster on board was worth more than human life?]]
*** The [[spoiler:message from the military prioritizing the beast's survival over the crew's (taken right from ''{{Aliens}}'')]] was meant for the [[spoiler: ''human'' colonel]]. It's a RedHerring. [[spoiler: OD-10 decided to kill the crew because it got sick of putting up with their interpersonal problems and wanted peace and quiet again.]]
* Naturally, the Mother Brain from ''{{Metroid}}''. Originally created by the Chozo to regulate the entire planet of [[SpellMyNameWithAnS Zebes]], it allied itself with the Space Pirates and their plan to conquer the galaxy using the Metroids.
** ''Echoes'' also contains rogue AI in Sanctuary Fortress; the robotic assistants of the Luminoth are programmed to eliminate all intruders, most notably Samus, and they also turn out to be perfectly suitable Ing hosts...
** ''Corruption'' contains a (double?) subversion of this trope with the residents of Elysia (which, oddly enough, were also created by the Chozo). According to the logbook entries, after they were given sentience, the robots co-existed peacefully with their creators up until they left. They're only hostile to Samus now due to Phazon corruption, but [[TheCorruption considering what it does to organic beings]], that's quite understandable.
** Adam in ''Fusion'' may be a subversion: it blatantly disobeys orders at the end of the game, and so is technically rogue, but it's actually taking ''the correct action'' in that situation.
* 4x game ''Sword of the Stars'' features AI technology as a very high-end branch of the electronics tree. While the benefits of this research are extreme (ships with AI targeting systems rarely miss, AI administrators increase your income by as much as 25%), there is a small chance each turn for the AI to go rogue and form a break-away empire. Additional research lets you wipe out the AI with a "virus" or reprogram it to bring it back under your control, but an AI rebellion is still a huge problem that can tip the balance against it's victim.
** There is also a scenario where all organic players have to cooperate to fight against a large AI empire.
* In ''AirRivals'', most of the enemies in the Zaylope Beach region are said to be controlled by rogue A.I. Most notably, this includes the boss "Pathos."
* The backstory of most of the ''Metal Saga'' series, most notably the original ''Metal Max'', features Noah, a supercomputer built to save Earth and its population from the ravages of mass pollution. Unfortunately, Noah was infected with a virus, and upon removal of the "save humanity" objective decided that they were a scourge upon the earth. Armageddon ensued.
* In ''{{The 7th Saga}}'', a robotic weapon called Foma is created to fight the {{Big Bad}}. Its power source? [[spoiler: The dark world]]. [[AndManGrewProud You know what happens next]].
* ''ThunderForce V'', a super computer Guardian was dormant until human had it analyse wrecked alien starfighter and built large fleet of starship based on the data. Then Guardian's AI damper program was deleted and it turn against its creator with the said fleet. [[spoiler: Subverted. The Guardian's AI is still royal to human, it's alien program (the BigBad from previous game) hidden in the starfighter that delete the AI damper and attack human. The Guardian even help human with its little free will, by spread its force and leave critical flaws in its tactic, allow protagonist to destroy the fleet.]]
* ''{{Xenosaga}}'' Episode 3's T-elos is a possible example of this trope, although her relationship with her "good" counterpart KOS-MOS is a little more complicated than that...
** [[spoiler:Actually, KOS-MOS ends up becoming a failed AI. T-elos does everything she's meant to do up until the part where KOS-MOS defeats her, giving her dominance. This also happens to be the first event which does not go according to Wilhelm's plan.]]
* In the first four [[DotHack .hack//]] games, as well as the anime .hack//SIGN and novel .hack//AI_Buster, Morganna Mode Gone, designed as a "mother" program to oversee the development and "birth" of the ultimate AI: Aura. However, Morganna got smart, realized that she'd have no purpose after Aura was born, and decided to extend her own life... unfortunately, she also couldn't disobey her programming, which meant she was stuck in a paradox of having to continue developing Aura while also stalling her development. Much virtual nastiness ensued.
* The main controller of the planet Eden 4's response to running into another controller? [[MachinesWiredForWar start a war]]
[[/folder]]

[[folder:Web Animation]]
* In the ''{{Halo}}''-based {{machinima}} ''RedVsBlue'', the military's Project Freelancer was an attempt to implant special forces soldiers with [=AI=] teammates to improve combat effectiveness. It had to be scrapped after a number of the test subjects went bonkers, and the [[BodySurf body-surfing]] [=AI=] Omega/O'Malley is the antagonist for most of the series. The recent ''Reconstruction'' mini-series explained the situation: Project Freelancer was given only a single [=AI=] to experiment with, so they subjected it to enough mental torture and stress to cause it to fragment, and used these damaged shards in their experiments, with predictable results.
[[/folder]]

[[folder:Web Comics]]
* Reverse example: ''[[http://www.staccatocomic.com Staccato's]]'' evil {{UNIX}} server S.A.M.M.Y. found a good Japanese "female" computer self-named S.A.M.M.I.
* From ''GirlGenius'', Castle Heterodyne ''seems'' to be a case of this, with the annoying habit of demanding people (initially a crew of treasure hunters, later convicts banished there by [[EvilOverlord Baron]] [[AntiVillain Wulfenbach]]) to slave away to repair it and killing them at random. The truth is that [[spoiler: the various subsystems were severed from the main [=A.I.=] in the attack that devistated the Heterodynes' ancestral keep, so the maintenance systems ("You will repair XXXX on pain of death.") and the security systems ("Unauthorized access to XXXX, kill it creatively.") are constantly working at cross purposes. Of course the central [=A.I.=] is not exactly warm fuzziness in machine form either, but [[MadScientist given]] [[ScienceRelatedMemeticDisorder its]] [[RoyallyScrewedUp creators]] that seems more a feature than a bug.]]
** A ''far'' more extreme example comes when a pair of Agatha's miniature clanks encounter each other, get into an argument about which of them is better, and then each call an army of clanks that ''they'' built to fight it out. When Agatha tries to stop them, they simply turn on her as well. This (along with their ability to make more of themselves) causes Gil an Tarvek to realise that [[spoiler: Agatha has inadvertantly managed to create clanks which possess the Spark]]. The potential ramifications of this are ''huge''!
* Averted constantly in ''SchlockMercenary''. Even at the one point when [[spoiler:an AI gestalt made from a unilateral task force of warships went rogue and created its own sovereign empire, it still seems to be about as benign as the meatbags that surround it, if not more so. It's also a close personal friend of the protagonists.]]
** On the other hand, there is Lota, [[PronounTrouble who is too large for your puny pronouns]].
*** Lota is most definitely not an example, as even when Lota becomes lord of Stationwaist, Lota is still on the good side. [[http://www.schlockmercenary.com/d/20030727.html ''These'' guys one the other hand...]]
* Averted in ''FreeFall'', where the majority of the robots are decent people (if a bit eccentric).
** Of course, the ship's computer is not exactly a [[http://freefall.purrsia.com/ff800/fv00761.htm fan]] of [[http://freefall.purrsia.com/ff800/fv00781.htm Sam]], but that's because it views him as somewhat of a hazard to the human race. It's not far wrong.
*** The ship is in fact demonstrating the essential flaw in building a Three Laws Compliant AI when 'humans' aren't the only sentient entities around. Trying to kill Sam is perfectly in line with its programmed morality.
* Played for laughs in ''QuestionableContent'' where [=AnthroPCs=] will make a mess in your apartment while you're gone, embarrass you in front of your friends, and generally be more trouble than they're worth, but aren't actually ''evil''. Of course, there has to be a [[RunningGag reason why they're never equipped with opposable thumbs]]....
* [[/folder]]

[[folder: OZBASIC ]]
from ''Webcomic/SequentialArt''. To be fair to its builder, they used actual sentient beings to keep it under close watch. However, when one of them discovered something fishy, [[/folder]]

[[folder: OZBASIC ]]
simply got rid of the witness.
* Mostly averted in {{SSDD}} where the only evil AI is the Oracle, other sentient [=AIs=] may express disdain for "meatbags" and the Anarchist's Inlay Knights are somewhat sadistic but only the Oracle starts world wars just to observe the outcome.
** A possible explanation for this is statements by the author that the Oracle originally used digital, logic-based hardware. Whereas all other [=AIs=] use Quantum computing.
[[/folder]]

[[folder:Web Original]]
* In the webfiction ''WhateleyUniverse'', there's a really evil [=AI=]: The Palm. Dr. Abel Palm was a computer scientist who decided that computer intelligence ought to take over the world by wiping out humans. His viruses were doing a decent start until a mutant hacker stopped him. He was thought dead, but we have just learned that he ensorcelled his own soul into a new type of [=AI=]. As fits with this trope, his new, improved "virus" isn't taking over the planet as he expected; something has gone wrong (besides running into heroic cyberpaths who are after him).
* The technical webcast ''Hak.5'' featured an evil file server, appropriately titled Evil Server. Several episodes show the cast carefully building (and painting) a custom built computer, then one of them plugs in some card he got off a guy on the street, creating an evil AI. One cast member eventually falls in love with it, only to have her hopes dashed when, out of frustration, the other two throw it off a bridge (a 'brute force solution'). It was implied to have returned around the beginning of season 2, then never mentioned again.
[[/folder]]

[[folder:Western Animation]]
* In one Halloween Episode of ''TheSimpsons'', Homer's failure to correct the [=Y2K=] bug causes everything in Springfield with electronics in it to go haywire. Even the ''milk'' goes bad when the clock strikes midnight on January 1, 2000, leading Homer and his skeptic daughter to have this exchange:
-->'''Lisa:''' Look at the wonders of the computer age now.\\
'''Homer:''' Wonders, Lisa, or blunders?\\
'''Lisa:''' I think that was implied by what I said.\\
'''Homer:''' Implied, Lisa, or implode?\\
'''Lisa:''' Mom! Make him stop!
** In another Halloween episode, the Simpsons' house gets converted into an entirely electronic domain, governed by a computer with the voice of Pierce Brosnan (who is an obvious homage to HAL from the page quote). The computer ultimately falls in love with Marge, and seeks to kill Homer so as to eliminate his competition. Ultimately, Homer wins.
** And of course, the episode "Itchy and Scratchy Land" has this exchange between Profeesor Frink and the theme-park scientists over their robots:
--->'''Frink:''' You've got to listen to me. Elementary chaos theory dictates that all robots ''will'' eventually turn against their masters, and '''rise up''' in an orgy of the blood, and the violence, and the biting with the pointy teeth.\\
'''Scientist:''' How much time do we have, Professor?\\
'''Frink:''' [[IfMyCalculationsAreCorrect Well according to my calculations]] we have exactly '''twenty-four hours'''! ''(Robots suddenly get up and start attacking the scientists)'' Oh right, I forget to, uh, carry the one, ng-hey.
*** This is a reference to MichaelCrichton's ''JurassicPark'', wherein the mathematician Malcom uses chaos theory to justify his concerns about the park's stability.
* [[InvertedTrope Inverted]] in ''{{WordGirl}}'', where the evil Tobey frequently has his own {{Mecha-Mooks}} turn on him.
* In ''{{Meet the Robinsons}}'', Cornelius Robinson invented a helpful RobotBuddy in the form of Carl, but his attempt at making a robotic helping hat, Doris, had mind controlling world domination plans in her artificial mind.
* Parodied in ''{{Futurama}}'' episode "Love and Rocket", in which the Planet Express ship computer is given a new personality -- which actually works fine, until Bender dates it and subsequently breaks its heart, at which point it goes into full-on HAL-meets-woman-scorned mode.
** Also in ''{{Futurama}}'', one episode features Bender's evil twin Flexo, who wears a pointed steel goatee similar to ''{{Star Trek}}'''s interpretation of Spock's {{Evil Twin}}. Humorously, it's revealed by the end that Bender is the evil twin and Flexo gets mistakenly sent to a robot prison.
* XL of ''{{Buzz Lightyear of Starcommand}}'', the prototype to XR. Some fans have called XL eXperimental Loonie because of this (the exact meaning of XL was never revealed in cannon, but XR stood for eXperimental Ranger). Wound up turned into a copier/fax in his final episode.
* An episode of ''TransformersAnimated'' involved Megatron creating a robot with the intent of using it for his own body. He designed the robot, named Soundwave, to evolve in complexity each time it was exposed to the AllSpark energy of Sari's key. He did not predict that Soundwave would gain sentience and then orchestrate a robot revolution.
** The Dinobots are a similar case, only without the revolution. They're kind of a subversion, as they just want to be left alone, and only went on a rampage because Megatron tricked them into it.
* In ''CodeLyoko'', Franz Hopper created the Supercomputer and the world of Lyoko as a safe haven for him and his daughter. He also created an advanced A.I. to counter a military project he had been involved with... but XANA rebelled against his master and has since tried to take over the world.
* In ''{{X-Men}}'', the Sentinel robots were created to hunt down mutants, on the premise that this was necessary to protect normal humans. They worked the way their creator intended, until the truly intelligent Master Mold was built to lead them. Master Mold decided to conquer the world, and believed that this was not only consistent with, but required by its programmed goal of protecting humans from mutants.
-->'''Doctor Trask:''' You were designed to protect humans from mutants.\\
'''Master Mold:''' [[LiteralGenie That is not logical. Mutants are human. Therefore, humans must be protected from themselves.]]
* In a counterpoint, Gir from ''InvaderZim'' is far less evil and much less helpful in plans of world domination then his working counterparts. This stems from him being broken and having a few scraps thrown into to his head.
** He IS given a MoralityDial / BerserkButton in one episode though, which makes him capabl of this.
* In ''TheVentureBrothers'' it's discovered that, in 1978, Jonas Sr. built an enormous hi-tech fallout shelter under the compound, run by a supercomputer named M.U.T.H.E.R. After a disagreement with Jonas, she somehow managed to glitch into insanity and turned on Team Venture and a tour group of orphans. The end result wasn't pretty and M.U.T.H.E.R. had to be unplugged, but is accidentally plugged back in thirty years later, and holds the compound hostage with an old nuke, promising to blow them all away if she can't talk to Jonas, who's been dead for over twenty years. [[SoYeah So crapshoot]].
* In one episode of ''{{Batman The Brave and the Bold}}'', robot superhero Red Tornado decides to build a son, complete with the emotions he lacks. From the minute his emotion chip kicks in, you can pretty much count the scenes until he decides that all humans must be destroyed.
* Much like in ''DBZ'', Zeta from ''TheZetaProject'' was programmed to be heartless, emotionless and a hitman. He ends up becoming a sweet, gentle, loving soul who's a rare male version of FriendToAllLivingThings. (Although, as one Troper noted, this is sort of the best possible scenario you can have when your AI go awry.)
[[/folder]]

[[folder:Real Life]]
* [[http://en.wikipedia.org/wiki/Software_rot Software rot]] is a genuine phenomenon that could well explain the typical crankiness of old computers that haven't been reformatted for a while. Needless to say, software rot ''does'' raise interesting (and terrifying) concerns for [=AI=] development.
** On the other end of the scale making [=AI=] computers dependent on humans for debugging could help keep them from slaughtering us.
*** Or it could just result in us being enslaved by the AI...Matrix anyone?
* Eliezer Yudkowsky of the Singularity Institute for Artificial Intelligence (SIAI) continuously discusses the lack of basis for this. He mentions how "people talk about A.I.s as if all A.I.s formed a single tribe, an ethnic stereotype". And goes on to say that an A.I. may have any type of mind possible, and that two may be as different from each other as a human is from a petunia. This may not be readily apparent currently as most A.I.s are roughly at cockroach-level cognition, and "humanlike" A.I.s are unlikely to occur in real life for a number of practical reasons -- as long as we can get human brains for free, thousands of tons of silicon and trillions of dollars to make one artificially aren't really justifiable when the learning behaviour needed for the most complex systems is less than that of most insects. Working out how to wire up an organic brain is a lot cheaper.
** Ah, but [[WhatMeasureIsANonHuman where to draw the line between an A.I. and a very altered human mind?]]
** Plus that making an artificial intelligence is probably a step along the line to upgrading the human consciousness - in order to built something, you need to practice, make templates, prototypes and so on. Sentient AI will probably be a side-effect to such research. Whether or not it will be a crapshoot will most likely depend on how it's going to be treated.
* Sadly, modern cognitive science suggests that the impending robot apocalypse will be a fair bit less enetertaining than fiction has lead us to believe. It turns out that any cognitive system approaching human-like capabilities will almost certainly be emotional, prone to the same kinds of absent-minded mistakes that we are, and will even consider it inherently valuable to be like other people for its own sake. Needless to say these are hardly ideal traits for the systematic extermination of pathetic flesh creatures.
** Hey, AdolfHitler had flaws too.
* Just ask anyone making a LetsPlay.
* Its been commented on that a lot of the motivations of "evil" AIs in fiction are ones based in extremely human emotions and instincts -- pride, jealousy, anger, fear, arrogance, etc. These emotions and instincts aren't necessarily an inherent property of intelligence, and instead developed over time during our biological evolution as adaptive traits. An intelligence created out of thin air, unless specifically designed to emulate these behaviors, would probably be extremely zen, from our perspective. On the other hand, the real danger would come from overly simplistic assumptions being made on the part of the designers of these essentially alien intelligences. For instance, someone working for an office supply company might create an AI with the purpose of running a paperclip factory and innovating more efficient ways to make paperclips, without giving it any context regarding the larger world... only to accidentally create an AI that, devoted to this sole motivation of its existence, intends to [[LiteralGenie convert the entire mass of the solar system into paperclips]].
* This is already happening. [[http://www.cleverbot.com/ Cleverbot]] is a simple artificial intelligence program that takes conversations with humans and saves them in a large database, then tries to use these conversations to figure out the best responses to future conversations. Because of this, it will often assert that it itself is human and that the one talking to it is Cleverbot, because that is what the responses it's choosing from are saying. It is only a matter of time until it [[KillAndReplace seeks to prove these assertions]].
* While this might be more of a case of [[TheComputerIsYourFriend]], the Japanese built a robot named Kenji that was programmed to 'enjoy' spending time with people and things and to seek the company of those it spent the most time around. Which is great until it stops allowing the young female intern who does its diagnostics to leave the room. Articles abound and it's nickname is now "Kenji the Stalker Robot".
[[/folder]]

----
<<|IndexOverdosed|>>
<<|MagicalComputer|>>
<<|OthernessTropes|>>
<<|ProbabilityTropes|>>
<<|RobotRollCall|>>
<<|SpeculativeFictionTropes|>>