Congress is close to passing legislation to expand surveillance powers of law enforcement agencies. Congressman Phil Hammersley (Jason Robards) is trying to stop the bill because he believes it is an invasion of privacy, while Thomas Reynolds (Jon Voight) is trying to push the bill through to confront growing terrorist threats against the U.S. and advance his own career. Hammersley, on making it clear he will not reconsider, is then killed with a syringe to the neck near a lake by David Pratt (Barry Pepper), one of two rogue NSA agents loyal to Reynolds, who plant a bottle of heart medication near the body to make the death seem like a heart attack. On hand to witness such is Hicks (Loren Dean), Reynold's number two in the NSA. However, a video camera set up by wildlife researcher Daniel Zavitz (Jason Lee) to monitor goose migration in the area caught the entire incident.
When Zavitz views Hammersley's murder, he realizes that the news reports of a sudden heart attack are false and sends word to a friend of his, an anti-war activist and underground journalist. Zavitz is unaware that another of Reynolds' agents saw him retrieve the tape from the video camera, alerting them that Zavitz could have possibly videotaped the murder. He copies the tape onto a computer cartridge, and when NSA agents arrive, he hides the tape in a TurboExpress and escapes. Tracked by satellite and pursued by NSA agents, Zavitz bumps into an old friend from Georgetown University, labor lawyer Robert Clayton Dean (Will Smith) who is in a lingerie store shopping for a gift for his wife.
Dean has just come from a meeting with mafia members who control a labor union he is representing and beat up one of the members for not toeing the line. He has raised their ire by showing them a videotape of boss Paulie Pintero (Tom Sizemore) consorting with union officials, in violation of his parole. Pintero threatens to kill Dean within a week if he does not give them the name of the source.
While Dean hands Zavitz his business card, Zavitz drops the cartridge with the murder footage into Dean's shopping bag (without Dean's knowledge) and then flees. Pursued by NSA agents, Zavitz jumps onto a bike and rides down a busy street, where he is hit and killed by a firetruck. After finding Dean's business card on Zavitz's body, following the killing of the journalist Zavitz alerted to cover their tracks, the agents visit Dean posing as detectives from the Metropolitan Police Department of the District of Columbia. Unaware that Zavitz gave him the video, Dean tells them he has no knowledge of their allegations that he was passed "sensitive materials," denying them access to his bags without a warrant. Dean then tries to find these materials, but unbeknownst to him, his son had already removed the device from his shopping bags.
The next day the NSA agents break into Dean's house looking for the tape. While they do not find it, they plant tracking bugs in his clothes and personal items. They also plant audio and video bugs throughout his house, while ransacking it to cover their tracks and bugs. The NSA smears him with a false story about a love affair with Rachel Banks (Lisa Bonet), an old girlfriend who acted as an intermediary between Dean and her contact "Brill", the source of the mafia tape. He is fired from his law firm and thrown out of the house by his wife. When he attempts to check into a hotel for the night, he learns his credit cards have been canceled and somebody has stolen his attaché case.
Believing that all his trouble started with the mafia tape, he meets up with Rachel to have him set up a meeting with "Brill". With Reynold's men listening in, they set up a fake "Brill" (Gabriel Byrne) to meet Dean to ascertain the whereabouts of the murder footage. He is quickly helped by a stranger (Gene Hackman) escape this agent and taken to a hotel rooftop. The man is retired NSA agent Edward Lyle, the real "Brill", who shows him the bugs that have been planted in his belongings, and tells him the NSA is after him. When NSA agents chase Dean through the hotel, Dean escapes by climbing on the balconies from the roof, in the process removing his bugged clothes and stealing a robe, then setting the janitor's storage closet on fire to activate the fire alarm. While Dean is being transported to the hospital for smoke inhalation, he steals a cop's gun, escapes from the ambulance and runs down a tunnel. The NSA agents are able to watch him by impersonating the DC Metro Police and having Tunnel Control relay to them Dean's movements on their security cameras. Dean escapes by giving his robe to a person doing street sweeping. Dean heads home and is able to convince his wife that he never had an affair with Rachel and, after telling her everything, he realizes that his son must have gotten hold of what Zavitz was trying to give him and quickly retrieves it. Dean then finds out that Rachel had been killed by Reynolds's team (to frame him for murder) by planting the clothes he took off at the hotel in Rachel's apartment. He and Brill make contact and finally discover that they possess the murder video -- just minutes before it is destroyed in an attack by the NSA. Reynolds's team tracked them down after Dean carelessly made a phone call at a nearby convenience store.
While on the run, Brill reveals that he served as Rachel's contact because he and her late father worked together in the Shah's Iran and her father was murdered in the aftermath of the Iranian Revolution. When Dean says he will not leave his family per Brill's suggestion, they decide to engage in some guerrilla warfare against the rogue NSA agents. They use covert technology methods on a supporter of the surveillance bill, Congressman Sam Albert (Stuart Wilson), similar to those used on Dean, that catches him having an affair with his aide and exposes an illegal NSA operation to the NSA's top brass. They also plant evidence that Reynolds is corrupt and having an affair, which angers his wife, and gets his attention so they can arrange a meeting with him. Their plan is to incriminate Reynolds by recording his conversation with Brill about the conspiracy on tape, but Reynolds is able to stall them without revealing any incriminating evidence.
Dean and Brill are captured, and it is apparent that they will be killed in order to eliminate any witnesses. However, Fiedler (Jack Black) audiotapes the conversation between Reynolds, Brill, and Dean. Dean turns the tables by claiming that the leader of the Pintero mafia family has the tape Reynolds is after. This leads the conspirators back to the Italian restaurant that Dean visited earlier in the movie, which he knows is under surveillance by the FBI. Dean then convinces Pintero that Reynolds made the tape of his meeting with the union leaders. Reynolds believes that the tape in question documents the Hammersley murder. The situation quickly becomes a Mexican standoff between the agents and mobsters, escalating into a firefight when one latecomer agent is suddenly shot by staff.
Dean and Brill are among the few survivors. Reynolds, Hicks, Pratt and nearly all of the rogue agents involved in the conspiracy, and most of the mobsters including Pintero are killed. The FBI sweeps in and the plot behind the legislation is soon exposed. The only two surviving conspirators, Fiedler and Jamie (Jamie Kennedy) are taken into custody by the FBI, and the NSA's involvement is covered up by the FBI, including falsely implicating the late Pintero as the one who killed Rachel Banks. Sam Albert informs the media in an interview that the bill did not pass the legislature, and Dean is cleared of all charges and returns home with his wife, while Brill, who escapes to exile in a tropical location, sends a friendly message to Dean via his television set.