When Donald Trump won the 2016 election, many worried his presidency would be a serious threat to American democracy. It wasn’t that Trump had a plan to destroy our democratic system; it was that his approach to issues ranging from minority rights to the value of a free press would lead him to take actions that would undermine democracy itself.

Trump’s first year in office largely vindicated these fears.

In the new book How Democracies Die, Harvard political scientists Steven Levitsky and Daniel Ziblatt analyze the strategies used by leaders who have taken over a democracy and turned it into an authoritarian state. They found three common tactics: seizing control of courts and security services, marginalizing prominent individuals in the opposition and civil society, and changing election rules to rig the game against their political opponents. “Trump,” they write, “attempted all three of these strategies.”

The key word in that sentence, however, is “attempted.”

Trump’s assaults on democracy have, for the most part, been repulsed. The courts, the federal bureaucracy, the states, and even large numbers of ordinary Americans have all played a vital role in restraining the president’s authoritarian tendencies.

“Despite clear cause for concern, little actual backsliding occurred in 2017,” Levitsky and Ziblatt conclude. “We did not cross the line into authoritarianism.”

This is encouraging. America’s core institutions may not be in perfect health, but they seem to be functioning well enough to constrain a president who’s gone after essential parts of its democratic system. When it comes to the most basic question for any democracy — can it sustain itself? — the answer right now is a surprisingly clear yes.

The crisis of American democracy isn’t over. The near-total capitulation of the Republican Party to Trump is a major concern, as the recent wave of Republican attacks on the Justice Department illustrate quite vividly. And we still haven’t seen how Trump would react in the event of, say, a massive terrorist attack on the scale of 9/11.

But as Trump prepares to give his first State of the Union address, it’s worth taking stock of how American institutions have fared under significant pressure. And so far, the state of the union looks pretty strong.

The courts checked Trump’s worst impulses

One of the most important things for any would-be autocrat to do is either marginalize or seize control of the court system. For example, as part of his turn toward authoritarianism in 2010, Hungarian Prime Minister Viktor Orbán expanded the size of Hungary’s constitutional court from eight to 15 members — and ensured that the new justices were regime cronies.

The logic behind this move is clear. An independent court system is a vital democratic backstop; it can block an authoritarian leader’s attempts to centralize power and even declare anti-democratic laws unconstitutional. A pliant court, by contrast, can provide a veneer of legitimacy for an authoritarian leader’s power grabs. Before Orbán’s court-packing scheme, the constitutional court often ruled against the government in high-profile cases; afterward, such rulings became quite rare.

Though Trump has appointed a number of judges to federal courts, they mostly appear to be traditional Republicans, not Trump cronies. His most egregious nominees — like Brent Talley, an amateur ghost hunter whose wife was an attorney in the Trump White House — did not make it past the Senate.

And when the courts were required to rule on some of Trump’s most egregious power grabs, they performed far better than their peers in Hungary.

The most obvious example is the travel ban. The first version of the ban, which Trump issued by executive order just days after he took office, was incredibly sweeping. It barred people from seven majority-Muslim countries from entering the country, potentially even green card holders who were temporarily outside of the US.

The ban was written by two non-lawyer immigration hawks in the White House (Steve Bannon and Stephen Miller) with little thought given to how it would be implemented. When challenged on it in court, the Trump team responded with an aggressive stance: that courts did not have the power to overrule the president on immigration decisions made in the name of national security.

“Trump is probably even more haphazard and incompetent than some of the people most fearful about his presidency believed”

In a February 9 ruling, the Ninth Circuit Court of Appeals rejected this argument, calling it “contrary to the fundamental structure of our constitutional democracy.” It also upheld a lower court ruling blocking implementation of the travel ban, citing “numerous statements by the president about his intent to implement a ‘Muslim ban’” as reason to believe the policy was motivated by anti-Muslim animus.

After this ruling, the Trump administration rescinded the initial order. It would try again with two other versions of the travel ban, each one more watered down than the last, with mixed legal success. As of today, the third version of the ban is temporarily in effect pending a final Supreme Court decision on its constitutionality.

This episode established that Trump couldn’t get away with any kind of rapid assault on democracy; that courts would check him in cases of clear overreach. It also showed that judges noticed what he said on the campaign trail and in interviews, and that his administration couldn’t push through his more extreme ideas while insisting they were something else.

Trump’s habit of saying what he’s really thinking, combined with his lack of grasp of policy, actually hampered his ability to launch any kind of real power grab.

“I increasingly think that because Trump is so unstrategic about his objectives, he’s unlikely to be able to undermine the system,” says Yascha Mounk, a lecturer at Harvard and author of the book The People vs. Democracy.

“We’ve learned over the last year that Trump is probably even more haphazard and incompetent than some of the people most fearful about his presidency believed, which makes it much more difficult for him to undermine the system,” Mounk adds.

Trump tried, and failed, to make the FBI loyal to him alone

From almost his first day in office, Trump has tried to make the Justice Department into a kind of personal fiefdom.

In a private meeting with FBI Director James Comey in January 2017, Trump said he expected “loyalty” from Comey — at a time when the FBI director was leading a probe into Trump’s alleged ties with Russia. In February, he asked if Comey could “see [his] way” to dropping an investigation into Michael Flynn, Trump’s first national security adviser, who had just been fired after lying about his contacts with the Russian ambassador.

By May, Comey’s continued investigation into the Russia scandal had proved no such loyalty would be on offer — so Trump fired Comey. Experts immediately began warning of a crisis for American democracy; if Trump replaced the FBI director with a loyalist who shut down the Russia probe, that would be a clear sign that he was seizing control of one of the institution best positioned to investigate him.

“This is very common — in semi-authoritarian and authoritarian regimes,” Erica Chenoweth, a professor at the University of Denver, told me at the time of Comey’s firing. “Purges, summary firings, imprisonment: These are all things that authoritarian leaders do when they attempt to rid themselves of rivals within government.”

But things played out differently than many at the time feared.

Instead of appointing a flunky, Trump tapped former Assistant Attorney General Christopher Wray to head the bureau. We don’t know why this happened, but there was an immense amount of pressure from the Senate — which is required to approve any choice — for Trump to pick someone who was well-credentialed and seemed impartial. Despite a growing Republican campaign to paint the FBI as anti-Trump, there is no evidence that Wray has worked to purge the bureau of anti-Trump officials or otherwise interfered with its work for political reasons.

The Russia investigation was handed over to Robert Mueller, the widely respected former head of the FBI, who would serve in a newly created special counsel position. Trump’s efforts to interfere with Mueller’s investigation have so far failed — sometimes due to Trump’s own staff.

Attorney General Jeff Sessions recused himself from supervising the Russia probe due to his own questionable contacts with Russian Ambassador Sergey Kislyak during the campaign. The decision made Trump furious, and caused him to abuse Sessions both in person and in public statements, but it cut off the president’s direct point of control over the Russia investigation.

In June, the New York Times reports, Trump ordered White House counsel Don McGahn to fire Mueller. McGahn said he’d rather resign than do that, and Trump backed down. He was, according to the Times, “concerned that firing the special counsel would incite more questions about whether the White House was trying to obstruct the Russia investigation.”

Mueller carried on with an intense investigation that has already led to the indictment of four individuals linked to the Trump campaign (including Flynn).

Mueller has also requested that Trump himself sit down for an interview; many legal observers see this as a sign that Mueller is closing on an obstruction of justice charge against the president. One of the most likely allegations, per these experts, is that the firing of James Comey constituted unlawful, politically motivated interference with an FBI investigation.

What’s happened over the past year is fairly clear: Trump demanded loyalty from America’s leading law enforcement officials and tried to fire them when it wasn’t provided. This effort failed, which suggests that the FBI is actually working to safeguard American democracy from a rogue president.

The fact that a handful of people — like Mueller, McGahn, and Wray — played such important roles is quite telling. It shows that it’s not just formal legal procedures, like judicial review, that check the president, but a commitment to democracy among American public servants as well.

Political scientists call these beliefs, somewhat fuzzily, “democratic norms:” basic faith in things like the rule of law, separation of powers, freedom of the press, and other basic principles of democratic governance.

In democracies that collapse into authoritarianism, key individuals in the state security services care little about said norms. The fact that the situation is different in the United States — that high-level employees in the Justice Department are troubled by Trump and taking actions to stop him — says a great deal.

The states stopped Trump’s plan to restrict voting rights

When would-be authoritarians get really serious about dismantling democracy, they start changing the rules that govern elections themselves. To continue with the Hungary example, after Orbán’s 2010 landslide victory, his government rebuilt parliamentary districts to give his party a built-in advantage. In the next election, in 2014, Orbán’s Fidesz party got 45 percent of the national vote — and ended up controlling a supermajority in parliament.

Gerrymandering is familiar to Americans, of course, but it happens at the state level. That’s because in the American system, states are in charge of election law.

The Trump administration tried to mess with elections anyway.

In May, Trump announced the formation of the Presidential Advisory Commission on Election Integrity, a national-level organization tasked with investigating claims of widespread voter fraud. There is no evidence to support such claims — the most rigorous research suggests voter fraud is rarer in America than a person being struck by lightning. But many Republicans had raised claims of voter fraud after the 2016 election, including President Trump himself.

Almost immediately, the committee looked like an effort to disenfranchise Democratic-leaning voters. The man tasked with running it, Kansas Secretary of State Kris Kobach, is a Republican famous for writing his state’s extremely strict voting regulation law.

“People in federal government agencies ... aren’t going to have the courage or moral core to stand up to that stuff unless they see that there are millions of people who agree with them”

In June, the committee requested detailed records on all registered voters from every state — including party registration and the last four digits of people’s Social Security numbers. It’s not exactly clear what the commission was planning to do with this information. But 23 states, mostly Republican-leaning, had used allegations of voter fraud to pass voter ID laws that disproportionately disenfranchised minority communities.

Experts worried that the pattern here — a national leader decrying the legitimacy of election results and appointing a partisan to “fix” them — resembled practices of authoritarian leaders in other countries.

Yet a remarkable thing happened: The states said no.

By July 5, my colleague German Lopez reports, 44 states had publicly announced they wouldn’t cooperate with the committee’s request. Some state officials’ responses, even those of Republicans in Deep South states, were astonishingly strong.

“They can go jump in the Gulf of Mexico,” Mississippi Secretary of State Delbert Hosemann, a Republican, said in a statement. “Mississippi residents should celebrate Independence Day and our State’s right to protect the privacy of our citizens by conducting our own electoral processes.”

This resistance by the states crippled the committee. In early January, the Trump administration threw in the towel, quietly disbanding the “electoral integrity” commission via press release. The statement cited the fact that “many states have refused to provide the Presidential Advisory Commission on Election Integrity with basic information relevant to its inquiry” as the key reason.

This is an example of what Yale law professor Heather Gerken calls “uncooperative federalism.” America’s constitutional system gives a huge amount of power to the states, and the federal government needs their cooperation in order to implement major domestic policies. If the states choose not to cooperate, Gerken argues, this could hinder Trump’s agenda.

“The GOP-controlled federal government can’t put cops on every beat or bureaucrats at every desk,” Gerken wrote for Vox. “If blue states and cities refuse to implement Trump’s agenda, Republicans will sometimes be forced to compromise rather than pay a political and fiscal price.”

But what happened here wasn’t just blue-state resistance to Trump on some partisan issue, like renewable energy. This was a much more united front, a hopeful sign for those worried that Republicans would always support Trump’s most undemocratic moves.

“That may be the most convincing positive example,” says Mounk, the Harvard lecturer. “It shows the willingness of all kinds of constituencies to stand up to illicit behavior.”

The people helped save the institutions

There’s another factor that shaped the way American institutions responded to Trump’s policies: mass protest.

The Trump administration saw some of the largest protests in American history. The national Women’s March, held the day after Trump’s inauguration, was the largest single day of protest in American history — roughly 4.2 million people participated nationwide, per an estimate by Chenoweth and the University of Connecticut’s Jeremy Pressman.

This peak hasn’t been matched since, though there were spikes during and after major controversies (like the travel ban, the white supremacist march in Charlottesville, Virginia, and the fight over repealing Obamacare). Nonetheless, Chenoweth and Pressman’s data suggests that there was a surprisingly steady drumbeat of protest throughout the first year of Trump’s presidency, with up to 8 million people attending some kind of anti-Trump event in the past year.

“We have recorded more than 8,700 protests in the United States through Dec. 31, 2017,” they write in a piece summarizing their findings for the Washington Post’s Monkey Cage blog. “The number and size of protests remained fairly stable month to month, except for dips in activity in September and October.”

It can be extremely difficult to measure the effect this kind of mass activism has on restraining Trump’s authoritarian impulses. But when I spoke to Chenoweth over the phone, she emphasized that her own research on how nonviolent resistance can topple governments suggests that it influenced people in positions of power to push back as well.

“People in federal government agencies ... aren’t going to have the courage or moral core to stand up to that stuff unless they see that there are millions of people who agree with them and are willing to put their feet to the pavement,” Chenoweth says.

This is very hard to prove. It makes sense that state-level protests would push governors and secretaries of state away from cooperation with the voting rights commission. It makes sense that protesters holding up signs with slogans like “It’s Mueller Time” would encourage people like McGahn to stick up for the special counsel, fearing the political consequences of doing otherwise. But we’re not likely to get hard proof of either of those things anytime soon.

There is, however, good research suggesting Chenoweth is right.

A 2013 paper published in the Quarterly Journal of Economics attempted to measure the effect that Tea Party activism had on votes in Congress. They found that big Tea Party protests in a legislator’s district made them vote significantly more conservatively.

“Representatives respond to large protests in their district by voting more conservatively in Congress,” the authors write, citing a roughly 12-point drop in one metric of conservative voting for representatives whose districts saw smaller protests.

More broadly, research on why democracies do and don’t slide into authoritarianism buttresses Chenoweth’s argument. Dictators and Democrats, a book by scholars Stephan Haggard and Robert Kaufman, looked at a large data set on modern democracy to analyze what the best predictors of democratic survival were. Mass protest, it turns out, was one of them.

“Institutions are likely to be effective [in stopping authoritarian backsliding] only if they are accompanied by strong social checks on political power: Through opposition parties, interest groups, NGOs, and the threat of contentious politics and mass mobilization,” Haggard and Kaufman write.

This points to a broader story that offers some hope. The Trump administration isn’t just a tale of elite resistance; it’s a story of the American public waking up to a fundamental break with the past, a leader with deeply authoritarian impulses, and rising to the challenge. Mass political participation is the most basic way a democracy can protect itself.

We aren’t out of the woods yet — but early signs are are good

The United States is not, as many feared, on the precipice of becoming Hungary or Vladimir Putin’s Russia.

Democracy here is far more entrenched, the institutions dedicated to protecting it far more established and committed. Americans, both in government and outside of it, genuinely believe in democracy — it’s a vital part of the country’s civic identity. That creates a great deal of natural resistance to authoritarianism, which we’ve seen manifest at every level from judges to executive appointees to the huge numbers of people who turned out for Women’s Marches.

In short, detonating America’s Constitution and replacing it with something authoritarian will take more than electing a president with authoritarian inclinations.

But that doesn’t make it impossible, even in the next few years.

“Nobody thought that in the first year, we’d have a collapse of democracy,” Dan Nexon, a political scientist at Georgetown University, says. “A nightmare scenario ... comes out of political defeat or investigations [or] a crisis.”

“People became conscious of the degree to which democracy is brittle and needs to be defended”

One such instigator could be a 9/11-style terrorist attack. Trump came to power, in part, on Islamophobic demagoguery; an attack by ISIS or al-Qaeda that claims thousands or even hundreds of lives could lead to the kind of crisis that Nexon warns of.

Another would be a mounting crisis over the independence of the Justice Department. On Monday night, the House Intelligence Committee voted to release a controversial memo prepared by Rep. Devin Nunes alleging abuses of surveillance powers during the Russia investigation.

The memo, and weeks of efforts by Congressional Republicans to paint the FBI as having a deep anti-Trump bias, points to perhaps the greatest threat to American democracy — the willingness of Congressional Republicans to help Trump take control of political institutions in order to protect their president and the party more broadly. Levitsky and Ziblatt call this “ideological collusion,” the willingness of powerful political actors to go along with would-be authoritarians to advance their own political goals, and it’s extremely troubling.

We don’t know just how far Republicans would be willing to push this — to the point of actual democratic collapse? — or what Trump would do in a crisis. But we’re nowhere near the collapse of American democracy, and it’s still tough to imagine a chain of events that would get us there.

But it’s only hard to imagine because America’s institutions and citizens have proven themselves to be vigilant. The right lesson of the past year is that panic can be productive.

It’s people’s very faith in democracy — their deep fear for its survival in the face of a genuine threat — that provided the motivation for its defense. If that fear fades, then that defensive front will in turn start to weaken.

“One of the reasons why we’ve been able to contain the worst attacks on our republic so far,” Mounk says, “is that people became conscious of the degree to which democracy is brittle and needs to be defended.”

The state of the union, in short, is indeed strong — but only because we’ve decided it should be.