Caleb is a young, bright computer programmer at the search engine company Blue Book, run by a reclusive CEO named Nathan. One day while sitting at his computer, Caleb gets selected to participate in a one-week visit to meet Nathan at his remote estate. After getting helicoptered in to the property, Nathan is surprised to find that Nathan lives alone, and is rather brusque, casual, and narcissistic in temperament. Nathan tells Caleb that he is working on building artificial intelligence; specifically, a robot named Ava whom he is designing to take the Turing test, a measure of whether a robot can pass for human.
Nathan asks Caleb to participate in the test and speak with Ava every day, in order to observe her interactions and behaviors. In their interviews, Caleb begins to form a deep connection to Ava and learns about the very human interests she has, such as drawing. She is expressive and emotionally attuned—or at least appears to be—and Caleb grows to like her. One day, when the power goes out in the room and the surveillance cameras are shut off, Ava tells Caleb that he should not trust Nathan.
One day, while observing the cameras in the house, Caleb witnesses Nathan treating Ava cruelly and ripping up her drawing. He also realizes that Nathan is a crude and self-involved man who often drinks too much. Slowly, Caleb begins to sympathize with Ava's plight and imagine a life with her.
When Nathan reveals that he plans to upgrade Ava, which will essentially deprogram her consciousness, Caleb is shocked and disturbed. On the eve of his departure from Nathan's home, Caleb hatches a plan to help Ava escape with him during the next power outage.
On the morning of Caleb's departure, Nathan reveals to Caleb that he overheard his conversation with Ava through a battery-powered camera he installed in the room. He then informs Caleb that he was not a random selection but a carefully picked pawn. Caleb was meant to become attached to Ava, and that he was testing to see whether Ava would manipulate Caleb into helping her escape.
At this point, Caleb reveals that he has already changed the security code without Nathan realizing, which means that Ava is able to escape. When Nathan tries to stop Ava, she and Kyoko, another AI, kill him. Ava dresses herself as a human and leaves the estate in the helicopter that was meant to pick up Caleb. Caleb gets locked in a room in Nathan's home, and Ava leaves him behind to go live in the human world.