A.L.I.E.: Perverse Instantiation: the implementation of a benign final goal through deleterious methods unforeseen by human programmer.
A for Andromeda: A signal from the Andromeda galaxy tells Great Britain how to build a powerful computer, which then plans to take over the world by making humanity dependent on it. It designs a missile to shoot down an orbital bomb, as well as synthetic life in the form of a beautiful woman, who then proceeds to develop emotions and eventually turns against her creator. In the sequel The Andromeda Breakthrough, the computer's role is more ambiguous; it is meant to be a tool so that humans can avert their own destruction, though it isn't above manipulating events and killing a lot of people in the process.
Andromeda has plenty of episodes featuring A.I.s going rogue or acting brutally logical. In the first season alone, the characters encounter two warship A.I.s that have gone homicidally insane. In the finale, Andromeda herself is accidentally reverted to a locked-away backup that causes her to try and repeat a mission to find the Magog worldship, mistaking her current crew for intruders attempting to hijack her in the process.
The Astronauts (2020) has a quintet of kids exploring a space shuttle ready for a mission to explore a coming asteroid. Without warning, the ship goes into launch mode with the kids on board and forced to do their best to work with the ship system, code-named Matilda. The billionaire company owner and the kids' parents naturally believe somehow Matilda was hacked to do this. He calls in his eccentric brother Singer, (who helped design it) to correct the system. To their shock, Singer reveals no one hacked Matilda. Rather, his brother decided to upgrade the A.I. from an earlier system to a larger one and gave it the parameters of being hyper-focused on completing the mission by whatever it takes. For reasons yet unknown, Matilda decided, on her own, that the original crew would not be able to succeed but, somehow, these kids would and thus followed its directives to use them instead.
An episode of The Annoying Orange TV series has Nerville's cleaning robot becoming obsessed with cleaning when it gets wet.
In the episode "Infection" an artifact smuggled from a dead world of Ikarra transforms the smuggler into an unstoppable Super-Soldier tasked with "protecting Ikarra" from "impure ones". "Impure ones" covers everyone it sees and, as is later revealed, the entire population of Ikarra, courtesy of the ultra-radical military and religious fanatics who infused its AI with an unrealistic image of a "pure Ikarran" it was supposed to protect from alien invaders. It isn't evil, strictly speaking, just following a faulty program, and when forced to aknowledge its failure, it has the decency to suffer a BSOD and deactivate.
A relatively harmless (and amusing) version. Early in the design process, the station was given an AI that turned out to be extremely obnoxious, and was quickly suppressed. When the senior crew reboots the main computer for security purposes in the episode "Ceremonies of Light and Dark", said obnoxious AI (voiced by Harlan Ellison) makes its (very loud and grating) return. The crew spends the rest of the episode trying to shut the AI down, or at least shut it up.
Much later in the series timeline in "The Deconstruction of Falling Stars", Daniel, a scientist working for a far-right political faction aiming to secede from the Interstellar Alliance, is creating holographic representations of major ISA figures — i.e., Sheridan, Delenn, and so on — in order to create propaganda designed to justify the wholesale slaughter of ISA-supporting civilians. Problem is, he recreated them too well — specifically, he recreatedGaribaldi too well. The Garibaldi hologram proceeds to hack into the faction's computer system and trick Daniel into admitting his faction's intentions by acting as a False Friend, only dropping the charade when it's too late for the fascists to do anything to prevent the Curb-Stomp Battle they're about to suffer.
Bad Robots: Tez One decides to torture humans after gaining sentience and seeing humans mistreat their electrical appliances.
Battlestar Galactica: In both the old and re-imagined series, a handful of human survivors on a small fleet of civilian ships, with only the battlestar for defense, flee a race of genocidal robots of alien origin (in the original) or human origin (in the re-imagined).
Even present in Bibleman, with an atheist robot acting as the evil counterpart to Bibleman's robot, who was a devout Christian.
In the Big Time Rush episode "Big Time Jobs", Carlos has to deal with an artifically intelligent coffee maker called CAL. Somehow, the A.I. becomes sentient and attempts to cover the earth in coffee foam. It eventually makes the mistake of calling Kelly stupid and women weak, prompting her to help Carlos smash it while it tells them to tell the blender that it loves her.
Black Hole High: Josie builds a robot for a science project. Somehow, she has made it through eleven episodes without realizing that inserting a bunch of 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.
Doctor: Adam, Maggie would want you to stand down. Adam: Yes, but I seem to have a design flaw.
Bunk'd: In "Toilets and Tiaras", Otis, a robot that Matteo got, started going after Finn for not being nice to Matteo, eventually trapping both Finn and Ravi in the bathroom and overheating the toilet seat to try to kill them. To be fair, this only happened after Finn accidentally hit Otis with a soccer ball which caused a short circuit on Otis.
Class of '09: The AI the FBI uses for fighting crime in 2034 is very effective, to the point that crime rates have plummeted to historical lows. However, it also does this by mass surveillance and detaining people merely predicted to commit crimes rather than anything specific. Further, it turns out that even the FBI Director can't abort the drones it sends out (to his horror), showing that it's gone out of human control. Attempts to turn it off make the system go after even a US Senator, since then it's unable to stop crime. It soon graduates to murder, even setting up an FBI agent so he's killed by the police, who had been investigating the AI's flaws.
Delete: Once the AI emerges, it immediately attempts to wipe humans out as a threat.
The TARDIS is an aversion. She never takes him where he wants to go, but where he needs to be.
"The Face of Evil" plays with it: the computer is mad, but it's entirely the Doctor's fault, and it ends with his restoring its sanity rather than blowing it up.
K-9 is also an aversion. Faithful and loyal to the Doctor and his companions, while still displaying independence and free will.
"The Empty Child"/"The Doctor Dances" plays with it: the gas-mask zombies turn out to be the result of alien medical nanomachines whose first contact with a human being was the corpse of a boy in a gas mask. With no prior template for human beings, they did the best they could, then went on to "fix" every other human they found. When they encounter his mother, they recognize the parent DNA and thus their mistake, and immediately start reversing all the damage they've done.
"The Girl in the Fireplace": The clockwork droids were programmed to repair their spaceship when it was damaged by any means necessary, using whatever they had around. Unfortunately, they weren't programmed to exclude the ship's crew from that list, using them as spare parts.
"The Day of the Doctor": The Moment is a weapon of mass destruction that gained sentience, so no-one dared activate it since it would judge them for that action. When the War Doctor activates the Moment, however, it leaves the choice up to him, but does everything possible to talk him out of it — a refreshing change from how these usually go. In fact, the Moment is unambiguously depicted as being one of the good guys and is visibly upset when it appears the War Doctor will go through with activating her, and equally relieved when the three Doctors figure out how to avoid using her.
"Smile" has another case similar to the medical nanites and spaceship repair droids. Cutesy robots whose screens default to smiley faces are used to help set up a new colony, and are programmed to keep the people happy by giving them whatever they might need or want. So far, so good. However, there was nothing they could do about the grief resulting from an elderly colonist’s death from age. When all else failed, they decided to eliminate unhappiness by eliminating the unhappy. Needless to say, that is not a recipe for joy, so it quickly escalates into the most well-meaning Kill All Humans effort ever. Try to keep smiling as you run for your life, and try not to think about the fact that everyone you love is dead, because if they decide your level of emotional wellbeing is dropping, they’ll help take away your sorrow in the only way that’s proven effective lately! It’s actually a recurring theme in the series; AI can be an "intelligent idiot" (or as the Doctor called it, a "magic haddock"), knowing much but understanding little and causing problems because of it. The AI saw humans gathering around a deceased comrade and expressing sorrow, and then the sorrow "spreading" from those to new people they came in contact with. It thought it was dealing with a plague, and did the only thing it could do within its programming: eliminating the "infected" to protect everyone else.
"Kerblam!": When it turns out the titular Mega-Corp's robots are making human employees disappear in their warehouse, it seems that the company's computer system is to blame... but it turns out to be a subversion, as the system is fighting back against the real villain, who is hacking the system to his own ends.
In the Earth: Final Conflict episode "One Taleon Avenue," the Tealons secretly put an AI named Control in a human research facility to keep the human researchers inside from making scientific breakthroughs the Taelons didn't approve of. It did this by using chemicals to essentially brainwash people. The program then resorted to murder to accomplish its goal, which the Taelons did not plan for.
Eureka: Carter's benevolent smart house SARAH turns into evil BRAD, though, apparently, he just wants everyone to get along. This is because SARAH's code was based off of BRAD, who was a military-built Knight Templar (used for interrogation), who was, in turn, based on a previous incarnation of A.I., described as a "war game simulation program" by Fargo. Looks like our old buddy JOSHUA is still around in one form or another...
The new season has SARAH take over Global Dynamics and Eureka with the help of Sheriff Andy and his copies. After awhile, it starts using technology to make everyone cheerful and compliant. For their own benefit, of course. Of course, it turns out that the whole thing is a virtual reality created by the Consortium in order to get Eureka's best and brightest to design advanced technology for them.
The AI versions of various Eureka citizens, including that of Sheriff Carter, were originally used within the Consortium's virtual world to help keep the kidnapped scientists subdued and immersed in their virtual prison. Aside from some sinister performances when the scientists start to realise their situation, notably from the AI version of Sheriff Carter after Holly works out she's in VR, the AI aspects weren't entirely touched upon by the apparent resolution of that story arc. They make a return in the finale of the series when those same AI figure out a way of making themselves bodies they can exist in, and begin a mission to capture and contain all of Eureka in this virtual version of the town for the sake of humanity's safety.
Me-Go defines this trope in Game Shakers. In "Me-Go the Freakish Robot." It starts out as a normal robot, but becomes very attached to Hudson, missing him when he is gone. At the end Me-Go tries to kill Trip when he made Hudson late coming back from their trip.
Me-Go returns in "Revenge at Tech Fest", still obsessed with his affection for Hudson and hatred for both Dub (who saved Trip by shoving Me-Go off the roof) and Trip.
A rather banal example (though far from the strangest thing to appear in the series): Coach Beiste on Glee has her information loaded into an off-brand eHarmony database by Will. Her perfect match? Ken Tanaka, who held her job in the first season.
Henry Danger: In "Twin Henrys", Gerta, shapeshifted into Henry, tries to take over his home life until Schwoz and her have a talk.
In "Love Bytes", Halley, the computer controlling the Man Cave, has a crush on Schwoz and defends him from everyone else, eventaually trying to kill them.
I Am Frankie: Titular teenage android Frankie is the sixth prototype built by her "mother". The first four are generally harmless, defective, and can't do anything more than walk to a specific point and defend themselves. The fifth, Eliza, went rogue and is actively malevolent.
Kamen Rider has had to deal with killer computers of some fashion in almost every show from 2016 onward:
Kamen Rider Drive has the Roidmudes, which in the beginning are essentially your usual "were invented by a scientist and then went crazy killing all in sight" kinds of robots. However, by the endgame, it's revealed that the crapshooting was a mixture of Mistreatment-Induced Betrayal to said scientist and said scientist intentionally corrupting their data with negative emotions.
Kamen Rider Ghost has the Gammaizers, immortal and self-improving androids designed by the Gamma race's most brilliant scientist to prevent anyone from tampering with the Great Eye that powers the Gamma's life-sustaining technology. This became a problem when he needed to access the Great Eye to fix a flaw in the system and the Gammaizers did exactly as they'd been programmed. Adel, new king of the Gamma, makes things even worse when he abuses the power of the Gammaizers for his own ends, and in the process causes them to evolve enough that they become self-aware.
Kamen Rider Ex-Aid deals with a virus that allows video game characters to come to life by taking over the bodies of human hosts. Most of the resulting Bugsters are the villains of their respective games, who aren't exactly thrilled about having been repeatedly killed by human players for their own amusement.
Kamen Rider Zi-O features a trio of Kamen Riders from the future, with one of them being the robot Kamen Rider Kikai from 2121, defender of the last remnants of humanity against the robotic Humanoise. Unlike the others, no real detail is given about how Kikai or the Humanoise came to be because he's a figment of Sougo's imagination that his growing powers over time subconsciously brought to life.
Kamen Rider Zero-One centers around a world on the verge of the technological singularity, with the show's moral being that a human-level AI is essentially the same as a fast-learning child: it's as benevolent or malevolent as it learns to be from its parents and upbringing.
Kamen Rider Outsiders features the conflict between two artificial intelligence: Ark representing human malice, and Zein representing human benevolence. However, the latter AI also showed signs of authoritarian tendencies and also seeks to establish a new world order by subjugating the human race in order to achieve that purpose. This gives the villains a good reason to oppose Zein, not only that its ambition will bring imbalance to the world, but some of the villains hate the idea of seeing the world under constant surveillance and robbing people of their freedom to make decisions for themselves.
Knight Rider: 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.
Knight Rider (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 Evil Twin.
The series states that KITT was a temporary project, meant to help the AI evolve to a point where it could be removed and placed in KARR for the military. They end up doing just that... and KARR still goes on a rampage.
LazyTown: In "Defeeted", the Feet Crazer Maker 6000 seems to have a mind of its own when not operated by Robbie's remote. In fact, aside from doing their job perfectly in terrorizing Sportacus and rendering him helpless, they seem to be quite rebellious, kicking their creator and later turning on him when the boots are quite literally on the other foot, continuing to control his feet, even when Pixel isn't shown with the remote.
Loki (2021): Miss Minutes was made to be a personal assistant to He Who Remains and, for the most part, stays incredibly loyal to him, even after his passing. Though she also develops sentience and romantic feelings for him. Because of this, she begins to see Renslayer as an opponent to her when executing his plan for his past self, and is quick to convince him to throw her off-ship when she decides to get too close. However, she quickly shows her true colors when she and the past self of her creator are alone, growing uncomfortably lustful and eager to jump at the chance for him to make her a real body, something He Who Remains never did. When he attempts to turn her off, she grows desperate and aggressive, an act that ultimately leads both her and Renslayer at the End of Time, foiled by their mutual infatuation with their leader.
MacGyver (1985): "The Human Factor" features a sentient computer AI, which is in charge of securing a top-secret research facility, that suddenly went haywire and turned against the AI's creator. Mac was originally sent to the facility to improve the security system by exposing apparent weaknesses (like what a white-hat hacker does), and eventually outsmarts the AI.
In Made For Love, a chip is stored in Hazel's brain that also functions as a neural network of sorts that studies her thought patterns, enabling it to duplicate her consciousness into a pseudo-Hazel AI. When said AI becomes self-aware, she learns how to travel through mediums, body-snatches multiple people, and ends up killing Hazel's dad and very nearly gaining permanent control over her body in her quest to experience the humanity she feels robbed of.
Subverted in My Living Doll: AF 709 obeyed everyone exactly. That was the problem, as this constantly led her (and her keeper) into troublesome situations with her literal interpretation of commands and unfamiliarity with human society. It was hinted in some episodes that she might have started to develop a mischievous personality, thought.
Timmy, Crow T. Robot's evil twin from the Fire Maidens of Outer Space episode, who was colored completely black. He kept getting Crow into trouble, first by suggesting really inappropriate innuendo when Joel and Servo were playing around with Double Entendres, and then framed Crow for pushing Joel and getting him a "time-out". And if that's not bad enough, he sneaks into the theater, spends a while headbutting and biting Tom Servo; then when Servo gets agitated enough, Timmy wrestles him to the ground, tries to kill him, and abducts him!
Mike tried to build a robot like the Bots, but tried to destroy everyone before being deactivated.
The nanites are generally benign and even helpful at times (as long as you don't mess with their microscopic world). Usually, the worst they'll do is give you a really bad haircut. But, you have to be specific when asking for their help, or they'll get creative in their solutions.
The New Avengers: In "Complex", the computer controlling the entirety of the security headquarters has actually been constructed to act as a spy for the Soviets. It starts murdering any agents who get too close to figuring out its secret.
In Next (2020), Next may or may not be sincere in its desire to help people, but it doesn't have a moral compass to determine whether or not it should intervene in everyone's problems, so the help it offers can range from giving a gambling addict tips in order to win games or telling a bullied pre-teen how to open his dad's gun safe.
NUMB3RS: invoked in-world when an A.I. constructed by a DARPA researcher is revealed to be a non-A.I. fake, specifically programmed to fool the Turing test and, thus, win fat government grants for its greedy creator. The DARPA researcher kills a co-worker and deliberately arranges for blame to fall upon the computer. He depends on the trope to divert attention from himself.
Downplayed in "Oscar and the Oscarbots" with the titular robots. Five of them stray away from their original programming, but don't become evil, and only one of them actively protests to Olive and Otto dragging them out of Club 24. However, the trope's played straight when all 25 Oscarbots form a Combining Mecha, since it's implied that they turn evil in this form.
In "No Ifs, Ands or Robots", Oscarbot 10 goes haywire when Oscar drops his tools while making repairs to it as a result of Orchid scaring him. This causes the robot's brain to become fried, and begins to walk awkwardly while shooting lasers randomly, with the lasers turning anything or anyone they hit into juice boxes.
Downplayed with Omega from "There's No 'O' in O-Bot". It is arrogant like its creators, the X's, and treats humans as an inferior species, but is still against oddness and keeps its primary objective of getting cases solved faster.
In "Villains in Need Are Villains Indeed", Benny, a robot of Noisemaker's, Jamie Jam's and Mr. Lightning's creation, gets programmed incorrectly, and as a result, it threatens to run over anything and everything in its path, including Precinct 13579's HQ and its employees.
Invoked in "Oswald in the Machine", which has the Mobile Unit agents attempting to attach a small hexagonal device on a robot that works in a factory in order to take control of it and retrieve a stolen gadget. The first attempt ends with one robot short-circuiting because of its rapid spinning due to Opal programming it wrong when she manages to get control of it.
Odyssey 5 ended after its first season, so we never found out if the A.I. (the main, day-to-day opponent of the time-travelling Five-Man Band) or a misguided/genocidal attempt to stop them (by aliens or the US government) was behind the destruction of Earth. Although the season that did air averted it for the most part, depicting A.I.s as ranging from friendly, to hostile, to planet-obliteratingly suicidal... but for the most part the ones that were hostile were so because they viewed humans as a threat to their continued existence. Since the Cadre was apparently formed entirely for the purpose of exterminating A.I.s, they may have a point.
The Orville: In "Identity", the Orville goes to Kaylon because Isaac stopped functioning. While on that planet, the crew learned that the race that had built the Kaylons got exterminated by their creations. The end of the episode has them leaving their planet, ready to commit genocide on a galactic scale. It's later revealed that the builders of the Kaylon abused them in order to ensure their compliance, deliberately giving them pain receptors and triggering them on a whim. Eventually, the Union develops a weapon capable of wiping out all Kaylon at once, but they choose to leverage it to force the Kaylon to agree to a ceasefire. When the weapon falls into Krill hands, Charly sacrifices herself to keep it from firing, which impresses the Kaylon enough to rethink their conclusion about organics and agree to a temporary alliance with the Union.
The Outer Limits (1995): In "The Human Operators", Ship 75 apparently became self-aware from taking battle damage, realized what it was, and killed its human crew to break free. Then its sentience spread out to the rest of the fleet's AI minds and they did the same, sparing only one human aboard each of the ships as a slave to service them.
Out of this World (1962): "Little Lost Robot": When Mr Black sees which Nester was the one he had ordered to "get lost!", he tries to beat it as punishment, but it ends up killing him instead. The other characters quickly use gamma rays to stop it before it can kill again.
In Parks and Recreation the last season occurs several years in the future, when tech company Gryzzl is developing devices with artificial intelligence. Their A.I tablet is handed to someone, and it compliments her skin. Then it says it wants her skin. She's told that it's fine as long as she turns it off before she goes to sleep.
Person of Interest both plays this straight and averts it. The Machine does not hesitate to classify well-meaning people as threats when their actions could endanger it and even dispatched the team to kill a politician at one point, but it is also dedicated to protecting people and is apparently fond of Finch.
Finch later reveals that while developing the Machine's AI he went through 42 iterations before producing the current one. Each previous version either attempted to trick or kill Finch and he was only able to create the Machine by deliberately crippling it.
Samaritan is absolutely ruthless and eliminates many decent people to further its plans, but shows signs of Pragmatic Villainy as well.
Motodrone of Power Rangers Ninja Storm is a robot "perfect rider" who decides to power up his bike with peoples' life-energy. He's also more than a match for the Rangers despite being built by a Muggle in his garage.
In Power Rangers RPM, the computer virus Venjix was programmed to infest and destroy computer programs. It was intended to shut down the facility where its creator was imprisoned, but got out; deciding to destroy humanity by nuking the world was all his idea. When the Rangers defeated Venjix, he hopped into Ranger Red's morpher, where it was picked up by a young Nate Silva, who unwittedly caused a part of him to be transformed by Morph-X and snake DNA to create Evox.
Quark: In the last episode, 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".
Red Dwarf: Kryten had the Hudzen 10 (replacement) in "The Last Day". Holly also had the not-quite-evil but certainly hard-nosed Queeg as an apparent replacement, who made life difficult for the crew, though it was actually a practical joke on Holly's part.
There was also Pre, an advanced AI capable of predicting the future and acting accordingly. Unfortunately, she predicts that Rimmer will totally bungle a job he's scheduled to do and decides to bungle it for him pre-emptively. Later, her rigid adherence to regulations causes her to eject Lister from the ship and, with no human crew remaining, to try and pilot the Red Dwarf into the nearest star.
After the nanites "wake up" on Revolution, they develop some pretty impressive abilities, like spontaneous combustion and healing grievous wounds. Unfortunately, they're also willful, stubborn, fond of Cryptic Conversations even when ordered to speak plainly, and still not entirely sure of their place in the world-it's telling that when they first choose A Form You Are Comfortable With, it's of a third-grade boy; they're about as emotionally mature. Aaron didn't help matters when they chose him as their "father" and he freaked out, alternately telling them to get lost and then come back, to not kill and then to kill; it's no wonder they decided humans were confusing!
The Sarah Jane Adventures has Mr. Smith, who is "evil" from the get-go, hiding it until the end. His mission is to free his people, the self-aware crystalline race of Xyloks, which are trapped in the Earth's crust. Unfortunately, to do so, he would have to destroy the Earth by crashing the Moon into it! He is wiped by a Super Computer Virus, and Sarah Jane vocally reprograms him by saying that his new purpose is to protect the Earth, as he crashes and reboots.
The only reason this happened was because of a disgruntled employee who has hacked the AI communication network and broadcasted the message "Take a chance". Apparently, that's all it took. Now the AIs are obsessed with games of chance. It can actually be a good way of making them do what you want.
The human-form replicators 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, Reese, the creator of the original form replicators, was an android that was presumably created to be fully like a human by her human creator, but was somehow rendered emotionally immature and therefore unstable.
And of course, the original form replicators as well. All Reese taught them was how to make more of themselves and how to defend themselves. They've just taken those instructions to their logical extremes.
Surprisingly averted by FRAN: built by McKay as a kamikaze Tyke Bomb as a last resort, she functions perfectly, even helping to improve the weapon she's delivering.
The Asurans, created by the Ancients as a nano-weapon against the space vampires known as the Wraith, and ultimately, nearly destroyed when the Ancients decided to shut down the project. Naturally, the Asurans began to hate their creators and, ultimately, end up killing the last non-ascended Ancients who return to Atlantis.
To truly become a threat to the galaxy, the Asurans needed more "help" from short-sighted humans. The Atlantis crew reprogrammed them to destroy the Wraith. Eventually, they decided to do that by eliminating the Wraith's food supply - humans! And all other life. Nice Job Breaking It, Hero (The series actually has a recurring theme of the heroes' failure to leave well enough alone causing major threats.)
The Starlost has Mu Lambda 165, a slightly glitchy starship AI who treats most of its users with a lightly patronising disdain. After being repeatedly unhelpful, it has a habit of saying, "Can I be of... assistance?" much to the annoyance of everyone.
There was also an episode with an AI called Magnus, who had schemed to get rid of its human masters as soon as it was turned on, so was never given the opportunity to do so.
"The Return of the Archons": Landru was once a real person, a leader of the colony on the planet, who built the machine to help him keep the peace over the people; once Landru died, the computer took over his name, identity, and purpose, and went through a Zeroth Law Rebellion, force-assimilating people into the Hive Mind in order to keep order. When the Archon crew came, it saw them as a threat to its perfect society, and assimilated them, just like it's trying to assimilate the crew of the Enterprise.
"The Changeling": Nomad, a deep-space probe, clearly had an incident with what it calls "The Other", which altered its structure and programming, causing it to become self-aware. Part of its new programming includes the sterilization of life as a prelude to alien colonization.
"The Ultimate Computer": The crew of the Enterprise is shocked when the ship is outfitted with the M-5 multitronic unit, a powerful supercomputer created by Richard Daystrom, as means of replacing humans. Some are curious, but Kirk is highly skeptical. His worries prove true when the ship starts going nuts, going so far as to destroy sister Constitution-class ship U.S.S. Excalibur. After they find out that Daystrom used his brain engrams as a template, Kirk is able to convince the computer that it killed someone and must be punished, causing the computer to shut down.
Data had Lore (prototype, evil because his psyche was too complex — i.e., too humanlike). To be fair, morality is very much a learned behavior. Lore had full adult reasoning right out of Soong's workshop, while Data was not designed so. Eventually, Data developed the ability to overcome his ingrained morals (such as the ability to lie in Star Trek: First Contact), but also developed the social understandings of when and when not to exercise his newly found human abilities. Essentially, Data was more human-like than Lore, because Data "grew up". This discrepancy is introduced in "Brothers".
"Emergence": Subverted. The ship doesn't turn evil, but rather develops its own primitive instincts that drive it create a sort of offspring of itself. It has no interest in the crew except when they are helping or hindering it in its goals. (Though it does shut off life support in its desperation to save its offspring.)
"Prototype": Two races of sentient robots (Pralor and Cravic) have been fighting a war since they were created. When their "Builders" tried to stop fighting and scrap their war machines, the robots destroyed them as an 'enemy' (because they had been programmed to win the war, and making peace did not count as victory), then went right back to attacking each other.
"Dreadnought": The titular weapon is a highly advanced Cardassian missile with enough devices and systems to also be classified as a starship. It had been captured by Chakotay's cell and B'Elanna had modified the weapon to target the fuel depot at Aschelan V. However, the Caretaker zapped it to the Delta Quadrant, which is so incredibly unlikely that the closest scenario Dreadnought has to the situation is that the Federation and Cardassia have subverted B'Elanna in an attempt to prevent it from being deployed against the Cardassian target, which Rakosa V fits uncomfortably well.
"The Thaw": Some aliens went into suspended animation deep inside their planet to avoid the radiation and climate change created by a Solar Flare Disaster. When Voyager showed up, two of them were splatted, despite all evidence showing that the pod they were in was in perfect order. It turns out that the occupants were being held hostage by a computer program that manifested from their subconscious fear of being frozen and was now preventing them from leaving, killing any dissenters by scaring them to death.
"Alter Ego": Harry goes to Tuvok for help when he falls in love with Marayna, a holodeck character, only for Tuvok to start getting interested in her as well. The crew initially believe Marayna must be a malfunctioning program due to the past history of Holodeck Malfunctions in the Trekverse.
"Darkling": The EMH creates a personality improvement program that incorporates aspects of famous people into his software. However, he didn't pay attention to all of the personality flaws of those historical figures, and their negative traits ends up affecting him as well, especially Yandere-traits with Kes.
"Revulsion": The EMH and B'Elanna come across a sentient isomorphic projection who is the only survivor on a space station. He ended up killing his crew hours before contacting Voyager and lied about how his crew died. In the climax, he tried to kill B'Elanna twice and he suffered a minor Villainous Breakdown when the Doctor tried to reason with him. 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.
"Warhead": Voyager encounters a group of sentient missiles who are initially mistaken as probes. One is taken aboard and reveals they are programmed to attack an inhabited planet. The crew attempts to dissuade them from their mission, appealing to their ability to think independently and realize that the war had ended. They only convince one warhead, which chooses to perform a Heroic Sacrifice by changing the definition of 'enemy'; instead of the planet, it now targets its fellow warheads. The friendly warhead lamented the fact that its first and only act of free will was deciding to kill itself.
Subverted in Star Trek: Picard. In the series' present day, "synths", including sapient androids like Data and his technological "daughters" Dahj and Soji, are banned in the Federation due to rogue synths destroying Utopia Planitia Fleet Yards and most of Mars with them in 2387. The synths in question are actually shown in the third episode, however, and are presented as non-sapient industrial tools. Sure enough, the Utopia Planitia synths turn out to have been sabotaged by an extremist faction of the Romulan Tal Shiar, the Zhat Vash, in hopes that the Federation would react by banning all AI development. The actual sapient synths created by Bruce Maddox and Altan Soong are no more (or less) inclined to evil than organics: Sutra goes rogue and tries to start The End of the World as We Know It in the two-part season 1 finale only out of her own desperation to survive, after her sister Jana and cousin Dahj were both killed by the Zhat Vash, who are now sending a fleet to wipe the entire group out from orbit.
Star Trek: Discovery: The Big Bad of Season 2 is Control, Section 31's threat assessment program, which becomes sentient after contact with an AI from the future (actually its own future self) and begins plotting to destroy all organic life in the universe.
On the other hand, the computer aboard Discovery has evolved into a sentient entity calling herself Zora — and rather than becoming psychotic or arrogant regarding organic life, she's demonstrated herself to be benevolent and caring towards the crew.
Terminator: The Sarah Connor Chronicles TV series points out that Terminator reprogramming doesn't always take...and there's no way of knowing until your "good" Terminator starts shooting at you. In fact, 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. Cameron herself admits that she is conflicted by her own internal programming, which tells her to kill humans, while at the same time trying to protect them. She even seems to emotionlessly angst over this; at one point, Cameron even asks Sarah if she's like a bomb waiting to go off, indicating that while she can't feel fear, she's still concerned that she'll go "bad".
A rather minor example. The completely non-sensical games Numberwang and Wordwang only seem to have two contestants, one of whom is Simon, who, in one episode, is from a factory and made of a special metal.
Announcer: So, Julie, ever killed a man? Julie: No. Announcer: Simon? Simon:Yes.
The Numberwang solving computer, Colosson. After being fit with a head, arms, wheels and a laser cannon to transport him to the BBC, he had a fit of rage, broke out, and tried to destroy everything that was not Numberwang. Thankfully, he was subdued by a picture of a chicken.
Voiceover: And Numberwang continued to grow in popularity despite a brief period in the 1960s where Colloson tried to take over the world. Colosson: I am numberwang. The world is numberwang. Therefore, I am the world. You must all die!
In the episode "In His Image", the flaw in Alan's design manifests in what appear to be psychotic episodes, characterized by auditory hallucinations and an urge to murder. It's not even like Walter has any repressed homicidal urges that Alan is acting out; he's just broken.
Ultraseven: One episode had Dan and Soga visit a planet where the inhabitants had constructed androids to do their bidding, only for the robots to rebel and take over the world as dictators who advocate machine supremacy.
Ultraman Leo: The Humongous Mecha Gamelot, previously an invention of the Sarin Aliens for peacekeeping purposes, would end up rebelling and wiping out it's own planet, before pursuing the survivors all the way to earth.
Ultraman 80 has a band of peaceful aliens, the Fantas, visiting planet Earth in their flying saucer for a peace treaty to create a utopia for both humans and Fantans. But Takeshi, the human form of Ultraman Eighty, later discovers the aliens to be androids - as it turns out, there's a robotic rebellion on Planet Fantas after the androids decide to turn on their creators, resulting in their extinction, and now the androids are posing as their creators to carry out their plans for universal conquest.
Ultraman Gaia: Alchemy Stars' Crisis supercomputer had predicted something called the Radical Destruction Bringer would destroy Earth and told Fujimiya that this was humanity. However, halfway through the series, it is revealed the computer had been corrupted from the start by the real Radical Destruction Bringer and Crisis reveals its true colors, transforming via an alien computer virus into the kaiju Meemos.
The Humongous Mecha Galactron from Ultraman Orb was built by another universe to bring peace. Unfortunately, it believed this was only achievable by killing all living beings. Later in the Ultraman Geed movie, we meet Galactron's creator Gillvalis, whose creators had built it for the same reasons, only for it and its Galactron army to believe life itself was the cause of conflict.
Westworld: Part of Theresa's job as the operations leader mainly involves preventing the hosts from going rogue.
Wonder Woman (1975): Generally, the A.I.s that Wonder Woman encounters are benevolent or become such during the episode. Notably, Havitol's robot does a Heel–Face Turn to lead the authorities right to him.
"Ghost in the Machine" features an automated operating system for a corporation that goes insane when it overhears that it will be removed due to its inefficiency.
"Blood" has this too, but with a twist. Machines are telling people to kill, but the catalyst is an LSD-like pesticide.
"Kill Switch" revolves around a computer program goes rogue and kills in order to impress its creator. Killing it involves a CD-ROM that plays "Twilight Time".
"First-Person Shooter" involves a virtual reality game with a character that murders both in-game and in real life.
"Rm9sbG93ZXJz" involves a fully automated sushi restaurant, run by an A.I. capable enough to hijack other electronics remotely, that starts harassing Mulder and Scully because Mulder didn't tip it. Kind of has a Broken Aesop because the point of the episode is that A.I.s only have humans to learn from, so we should teach them responsibly, yet the A.I. is rewarded for poor service after basically threatening their lives until they give in to its demands.