Little more than a year ago, privacy advocates were optimistic about their chances of using the federal courts to unlock the secrets of the National Security Agency’s warrantless wiretapping program.

A federal judge in Detroit ruled in August 2006 that the program violated the Bill of Rights and the Foreign Intelligence Surveillance Act. Another in San Francisco refused to dismiss a bundle of cases directed at major telecommunications companies accused of allowing the NSA to illegally comb through customers’ communications. The Justice Department was losing ground, and, incredibly, it seemed the courts were on the verge of drenching some of the country’s most closely held national security practices in sunlight.