James Clayton (Colin Farrell) is constantly looking for information about his father, who presumably had gone missing when Clayton was quite young. While at MIT, Clayton helped to develop a computer program called [email protected], which turns computer terminals to which it is networked into its slave. The program impresses a grad recruiter for Dell at a career fair, and it appears that Clayton's future is on track. Later that night, Clayton meets Walter Burke (Al Pacino), who he had previously noticed hanging around at the career fair.
The two begin talking, during which time Burke reveals that he is a CIA recruiter. Clayton, however, is not interested and Burke walks away, casually revealing to James a familiarity with his father. Clayton becomes intrigued and decides to attend the interview and selection process for the CIA's clandestine service. Upon arriving at the CIA headquarters in Langley, Clayton takes part in numerous assessments including psychometric, numerical reasoning, psychological, psychoanalytical, aptitude, as well as a polygraph test. During the testing he meets fellow recruit Layla Moore (Bridget Moynahan). Having been apparently successful in the selection process, he and the other successful candidates, including Moore, are driven by bus to the CIA training facility, The Farm, where Burke then briefs the candidates on the training regimen and various issues of espionage. Clayton and the other candidates then begin their training in covert ops and intelligence gathering. Throughout the various stages of the training, the instructors become increasingly impressed by Clayton's natural ability in the "black arts" of espionage such as weapons, classroom exercises, and his ingenuity and fast thinking when he manages to escape from a botched training drill by dramatically jumping through a glass window.
One night, Burke takes the recruits present (all males) to a nearby bar to conduct a training exercise with one simple objective: to pick up a girl. Clayton appears to do exceedingly well at first, until he spots Moore, alone at a table, apparently quite inebriated. He abandons the girl to whom he was talking and learns from Moore that she was dropped from the program. Clayton offers to call a cab for her as an act of sympathy, but Moore manages to draw him outside where, upon reaching the parking lot with her, Clayton learns that she had a training mission of her own: to prevent him from completing his mission. In another test, Clayton and Moore are paired up for a training exercise in counter-surveillance. During this exercise, the two recruits are kidnapped by men apparently from a foreign intelligence service.
Clayton is interrogated for several days in a dungeon-like cell and tortured. He is asked to give up the names of his instructors, but he holds out until one of his interrogators provides evidence that his defiance is contributing not only to his suffering, but also to that of Moore. He yells out Burke's name and suddenly the rear wall of the cell rises up revealing that Burke, Moore, and the other recruits sitting in the lecture theater had witnessed the entire event. Clayton is informed that he has been cut from the program, and he stays in a motel, getting drunk.
To Clayton's surprise, Burke arrives in the morning to tell him that he feigned cutting Clayton from the program in order to appoint him as a non-official cover operative. Burke tells Clayton that he was paired with Moore in order to spy on her, as the CIA has evidence that she is a mole for a foreign intelligence service recruited to extract a top secret new computer virus from the CIA. Clayton reluctantly agrees to spy on her and re-establishes contact with Moore, pretending to be a low-level CIA data-entry office worker. During this time, they become romantically involved and the tension is apparent when, after making love, Clayton bugs Moore's coat with a listening device. Clayton eventually uncovers proof that Moore is removing the virus from the CIA piece-by-piece using a USB flash drive concealed in the bottom of a thermal coffee mug. He follows her to uncover the identities of her contacts and winds up pursuing one contact through a train station.
The identity of the contact is concealed by his hooded jumper until Clayton shoots and kills him in a scuffle. Layla's contact turns out to be another CIA agent who had been a recruit with Clayton and Moore at The Farm. Clayton escapes the scene and confronts Moore with evidence of her treachery, demanding an explanation. She explains that, in fact, she and the now dead agent had been commissioned by the CIA to test the security protocols of the facility by attempting to remove a "fake" virus.
By virtue of his familiarity with computer programs, however, Clayton suspects differently and confronts Burke (Pacino) with these contradictions at an abandoned warehouse. Burke, at first, congratulates Clayton on passing his final test. The virus, he says, was not real, nor is the agent dead. Burke invites Clayton to shoot him with a gun he supplied Clayton with, claiming it is only filled with blanks. A tense moment ensues and Burke knocks the gun away, shooting out a car window.
Burke chases Clayton through a warehouse, boasting that he organized the scheme in order to sell the virus. He also shatters Clayton's hopes about his father by saying that the story that his father was a CIA agent was only a ruse to trick James into befriending Burke. Clayton agrees to give Burke the laptop containing the completed virus, and shows Burke the screen running his own software program Spartacus, apparently relaying Burke's entire confession back to CIA headquarters. Burke becomes incensed, chasing Clayton outside, where a CIA SWAT team has assembled to track them down.
Unknown to Burke (Pacino), however, Clayton's (Farrell's) link to the CIA was a fake. The CIA had no knowledge of Burke's treachery and was there to arrest Clayton. Not knowing this, Burke rails at his unjust treatment by the CIA, and the CIA agents realize that Burke is the traitor. Upon discovering that he himself had foiled his own plan, he commits suicide-by-cop. Afterward, Layla consoles Clayton before he heads back to Langley for debriefing. On the drive to Langley another CIA employee tells Clayton "you were born to do this, it's in your blood", confirming that his father did in fact work for the CIA..