Patrick Radden Keefe

is the author of "Chatter: Uncovering the Echelon Surveillance Network and the Secret World of Global Eavesdropping"

If you thought the wiretapping controversy ended last summer, when Congress blessed the Bush administration's warrantless-wiretapping program by passing a new surveillance law that greatly enhanced the powers of the National Security Agency, think again. The legacy of the illegal operation represents a serious problem for the Obama administration.

After a hearing this month on the most controversial aspect of the new law - immunity to the telecom giants that secretly permitted the NSA to siphon off their customers' communications - a federal judge in San Francisco must decide whether Congress can bestow absolution on private companies that appear to have violated the law.

The issue underlying the immunity debate is not whether the telecoms should pay damages; it is whether lawsuits against the companies can be used to answer a question that Congress and the media have not: Just how bad was the NSA program?

Barack Obama says he does not want to become bogged down in a "partisan witch hunt," and he may choose to let bygones be bygones where wiretapping is concerned.

That would be a mistake. From 2001 to 2007, the U.S. government turned its formidable eavesdropping apparatus on its own citizens. The new law resolved matters only by moving the goalpost, so that many of the NSA's more questionable activities simply became legal. But major questions remain about the legal grounds used to justify the program, and about how many innocent Americans were ensnared.

The Obama administration cannot enact the course correction on domestic surveillance that is needed without understanding how far off course the intelligence community got. Obama, who reluctantly supported the immunity provision, has committed "to have my attorney general conduct a comprehensive review" of NSA surveillance.

That is not enough. Nor is the prospect of reports due next summer from the inspectors general of the NSA and the Justice Department. The good news for Obama, politically, is that the executive branch should not lead the charge. Congress should.

Provided that the Obama administration is willing to cooperate, Congress can get to the bottom of the abuses. To the extent possible, the hearings should be public, and if necessary, investigators should grant immunity to witnesses in exchange for candid testimony; this is no witch hunt, but an effort to establish an accurate historical record.

What details can be aired in public without violating national security? The number of Americans listened to and the broad contours of the program, for a start. For example, in March 2004, Attorney General John Ashcroft threatened to resign over the program, backing down only when it was adjusted. What transgression was so appalling that it made Ashcroft look like a civil libertarian?

Even the legal opinions governing the program are still squirreled away in a safe in Vice President Cheney's office. In recent months, the Senate Judiciary Committee and a Washington district judge have ordered them turned over, and the next attorney general should do so immediately.

Without some baseline understanding of what went wrong, and without the establishment of some rules of the road, it would be naive to think that there won't be future abuses. For intelligence agencies, legal ambiguity is an invitation to excess.

What is at stake here is not mere personal privacy, but the bedrock American principles of separation of powers and the rule of law. Jack Goldsmith, a former top Bush administration lawyer, pronounced the wiretapping program "the biggest legal mess" he had seen in his life. That sort of mess cannot simply be swept under the rug; it must be cleared up.

This article originally appeared in the New York Times.