When Edward Snowden first came forward in 2013 as the leaker of the biggest trove of National Security Agency secrets ever spilled, he ended his first interview by noting that his greatest concern was about the agency's future. He feared that a less scrupulous commander-in-chief would take charge of the executive branch and with it, the most highly resourced surveillance agency in the world, ready to be exploited in new and troubling ways. “There will be nothing the people can do at that point to oppose it,” Snowden warned. “And it will be turnkey tyranny.”

Three years later, America has watched Donald Trump praise foreign dictators from Kim Jong Un to Vladimir Putin, vow to appoint a special prosecutor to investigate his opponent, Hillary Clinton, if he’s elected, and call for Russian hackers to dig up Clinton’s emails. “I wish I had that power,” he later said in a campaign speech. “Man, that would be power.” If that statement didn't sufficiently reveal Trump's lust for surveillance capabilities, he reportedly listened in on phone calls between staff and guests at his Mar-a-Lago resort in Palm Beach in the mid-2000s. As Trump and Clinton prepare for their final debate tonight—this time focused on national security—NSA alumni as well as critics are concerned that Trump may be exactly the turnkey tyrant Snowden had in mind.

"This is someone who displays a kind of personal vindictiveness that makes Nixon look Christlike," says Julian Sanchez, a privacy-focused research fellow for the Cato Institute. "There’s every reason to be worried about those instincts and how they’d lead him to attempt to abuse this surveillance power."

The only way to tyrant-proof the White House is to not elect a tyrant. Former NSA counsel Susan Hennessey

To be sure, Trump appears to have a very slim chance of winning November’s election. But setting aside lopsided poll numbers and imagining what a President Trump might do with the NSA raises the broader question of how tyrant-proof the agency really is: whether its vast surveillance powers are held in check by law or simply by the discretion of the people who control it. Even the NSA's legal defenders, like former NSA counsel Susan Hennessey, say the agency's regulations don't entirely protect it from a president who's dead set on abusing its capabilities. "No one should kid themselves about the idea that in the wrong hands, it couldn’t do quite a bit that’s very scary," she says.

Trump's public statements have already inspired some of her former intelligence community colleagues to consider if they'd resign if he took office, Hennessey says she's learned in conversations with ex-coworkers. "People are thinking hard about the tension between an intelligence community officer’s obligation to protect the systems they stand guard over and...to serve the president," says Hennessey, who's now a fellow at the Brookings Institution. "On November 8th, if that’s the reality they confront, they’ll face hard choices."

"The idea of a Trump presidency to me is horrifying as a citizen," says another former NSA lawyer, who asked for anonymity to avoid publicizing her personal political views. "If I were still in the executive branch, I’d be thinking, 'Will I have a crisis of conscience if the president is directing policy in ways I disagree with?'"

And exactly what could a President Trump do with the NSA? First, Hennessey says, there's the question of what he could undo: He could, for instance, rescind the executive actions of President Obama aimed at reforming the NSA after Snowden's revelations. Presidential Policy Directive 28, for example, issued in 2014, was designed to ensure that the NSA's signals intelligence branch wouldn't use its powers to promote American business interests or suppress political dissent abroad, and that it would minimize its invasion of the privacy of not just Americans but also non-Americans whenever possible. Trump could also defang or coopt the executive branch's Privacy and Civil Liberties Oversight Board, which opposed and helped to end the NSA's mass collection of Americans' cell phone records last year.

More fundamentally, Hennessey and other former NSA staffers worry that Trump could redefine the priorities of the NSA's foreign intelligence mission. He could, for instance, refocus American spying efforts to take the agency's eyes off Russia and instead target that country's adversaries, like Georgia, Ukraine, or even the European Union. Given Trump's murky financial ties to Russia, it's still not clear how he would approach its authoritarian government if he were to take power. "Trump has indicated he has unusual views about Vladimir Putin as an individual and Russian activity around the world that’s very problematic for the security interests of the US," Hennessey says. "We shouldn’t underestimate the importance of the intelligence community's high level priorities and the ability of the president to shift them."

Why do people think there wouldn’t be another Stellar Wind, but worse? ACLU lawyer Ben Wizner

The president's discretion over the NSA's actions doesn't just apply to privacy-invasive spying. It also controls the agency's capability to develop disruptive or destructive cyberattacks. Trump would have final say over the use of digital weapons like Stuxnet, the malware created by the NSA and Israeli intelligence and deployed by the CIA to destroy equipment in Iranian nuclear enrichment facilities. Many people are already troubled by the possibility of Trump's finger on the nuclear trigger; he reportedly asked foreign policy experts in briefings why the U.S. shouldn't use nuclear weapons on its enemies but has since denied doing so. Trump may be even less prudent about launching cyberattacks that sabotage or destroy foreign infrastructure, inviting retaliation and igniting an unprecedented digital hot war.

The greatest fear expressed by NSA critics is that in the wrong executive's hands, the NSA's powers of foreign surveillance could be turned inward to spy on Americans and even dig up dirt on the president's political adversaries, critical journalists, or dissenting activists. Former NSA staffers say that Fort Meade's legal safeguards would restrict even the president's ability to abuse its powers. Unlike so much of the NSA's foreign-targeted activity, they say, the NSA's surveillance of Americans is curtailed by powerful forces like the Foreign Intelligence Surveillance Court and congressional oversight.

Privacy advocates counter that after years of whistleblower leaks, they've learned that those safeguards can be overcome by a determined executive branch—namely, in the last decade's aptly named Presidential Surveillance Program, known within the NSA as Stellar Wind. That program, enacted almost immediately after 9/11 as an emergency response to terrorist threats, secretly and without court-approved warrants spied on the phone calls and Internet communications of millions of Americans for more than half a decade. "The history of Stellar Wind is instructive and concerning," says Cato's Sanchez. "What it shows is that the NSA was able, for a fair amount of time, to have a sweeping warrantless surveillance program where almost no one, even in the NSA, was privy to the legal justifications."

In other words, with the right, handpicked officials in high-ranking positions and another national security emergency to justify it, there's nothing to prevent a Trump presidency from instituting the same sort of domestic spying program, says Ben Wizner, Snowden's ACLU lawyer. No officials were ever prosecuted for the NSA's illegal spying under President George W. Bush, Wizner points out. Under Trump, he asks, "Why do people think there wouldn’t be another Stellar Wind, but worse?"

The final safety mechanism against that sort of secret domestic spying program—and in particular its targeted use to spy on a president's enemies—wouldn't be the NSA's legal restrictions or oversight bodies, says Brookings' Hennessey. It would be the NSA's employees and their own moral aversion to doing a corrupt president's dirty work.

Ultimately, she says, the agency's actions will depend not merely on its legal constraints but on the ethics of its people—and particularly those of the executive with power over them all. "Broadly speaking," she says, "the only way to tyrant-proof the White House is to not elect a tyrant.”