On PBS tonight, NOVA is presenting “The Spy Factory,” based on James Bamford’s excellent book, The Shadow Factory.

PBS says the NOVA program:

chronicles the NSA’s role in eavesdropping both before and after 9/11. Drawing on dozens of interviews with agency insiders and probing publicly available sources as well as transcripts of terrorist trials and an FBI chronology of the terrorists’ movements, NOVA assembles a detailed picture of events leading up to the 9/11 attacks.

The program sheds light on the vital data known inside the NSA but only partly relayed to other agencies. The trove of information the NSA had access to in advance included Osama bin Laden’s now-disconnected direct satellite phone, which the NSA tapped starting in 1996. Exclusive footage shows the three-story house in Yemen that served as Al Qaeda’s communications and logistics headquarters. The NSA was listening in on phone communications to and from the house for years prior to the 9/11 attack.

Three times the size of the CIA and far more secret, the NSA is comprised of top linguists, mathematicians, and technologists trained to decipher all kinds of communicationsâ€”epitomizing the hidden world of high-tech, 21st-century surveillance. To show how this eavesdropping operates, NOVA follows the trail of just one typical e-mail sent from Asia to the U.S. Streaming as pulses of light into a fiber-optic cable, it travels across the Pacific Ocean, coming ashore in California, and finally reaching an AT&T facility in San Francisco, where the cable is split and the data sent to a secret NSA monitoring room on the floor below. This enables the NSA to intercept not only most Asian e-mail messages but also the entire U.S. internal Internet traffic.

Thus, since 9/11, the agency has turned its giant ear inward to monitor the communications of ordinary Americans, many of whom are on the government’s secret watch list, now more than half-a-million names long.

But how effective is this monumental monitoring effort in countering security threats? The NSA is faced with an enormous and ever-expanding archive of phone calls and e-mail messages. Many experts in data mining and analysis are skeptical about the value of collecting so much information without the ability to understand it, as it may lead to critical clues being lost in the static.

Among those interviewed on “The Spy Factory” are former NSA, CIA, and FBI analysts and officials, many speaking publicly for the first time. Among these is Mark Rossini, the senior FBI agent in the CIA’s Osama bin Laden tracking unit. For the first time, Rossini tells how intelligence agency turf wars prevented him from notifying his FBI superiors that Al Qaeda terrorists were heading for the U.S. with valid visas in early 2000.

Surprisingly, the 9/11 Commission never looked closely into the NSA’s role in the broad intelligence breakdown behind the World Trade Center and Pentagon attacks. If they had, they would have understood the full extent to which the agency had major pieces of the puzzle but never put them together or disclosed their entire body of knowledge to the CIA and FBI. Traditionally, the NSA didn’t share its raw data with those other agencies, an institutionalized reluctance that played a critical role in the failure to stop the 9/11 plotters.

In what Bamford calls “one of the largest ironies in the history of American intelligence,” he notes that weeks before the attacks, the terrorists were staying in a hotel near NSA headquarters in Maryland, almost within sight of the office of then-NSA Director Michael Hayden. Hayden, who was later appointed director of the CIA by President Bush, was never held accountable for his agency’s failure, and after 9/11 he spearheaded the Bush administration’s warrantless wiretapping activities in the name of making the nation safe from terrorists.

Addressing the question, Are we any safer now than we were before?, Bamford says, “We should have been safe the way it was. NSA had all the information that it needed to stop the 9/11 hijackers. It had laws that allowed it to track the hijackers.” Bamford adds that those same laws also protected the privacy of ordinary Americans in ways that have since vanished.