Never have I been so grateful to have been so wrong.

Two years on, the difference is profound. In a single month, the N.S.A.’s invasive call-tracking program was declared unlawful by the courts and disowned by Congress. After a White House-appointed oversight board investigation found that this program had not stopped a single terrorist attack, even the president who once defended its propriety and criticized its disclosure has now ordered it terminated.

Image Edward Snowden Credit... Frederick Florin/Agence France-Presse — Getty Images

This is the power of an informed public.

Ending the mass surveillance of private phone calls under the Patriot Act is a historic victory for the rights of every citizen, but it is only the latest product of a change in global awareness. Since 2013, institutions across Europe have ruled similar laws and operations illegal and imposed new restrictions on future activities. The United Nations declared mass surveillance an unambiguous violation of human rights. In Latin America, the efforts of citizens in Brazil led to the Marco Civil, an Internet Bill of Rights. Recognizing the critical role of informed citizens in correcting the excesses of government, the Council of Europe called for new laws to protect whistle-blowers.

Beyond the frontiers of law, progress has come even more quickly. Technologists have worked tirelessly to re-engineer the security of the devices that surround us, along with the language of the Internet itself. Secret flaws in critical infrastructure that had been exploited by governments to facilitate mass surveillance have been detected and corrected. Basic technical safeguards such as encryption — once considered esoteric and unnecessary — are now enabled by default in the products of pioneering companies like Apple, ensuring that even if your phone is stolen, your private life remains private. Such structural technological changes can ensure access to basic privacies beyond borders, insulating ordinary citizens from the arbitrary passage of anti-privacy laws, such as those now descending upon Russia.

Though we have come a long way, the right to privacy — the foundation of the freedoms enshrined in the United States Bill of Rights — remains under threat. Some of the world’s most popular online services have been enlisted as partners in the N.S.A.’s mass surveillance programs, and technology companies are being pressured by governments around the world to work against their customers rather than for them. Billions of cellphone location records are still being intercepted without regard for the guilt or innocence of those affected. We have learned that our government intentionally weakens the fundamental security of the Internet with “back doors” that transform private lives into open books. Metadata revealing the personal associations and interests of ordinary Internet users is still being intercepted and monitored on a scale unprecedented in history: As you read this online, the United States government makes a note.

Spymasters in Australia, Canada and France have exploited recent tragedies to seek intrusive new powers despite evidence such programs would not have prevented attacks. Prime Minister David Cameron of Britain recently mused, “Do we want to allow a means of communication between people which we cannot read?” He soon found his answer, proclaiming that “for too long, we have been a passively tolerant society, saying to our citizens: As long as you obey the law, we will leave you alone.”