For the past three and a half years there has been a major debate over the National Security Agency's warrantless wiretapping program. This program, which involved the surveillance of communications between Americans and people outside of the country, began shortly after September 11.

It was brought to public light in December 2005, was the subject of legislation in 2007 and 2008, and was described in a report written by five Inspectors General released last month. On Monday, former Central Intelligence Agency and NSA Director Michael Hayden wrote an op-ed in the New York Times concerning the "value and legality" of the warrantless surveillance program. I have a different perspective.

General Hayden wrote that the surveillance activities were lawful and had "been consistently deemed lawful by the Justice Department." This is misleading, because until Congress passed the Protect America Act in 2007, these surveillance activities (acknowledged by President Bush in 2005) were conducted outside of the governing law, the Foreign Intelligence Surveillance Act of 1978 (FISA). That was done despite a provision in law that specifically stated FISA was to be the "exclusive means" by which electronic surveillance could be done for foreign intelligence purposes.

Last year, Congress passed new legislation that reiterated and strengthened this exclusivity language to ensure that this type of surveillance would never be conducted outside the law again.

Here are the facts, as I understand them: Immediately after 9/11, the warrantless surveillance program was authorized by President Bush and its activities were declared lawful by the Department of Justice's Office of Legal Counsel (OLC). Initially, the OLC based its opinion on the president's inherent constitutional authorities as Commander-in-Chief. Subsequently, the OLC shifted its rationale to rely upon the Authorization for the Use of Military Force, which granted the president the wartime powers to use "appropriate and necessary force" against terrorists. But that authorization says nothing about electronic surveillance.

According to a recent report by the five Inspectors General, former Deputy Assistant Attorney General John Yoo was the only person in the OLC "read into" the surveillance program from its inception in October 2001 until he left the Department in May 2003. The Inspectors General found that "overly restrictive limitations on the number of DOJ personnel read into the program created several problems" including "prevent[ing] DOJ from adequately reviewing the [program's] legality during the earliest phase of the program's operation."

When John Yoo left OLC, his successors raised major concerns about the legal basis for the program, including Yoo's opinion that FISA could simply be ignored as inconsistent with the president's commander-in-chief powers, along with his inaccurate description of the scope of the intelligence activities conducted. The disagreement between DOJ lawyers and the White House led to a dramatic showdown in the hospital room of former Attorney General John Ashcroft. In addition, numerous top-level officials threatened to resign in protest because of the dispute, including FBI Director Robert Mueller and Deputy Attorney General James Comey. Key officials within the DOJ had serious concerns about the legality of the program.

General Hayden also wrote that, "Congressional overseers were told of all activities conducted by the agency under this authorization." But from 2001 until 2004, only the top two members of the Congressional intelligence committees were briefed on the program. Between 2004 and early 2006, a handful more members were briefed. The full intelligence committees were not briefed on the program until 2006, five years after the program started.

As is clear from the legislation Congress passed last year, electronic surveillance is very complicated in terms both of the technology employed and the legal analysis. There is absolutely no way that periodic briefings from the Executive Branch to such a limited group of Members of Congress, who could not consult with colleagues or technical and legal experts, could constitute real oversight of the program.

General Hayden also implies that because Congress amended FISA last year to allow this kind of surveillance, Congress therefore endorsed the president's surveillance program. To the contrary: The fact that Congress passed legislation to bring the surveillance program back within the law illustrates that Congress recognized the need for all intelligence tools to be soundly rooted in the law, with appropriate oversight from the Executive Branch, Congress, and the courts.

There are two issues on which I agree with General Hayden. First, I agree that there is no evidence of the intentional misuse of this program. I have a great deal of respect for the men and women of the NSA, and I have no reason to think that this program was abused to spy on the private communications of Americans.

Second, General Hayden's op-ed acknowledged the finding of the Inspectors General that the surveillance program was of value, albeit not a linchpin of counterterrorism efforts that it was sometimes made out to be.

Strong intelligence tools are necessary to keep the nation secure and to provide policymakers with information needed to make decisions. But those tools must be transparent to Congress, subject to extensive legal review from within the entire Executive Branch, and fully consistent with the law. That is what is required under our system of checks and balances and, thankfully, the NSA's surveillance activities meet those requirements today.

Cross-posted from the Huffington Post