Towards the start of the movie Ed Hoffman (Russell Crowe), speaks to his CIA superiors. He explains to them how terrorists are turning their back on technology by throwing away their phones and computers and using old methods of communicating face-to-face and with written messages. This terrorist retreat into the stone age paradoxically makes the strengths Hoffman has to deploy worthless and increases his dependence on Ferris and his human intelligence.
Roger Ferris (DiCaprio) is a CIA paramilitary operations officer. He is in Iraq trying to track down a terrorist called Al-Saleem. While following a lead, Ferris's asset (with whom he has become good friends) is killed during a car chase involving terrorists, rocket-propelled grenades and two missile-firing U.S. helicopters. Ferris recovers from his injuries at a U.S. facility in Qatar before he is sent to Jordan to run down some intelligence he recovered in Iraq. Meanwhile, unknown terrorists plan to follow up an offscreen series of bus bombings in Sheffield, with more attacks in Manchester but blow themselves up when the police find their cell.
Ferris and his handler Hoffman are strongly contrasting characters: Ferris acts on the human scale, relying heavily on trust and human intelligence. Hoffman is more Machiavellian, and keeps tabs on Ferris via a Sikorsky Cypher UAV.
In Jordan, Ferris tosses the ineffectual Station Chief out of his office before meeting Hani Salaam (Mark Strong), head of the Jordanian General Intelligence Department (GID). Salaam and Ferris form a fragile and complex bond. Salaam is deeply aware that whatever he thinks of Ferris, his duty is to his country, while Ferris acts for the CIA, whose interests cannot intersect with those of Jordan. Salaam demands one thing of Ferris -- never lie to him.
Hoffman finds an Al-Saleem safehouse in Jordan and orders Ferris to conduct a surveillance operation on it covertly. Simultaneously, he organises another operative Skip (Vince Colosimo) to conduct an operation without Ferris's consent. Skip botches the operation, blowing his cover by divulging compromising information to a terrorist from the safehouse. As the terrorist takes off, running, and intent on releasing the information that the safehouse has been compromised, Ferris makes chase: bitten by dogs in the run, Ferris ultimately kills the runner. Hani covers up the killing by passing it off as a robbery and Ferris accuses Hoffman of running "side operations", telling Hoffman to lay off. Tending his wounds in hospital, Ferris meets a nurse named Aisha (Golshifteh Farahani). Around them, the swirl of terror animating the action continues as cell phone-triggered bombing in an Amsterdam flower market that kills at least 75 people.
Having recognised one of the men living in the safehouse as well-known suspect Mustapha Karami (Kais Nashif), Hani takes Karami out into the desert and coerces him into working for Jordanian intelligence, threatening to set him up as a collaborator if he does not cooperate (he has been sending money to Karami's mother and making it appear as if it came from her reformed and successful son, so she doesn't know Karami is still a thief and now an aspiring Al Qaeda terrorist, and he is shamed and surprised when Hani does not kill him but lets him ride away on his bicycle). Hoffman asks Hani to hand Karami over to the CIA, most likely to interrogate him but Hani refuses, having earlier told Ferris he does not believe in torture. Unknown to Ferris and Hani, Hoffman tells Ferris's CIA subordinate to follow Karami and kidnap him. Karami gets away and notifies the terrorists in the safehouse that it is being watched, resulting in the safehouse being lit on fire and abandoned. Ferris's partner is caught and Hani professes his belief that Ferris had knowledge of the move on Karami and therefore blames his lack of honesty with Hani for the destruction of the safehouse. Hani gives Ferris 12 hours to leave Jordan.
Ferris comes back to the States for a while and argues with Hoffman, whom he derides as power-hungry and fat. He then comes up with a plan to make contact with the terrorist Al-Saleem by staging a significant terrorist attack, the logic being that Al-Saleem will hear about this attack and try to make contact with the terrorist group who committed it. With the help of one of Hoffman's CIA friends, Ferris is able to frame a Jordanian architect named Omar Sadiki by posing as a financier contracting a bank's construction in the UAE, making him look like the head of a terrorist cell.
The "terrorist attack" is staged at the Incirlik Air Base in Turkey. A bomb is exploded in the base and Ferris uses unclaimed local bodies dressed as soldiers to make it seem that soldiers were killed in the attack. Al-Saleem (Alon Abutbul) sees the report of the attack on television and tries to make contact with Sadiki.
Hani tells Ferris to come back to Jordan because he knows that he needs Ferris. Hani then talks to Ferris about his suspicions that Omar Sadiki is a terrorist. Ferris hides that this is not the case, and acts as if he doesn't know anything concerning Hani's suspicions. Ferris later tries to save Sadiki from being kidnapped by Al-Saleem's henchmen but fails and sees another CIA agent nearly killed in the subsequent car crash. Sadiki informs Al-Saleem that Ferris made it seem he committed the terrorist attack. Sadiki is killed. Ferris goes back to his apartment and finds out that Aisha, in whom Ferris is romantically interested, has been kidnapped. He then desperately asks Hani for his help, explaining to Hani that he made up Omar Sadiki's terrorist cell and the terrorist attack supposedly committed by Sadiki was faked. However, Hani refuses to help Ferris because Ferris lied to him.
Ferris gets a call from the kidnappers and is told to wait for a van. The van picks him up and drops him in the desert. Meanwhile back in CIA headquarters, Hoffman is watching everything via an unmanned aerial vehicle. Ferris is then picked up by a group of men in SUVs and the vehicles create a massive cloud of dust before splitting up. Hoffman is unable to follow Ferris because he has no idea which car he is in.
Ferris is taken to be interrogated by Al-Saleem, just across the border in Syria. When Ferris asks Al-Saleem about Aisha, Al-Saleem tells Ferris that someone has lied to him and he has been double-crossed. Ferris tells Al-Saleem that there is an infiltrator (Karami) in his organization who works for Ferris, and that, by association, Al-Saleem works for Ferris. Al-Saleem smashes two of Ferris's fingers with a hammer before turning on a video camera and ordering Ferris to be killed. Al-Saleem then leaves. Ferris is prepared by Al-Saleem's men to be executed on video. As Ferris is about to be executed, Hani and his team of Jordanian SF burst into the room, killing all of the terrorists. Al-Saleem is seen leaving the building and unwittingly getting into a car driven by Hani's men who arrest him.
While in the hospital, Ferris is visited by Hani who reveals to him that it was his men who kidnapped Aisha, using blood she donated regularly at work to make it appear she'd been killed or wounded. He then brokered a deal with Al-Saleem (using Karami): he would deliver CIA agent Ferris to him for money. It was one of Hani's men who rang Ferris and dropped him in the desert. Since Karami was Hani's man inside Al-Saleem's organization, he was able to locate Ferris and Al-Saleem in time to save Ferris and arrest Al-Saleem. Aisha has been released unharmed but does not know what role her kidnapping played.
In the end Hoffman offers Ferris a job in his office, but Ferris declines and tells Hoffman that he is quitting the CIA. Hoffman prepares to leave Jordan and resigns himself to Ferris not changing his mind. At the movie's end, Ferris seemingly decides to not contact Aisha, therein refuting what Hoffman had repeated numerous times through the movie: no one is innocent. Hoffman is shown speaking with CIA operatives watching Ferris in the market buying pastries, in a box similar to that which he had taken to Aisha's. Hoffman declares that Ferris is no longer an asset. It is left to the viewer to decide whether Ferris leaves Aisha to live her life or becomes involved with her once again.