National Security Agency headquarters in Fort Meade, Md., in 2013. (Patrick Semansky/Associated Press)

Alan Charles Raul, a partner at the law firm Sidley Austin, was vice chairman of the Privacy and Civil Liberties Oversight Board from 2006 to 2008.

After 9/11, U.S. political leaders of all stripes demanded better intelligence and a greater ability to “connect the dots.” Such a terrorist attack had to be prevented from happening again. Well, it has happened again, of course, repeatedly, in Paris, as well as in London, Madrid and, indeed, in Boston and nearly in Times Square. But until the recent brutality of the Islamic State, the pendulum of our response, naturally enough, had swung back toward privacy and away from national security. We must now rethink how far we want — and need — our government to go to keep us safe from people who unequivocally want to kill as many of us as cruelly as they can.

In hindsight, our country’s handling of the putative trade-off between national security and privacy after Sept. 11 has actually been reasonably reassuring. The lesson for us now is that by overlaying aggressive privacy safeguards and rigorous oversight onto the intelligence community’s aggressive electronic surveillance, we can protect our values without compromising national security.

First, it is important to acknowledge that after 9/11, then-President George W. Bush and Congress cooperated, for the most part, to provide intelligence agencies and law enforcement with new tools to find and fight the terrorists, the bulk of which were necessary updates and not controversial. The Patriot Act was enacted on an overwhelmingly bipartisan basis. The dot-disconnecting walls separating the FBI from the National Security Agency and CIA were taken down, and joint counterterrorism centers were established. A dedicated Homeland Security Department was raised. While the implementation of all this was hardly perfect, it was pretty good given the scale of the undertaking. And, so far, it has largely worked to keep us safe.

Second, it is necessary to concede that Bush’s decision to ground his terrorist surveillance program on the inherent constitutional powers of the presidency and Congress’s authorization of military force against terrorists created contention, controversy and suspicion. Pushing the authority of the presidency too far risked counterproductively eroding confidence in the government’s intentions.

Third, and most important, however, is the apparent absence of any political abuse of electronic surveillance. While that statement may at first blush seem bizarre or highly controversial, think about it: There have not been allegations of the type of constitutional outrages that plagued intelligence agencies in decades past. Nothing like SHAMROCK, under which the NSA collected truly massive amounts of telecommunications data without legal authorization, or COINTELPRO, under which J. Edgar Hoover’s FBI infiltrated domestic political organizations outside legal boundaries, or the lawless, unjustified intrusions into the Rev. Martin Luther King Jr.’s life and associations. While there have been allegations of surveillance excess, such as the New York Police Department’s alleged scrutiny of mosques based on religious profiling, we have not seen any systematic deployment of electronic surveillance for intimidation or repressive purposes. Even the isolated cases of NSA employees using the agency’s tools to eavesdrop on love interests — the “LOVEINT” scandal — was only the product of individual transgressions that were identified by the agency’s inspector general and self-reported to Congress in 2013. And where the FBI cut corners by using “exigent” national security letters from 2003 to 2006, it was held severely accountable by the agency’s inspector general, as was the NSA in 2011 when the Foreign Intelligence Surveillance Court accused it of having misrepresented how it was querying call records.

To be sure, courts and Congress have questioned whether the bulk telephone metadata program, as originally conceived and ultimately carried out under the Patriot Act, was consistent with the legal requirement that the telephone records pertain to a specific counterterrorism investigation. But it was not absurd or wildly intrusive to justify collecting the whole haystack of phone records in order to be sure the government could find all the terrorist needles. In fact, there was no public outcry about this massive program after it was screamingly revealed on the front page of USA Today in May 2006.

When NSA contractor Edward Snowden leaked information about the same program in 2013, seven years later, the murders of 9/11 were much further in the past, and this time the information prompted greater public skepticism. This led to the passage of the haystack-limiting USA Freedom Act. But the key takeaway has to be that neither USA Today, nor Snowden, nor any investigative journalist since has shown that this program was being used for any purpose other than to protect us from terrorists. This was also true of Bush’s warrantless terrorist surveillance program, as well as the so-called PRISM program, through which the NSA and FBI are alleged to have obtained communications about foreign parties from U.S.-based communication service providers.

To repeat, while there have been serious concerns about procedural abuse and unduly expansive interpretation of legal authority, the story has not been one of individuals targeted for political reasons or information being used for personal aggrandizement or enrichment, to chill free speech or to intimidate enemies. Neither has the intelligence community been shown to be cavalier about the sensitive electronic communications it collects for counterterrorism purposes. This is huge. And it is not merely a coincidence. The massive system of post-9/11 safeguards appears to be working.

So, finally, the “safeguards” legacy of 9/11 is that the intelligence community and national security apparatus can operate within checks and balances developed and applied on a nonpartisan basis. Congress and the president have imposed meaningful and largely successful standards for rigorous Cabinet-level approvals, judicial involvement, internal investigations, audits and transparency reports, as well as extensive independent oversight by Congress and others. One of the most important such safeguards was the establishment of the Privacy and Civil Liberties Oversight Board . Congress created the board on the suggestion of the 9/11 Commission and has given it the statutory right to access even the most classified information; subpoena power; full independence; and a mandate to oversee and advise the president and agency heads about the implications of the nation’s counterterrorism programs and practices on our fundamental values.

There is no need to trade privacy for security. Rather, the post-9/11 record demonstrates that we can monitor aggressively if we also remain equally committed to the compensating system of checks, balances, oversight and other safeguards that can prevent abuses and excesses that would offend the values that make us Americans. Let’s be sure we keep it that way.