James Clayton (Colin Farrell), a computer programming expert at MIT, is offered an interview by senior Central Intelligence Agency instructor Walter Burke (Al Pacino) for a position with the Agency. After witnessing a demonstration of Clayton's skills, Burke tests Clayton with a puzzle encoded on the sports page of a newspaper. Clayton agrees to be recruited because he wants information about his missing father, whom he suspects was a CIA agent.
After passing numerous psychometric, psychoanalytic, aptitudinal, and polygraphic tests, Clayton is taken to The Farm, a CIA training facility. There, Burke and other instructors teach the candidates the skill sets of espionage, covert operation protocols, and intelligence gathering techniques. During a surveillance exercise, Clayton and fellow recruit Layla Moore (Bridget Moynahan) are kidnapped by men apparently from a foreign intelligence service. Clayton is tortured in a cell for several days but refuses to give up the names of his instructors. When the interrogators threaten to hurt Layla, Clayton gives in. The rear wall of the cell opens to reveal Burke, Layla, and the other recruits sitting in a lecture theater, having witnessed the whole event, which was a set-up.
Clayton is cut from the program, but Burke arrives at his hotel room and claims that the dismissal itself was staged, and that Clayton has become a non-official cover (NOC), the most exclusive operative. Clayton's first mission is to spy on Layla, whom Burke suspects is a mole, and who is trying to steal a computer virus from the headquarters. Burke gives Clayton a low-level desk job at the headquarters so he can get close to Layla. Clayton finds proof that Layla is removing the virus piece by piece using a USB flash drive.Clayton watches Layla as she secretly passes a note to her contact, and follows the contact through Union Station. After a brief scuffle, Clayton kills him and discovers that he was Zack (Gabriel Macht), a fellow recruit back at The Farm. When Clayton confronts Layla, she cries and protests that it was a security exercise, and that Zack was a NOC. Torn between two conflicting statements, Clayton decides to suspect Burke and trust Layla, believing her show of emotion to be genuine