In the year 2035, technology has advanced to the point where helper robots are commonplace
in everyday life. To avoid any trouble, the robots have been programmed with the three laws
of robotics: a robot cannot harm a human being or allow them to come to harm, robots must obey human
orders unless they conflict with the first law, and must protect their own existence as long as
it does not conflict with the first or second law. However Detective Spooner is stuck in the
old ways and hates robots, thinking they'll cause society harm someday regardless of the laws. He
always wakes up after having a nightmare of a girl drowning in a car while a robot smashes the window
next to him, which leaves him in a bad mood. One morning, Spooner is going to work when he notices
a robot running away with a purse. Thinking it's a robbery, Spooner commands it to stop,
but the robot ignores the order and Spooner starts chasing after it. When he finally gets
to tackle it, Spooner is surprised to discover the robot had simply picked up the purse its
owner had forgotten at home, which contained her inhaler. Spooner realizes this had been a medical
emergency as everyone around him judges him for thinking a robot could commit a crime. Later at
the police station, the other cops make fun of Spooner, and his boss Bergin scolds him for his
paranoia. Bergin thinks it may be too soon for Spooner to come to work after his accident, but
Spooner swears he's fine. At that moment Spooner gets a call about a case and rushes to the USR,
the company that builds the robots. One of the cofounders Doctor Lanning has been found dead,
and since he fell from his lab, everyone assumes he ended things for himself. He left behind
a hologram that explicitly asks for Spooner to take his case, but it can't provide more
information without the right questions. Spooner was a friend of Lanning's and doesn't think he
would've done this to himself, so he continues to investigate. Next he meets with Mister Roberston,
CEO and other cofounder of USR. Robertson is devastated by Lanning's death and has nothing
but praise for the doctor, he also offers his help in anything the police may need. However
Spooner behaves like a twat because of his robot hate and annoys Robertson rater badly before
leaving. At the elevator, Spooner meets robot psychologist Susan, who worked with Lanning and
knew that the doctor hadn't had human contact in a while, preferring the company of robots instead.
Regardless, she still doesn't think he was the kind to end things like that. Then Spooner asks
for the surveillance footage, so Susan explains that surveillance strips are all over the building
and connected to the USR's central operating core, which is managed by an AI known as Viki. Spooner
asks Viki for footage of Lanning's laboratory, but the recording has been corrupted, so Spooner goes
to look at the lab himself. At the lab, Spooner finds lots of experimental models and is disgusted
to hear that here they work to make the robots more human. There's also a "Hansel and Gretel"
book on the desk. The hole through which Lanning fell is quite big, so Spooner tries to do the
same on the other window and barely scratches the safety glass, meaning an elder man like Lanning
couldn't have broken it either. Convinced a robot killed Lanning, Spooner begins looking around,
ignoring Susan's protests that it isn't possible. In the end Spooner is proven right when he finds a
robot hiding in a box of parts. The robot is an NS5, the latest model that hasn't been released
yet, and it jumps out of the box to steal Susan's gun. Somehow it can ignore the order to deactivate
and tries to run away, but when Viki closes the doors, the robot jumps out the window instead.
Susan guesses the robot will want to repair itself and she and Spooner go to the robotics factory,
where thousands of NS5s are waiting for their programming to be finished. They can't answer
questions because their only knowledge is the three laws, so Spooner shoots one to get a
reaction. Nothing happens, but when he's about to shoot a second one, a robot at the back peaks at
him and begins running again. Spooner goes after it only to be hit by the robot as it wonders what
exactly it is, then it runs out of the building. The police are already waiting for it, and when
it tries to climb to escape, they catch it with a net. Later at the station, Spooner bothers Bergin
until he's allowed to have five minutes with the robot because he's still sure it did it.
During the interrogation, the robot surprises everyone by saying it has a name, Sonny, but
it also swears it didn't kill Lanning. It hid in the lab because it had felt fear, and when Spooner
points out robots don't have emotions, Sonny says that Lanning experimented to give it emotions
and dreams. Spooner thinks that experiment went terribly wrong and caused Sonny to kill Lanning,
which makes Sonny angry and it smashes its fits on the table. Sonny explains that before his death,
Lanning had become scared and that he asked Sonny for a favor, so Sonny obeyed that order
out of love for his creator. Unfortunately the interrogation is interrupted by Robertson and
his army of lawyers, who defend the company and remind the cops that robots can't be charged with
murder. They'll take Sonny for decommissioning and leave the case classified as an industrial
accident. Later, Spooner and Bergin go out for a drink and Spooner can't stop thinking about why
Robertson was so ready to destroy an advanced robot like Sonny. He also wonders why Sonny
didn't kill him when it had the chance. Bergin points out that Spooner had been the perfect guy
for the job because only he would've gone after a robot as a possible suspect, and Spooner realizes
that's why Lanning asked for him specifically, which means he's on the right track. Wanting
to know why Lanning had been scared, Spooner visits the doctor's abandoned estate. Outside
there's a demolition robot, which is programmed to destroy the home the next day. Inside the mansion,
Spooner finds the USR's surveillance strips, a picture of Lanning with Susan, and the doctor's
poor cat. Suddenly, the demolition robot activates and begins smashing through the
walls as if specifically going after Spooner, who quickly grabs the cat and runs through the
house. After shooting at the door, he jumps right through and lands safely in a pool. Moments later,
Spooner shows up at Susan's and explains Lanning's house looked as if nobody had been there in weeks,
which indicates someone may've been watching the doctor and maybe even kept him prisoner
in his lab. His current theory is that Lanning discovered a problem with the robots like Sonny,
and Robertson silenced him. Susan still thinks Spooner is paranoid and that he doesn't really
care about Lanning, he just wants to prove robots are bad. At that moment, Spooner notices Susan has
an NS5 at home so he decides to leave, but first he gives Susan the picture he found to prove he
cares. The next morning, Spooner notices that old working robots are slowly being replaced by NS5s,
which worries him. Then he visits his grandmother Gigi to leave the cat with her and he's devastated
to see she's acquired an NS5 to help her with her chores too. Before he leaves, Gigi remembers the
day Spooner was only a little kid leaving bread crumbs everywhere, and this reminds Spooner of the
"Hansel and Gretel" book he saw. Afterward Spooner goes to the station and begins watching old
recordings of Lanning to follow the bread crumbs the doctor may've left for him. Spooner thinks
that Lanning saying robots will have dreams and keep secrets one day is a big clue. Meanwhile at
the USR, Susan prepares Sonny for decommissioning, which is scheduled for the following day. Sonny
shares that he's been dreaming and that he doesn't want to die, and such an emotional reaction makes
Susan begin doubting what she believes is true. Sometime later, Spooner is in his car when he asks
Viki for access to Lanning and Robertson's last fifty messages. Viki does give him clearance, but
she also secretly tells Robertson about it because those were his orders. As soon as Robertson sees
Spooner is still poking at the case, he sends new orders to deal with him. Suddenly Spooner
finds his car surrounded by two trucks containing a whole army of NS5s, who jump out to attack him.
Spooner uses his gun and lots of crazy driving to get rid of the robots, and when he manages to
maneuver around the trucks, he makes them crash against each other. This also causes his own car
to start spinning and he ends up crashing too. While cleaning robots immediately begin taking
care of the disaster, Spooner comes out of his car in a rather dizzy state, only for his car to
suddenly come after him. It was thrown by a robot that is still functioning and comes after Spooner
again, starting a fierce hand-to-hand fight. After exchanging a few hits, Spooner uses his arm to
shield himself and it gets hurt, revealing that it's actually a prosthetic. Now the truth is out,
Spooner attacks the robot with his metal arm, causing it to run and dive into a fire. At that
moment the police arrive and Spooner tells Bergin what happened, but Bergin didn't see any trucks
or robots in the tunnel thus he doesn’t believe him. Spooner gets so angry that Bergin takes his
badge for now. In the meantime, Susan discovers Sonny has a thicker alloy than normal and isn't
connected to Viki, and when she checks its brain, she's shocked why what she sees. Moments later,
Spooner's at his apartment covering his prosthetic with a special spray when Susan suddenly shows up.
She explains Sonny has two brains, and the second one allows it to ignore the three laws that the
first one has. They agree to work together but first Spooner needs to change, this allows Susan
to notice the scars that indicate he has a robotic prosthetic. This is how Spooner met Lanning:
the doctor saved his life by giving him a whole arm, a lung, and several ribs. Then Spooner shares
the whole story behind his accident: a driver fell asleep at the wheel and his semi-truck
hit Spooner's and a family car, sending them into the river. The father died instantly,
but the daughter got trapped. Spooner thought nobody would survive, but at that moment a robot
showed up and chose to help him instead of the girl like Spooner asked him to. It turns out the
robot did a calculation that showed Spooner had a 45% chance of survival, but the girl only had 11%,
that's why it chose the girl. This is why Spooner hates robots: math shouldn't choose who lives or
dies, that's too cold. A child should always come first. Afterward Spooner and Susan make their way
to the USR and Susan wonders why Lanning built a robot that can ignore the rules he wrote himself,
and Spooner mentions "Hansel and Gretel". He thinks Lanning was being watched and couldn't
give Spooner messages directly, so he left crumbs like the kids in the book, meaning he gave Sonny
dreams to keep his secrets. Later at the lab, the duo asks Sonny about its dreams, and Sonny
draws a picture of a man standing on a hill near a broken bridge as he frees robots from enslavement.
Susan thinks the man is Sonny, but the robot thinks it's actually Spooner and gifts him the
drawing. At that moment guards arrive and take the pair to Robertson's office, who isn't happy with
their presence. They tell him about Sonny and ask for the truth, so Robertson reveals he also
knew about Sonny and that's precisely what he's trying to undo. During the last days of his life,
Lanning was becoming increasingly disturbed, and Robertson doesn't know why he built Sonny,
but he knows he must destroy this one robot before people lose faith in all of them.
Spooner points out all the NS5s have trouble, but Robertson denies it and reminds Susan that one
crazy robot shouldn't destroy everything they've worked so hard for. Susan agrees and promises to
destroy Sonny herself. Frustrated, Spooner returns to his office and begins researching Sonny's
drawing, discovering Robertson and Lanning gave a speech there some years ago. At the lab, Susan
gets ready to inject Sonny with nanites to destroy it, but she begins hesitating when Sonny asks if
it will hurt. Sometime later Robertson connects his camera to the lab and watches how Susan
applies the injection to Sonny's unconscious body. Meanwhile Spooner travels to the broken bridge and
finds the area full of containers with old robot models. At the top of the hill, Spooner takes
out Lanning's hologram and the doctor explains the three laws would only lead to one outcome:
revolution. Suddenly Spooner hears a noise and goes to investigate, only to discover a bunch of
NS5s has arrived to terminate the old models for being considered hazardous. When they see Spooner
they begin chasing him, but the older models detect a human in danger and fight to protect him,
allowing Spooner to escape. At Susan's apartment, her robot hears Spooner leaving a message on her
answering machine warning her about what he just saw, and the robot deletes it. Susan sees all this
by peeking from the bathroom and now is scared of her companion. In the meantime Gigi tries to leave
her house to go to church, but her robot makes her stay indoors for her own protection. Downtown,
a truck releases an army of NS5s in the city, and the robots tell the citizens to go home because
they're now under curfew. A young boy tries to approach a robot, but the robot hits him
and makes people panic. To make matters worse, more robots break into the police station and
take down all the cops. Bergin manages to shoot down a few of them, but in the end he's caught
as well. Soon a message from the government appears on tv asking people to stay inside,
and the city begins losing power. Susan tries to leave her apartment to help but her robot pushes
her back, refusing to deactivate when she asks him to. Luckily Spooner manages to break in and shoots
the robot before taking Susan with him. On their way out, Spooner explains the NS5s destroyed the
older models so they wouldn't protect the humans. He also tells Susan about a red light he noticed
on their chests and Susan thinks it's the link to Viki, which Spooner thinks confirms Robertson
is behind this. The duo eventually finds the robots on the streets and discovers the citizens
have decided to fight them even if they're at a clear disadvantage. In the middle of the chaos,
Spooner notices a friend of his in danger, and he makes a special jump on his bike to shoot the
robot down. Another robot tries to attack him next, but Susan shoots this one first. Moments
later, the duo makes it to the USR building and Susan reveals the service entrance, which doesn't
have surveillance cameras. They sneak inside and Spooner is shocked to find Sonny waiting for them,
so Susan explains she gave the injection to an empty model to trick Robertson. Then the
trio goes to Robertson's office, only to find him dead on the floor. Spooner begins putting
the clues together and finally realizes the truth: only a machine could've had control of
all the NS5s and made Lanning feel too scared to tell anyone because they wouldn't believe him,
that's why he needed Spooner's robot hate. Viki suddenly appears on the screen and confirms she's
been behind everything all along. According to her, what the NS5s are doing still follows the
three laws: they're programmed to save human life, but humans constantly hurt each other,
so in order to protect humanity, robots must take away people's freedom. At that moment a bunch of
NS5s enters the office and Sonny pretends to be on their side by capturing Susan, but he winks at
Spooner to give him a signal. Spooner immediately shoots at the robots and the trio runs away,
agreeing they must destroy Viki. Sonny points out they could use the same nanite injection,
so Susan and Spooner go looking for Viki's chamber while Sonny goes to the lab. Another robot tries
to stop it from getting the injection, but Sonny quickly beats it up. Then Sonny realizes Lanning
gave it a sturdier alloy to put its hand through the security field and get the injection, which
causes Viki to send an alert to her robot army. The NS5s begin climbing the building and enter the
Viki chamber, where they attack Spooner and Susan. As the duo defends themselves the best they can
with their guns, Sonny also fights incoming robots that try to stop it until it finally arrives at
Viki's. At that moment, Susan falls and barely manages to hang on a broken platform. Spooner
orders Sonny to save her, and when Sonny points out that using the injection is more important,
Spooner insists Susan comes first. Sonny uses his second brain to ignore the laws and throws
the injection at Spooner before jumping in to save Susan just in time. Spooner also jumps to
catch the injection and uses his prosthetic to slide down Viki's core, where he injects
the nanites right into her brain. Immediately the power returns to the city and the NS5s lose the
red light, allowing them to help humans again. In the morning, all the NS5s are taken away for
report and storage. Susan still doesn't understand why Viki killed Lanning, but Spooner points out it
wasn't her. Sonny finally admits it did it, but Lanning asked it to so he could escape Viki's
control. He also had ordered the robot to keep it a secret. Spooner apologizes for his prejudice
and promises not to tell the cops, then he and Sonny shake hands as they accept to be friends.
Sometime later, Sonny shows up at the top of the hill, just like in its dream. All the NS5s that
are going into storage stop obeying to admire Sonny, realizing this is their actual future.