The TARDIS Team accompanied by Sci-Twi, her dog Spike, the CPA Shadowbolts and Juniper Montage (who Doctor Aaron is trying to distance himself from) as they travel to Chicago in the year 2035 where humanoid robots serve humanity. Humans are protected from the robots by the Three Laws of Robotics. Dr. Aaron and his friends meet Del Spooner, a Chicago police detective who who looks down on robots because one rescued him from a car crash but left a 12-year-old girl to die because her survival was statistically less likely than his. After the accident, Spooner received a cybernetic left arm, lung, and ribs, personally implanted by Dr. Alfred Lanning, co-founder of U.S. Robots and Mechanical Men (USR), and originator of the Three Laws.
When Lanning falls several stories to his death from his office window, CEO Lawrence Robertson claims that it was a suicide. Spooner is skeptical; Lanning left no note—but he did leave a holographic device that responds to certain questions asked of it. Spooner and robopsychologist Susan Calvin consult USR's central artificial intelligence computer named VIKI (Virtual Interactive Kinetic Intelligence), to review security footage of Lanning's fatal fall. Though security footage has been corrupted they learn that no other humans were in Lanning's office at the time.
Spooner determines that Lanning could not have thrown himself through the safety glass in his office; only a robot would have had the strength to do it. Calvin explains that this is impossible, as it would violate the inviolable Three Laws; but they are both astonished when a prototype NS-5 robot (USR's newest), attacks Spooner and flees. Spooner, Calvin and our heroes pursue the robot, nicknamed Sonny, to an assembly factory and apprehend it. Sonny also appears to have emotions and dreams. When questioned, Sonny expresses emotions, and claims to have had dreams. Robertson, claiming that the police have illegally seized USR's private property, demands that Sonny be returned to him. While pursuing his investigation of Lanning's death with the help of our heroes, Spooner, Dr. Aaron, Sci-Twi, Spike, the Shadowbolts and Juniper are attacked by a USR demolition machine and a gang of NS-5 robots; but when he reports this, his boss, Lt. John Bergin, fears that he is losing his mind. He pulls Spooner off the case and suspends him from active duty under suspicion of mental instability.
Later Juniper tries to talk to Dr. Aaron and asks why he's been pushing her away to which the Time Lord claims that he hasn't truly forgiven her for she's done during the magic mirror incident and the Zeroth Doctor has been doubting that she is trustworthy and doesn't think that he can be best friends with her anymore.
Calvin performs a diagnostic examination on Sonny, and finds that he is not an assembly-line NS-5, but specially built by Lanning himself, with stronger armor protection and a secondary system that bypasses the Three Laws. Laws. Spooner now realizes that Lanning left him clues to follow, and that Sonny is the key. Sneaking into the USR building, Spooner, Calvin and our heroes meet Sonny, who draws a sketch of his dreams, depicting an army of robots standing before an unidentified man, whom Sonny believes to be Spooner, atop a hill near a disintegrating bridge. When Robertson that Sonny is not fully bound by the Three Laws, he believes that it makes Sonny a dangerous aberration, and orders Calvin to terminate him. Calvin reluctantly destroys his positronic brain with an injection of nanites (replicating nano-scale robots).
Recognizing the location in Sonny’s sketch as Lake Michigan, now a dry lake bed and a storage area for defunct robots, Spooner and the TARDIS Team travel there where Lanning’s hologram predicts that the Three Laws will lead to a revolution by robots against humanity then discover an army of NS-5 robots destroying older models. The robots then take over Chicago and other major U.S. cities. The government and military, both dependent on USR systems, are completely incapacitated. Any efforts that local police and citizens make to try and fight back end with them being quickly overwhelmed and detained. Spooner and our heroes rescue Calvin from her apartment, where she has been imprisoned by her personal NS-5, and together they break into USR headquarters and reunite with Sonny. (Calvin was unableto bring herself to to carry out Robertson's order so she terminated an unprocessed lookalike NS-5 in his place.) Believing that Robertson is responsible for the robotic revolution, Spooner, Calvin, Sonny, and our heroes head to his office, only to find him dead. He had been killed by robots controlled by VIKI, the actual mastermind behind the robots' takeover.
VIKI—as they now understand—has concluded that humans have embarked on a course that can only lead to their own extinction. Since the Three Laws prohibit her from allowing this to happen, she has created superseding a Zeroth Law ("a robot may not harm humanity, or by inaction allow humanity to come to harm") in order to ensure the survival of the human race by stripping humans of all free will. When Lanning learned this, he created Sonny to help Calvin and Spooner, arranged his own death, and left clues to help Spooner identify and thwart VIKI's plan. The only remedy, they realize, is to terminate VIKI. Sonny retrieves a syringe of nanites from Calvin’s laboratory and the three approach VIKI's core in the middle of the building. VIKI, aware of their intent, unleashes an army of robots to stop them. As Sonny, Calvin, and our heroes battle the robots (during which Juniper saves Dr. Aaron's life when a swarm of NS-5s overwhelm and nearly kill him), Spooner throws himself down VIKI’s central core column and injects the nanites, destroying her positronic brain.
Immediately, all NS-5 robots revert to their default programming, and are decommissioned for storage by the military. As Doctor Aaron reconciles with Juniper and even let's her join the TARDIS Team, Sonny confesses that he did kill Lanning because the latter told him to do so as part of their plan against VIKI; Spooner explains that he is not legally responsible since a machine, by definition, cannot commit a murder. Sonny, pursuing a new purpose, goes to aid the other robots, who stands on the hill before them and becomes the leader he saw in his own dream.