The phenomenon of Donald Trump shook many people out of the complacent belief that our democracy was functioning smoothly. But once Trump is out of office, there is a danger that a narrative will emerge celebrating how well the guardrails of our system ultimately performed — despite Trump’s demagoguery. Already, hints of this story are evident: “The U.S. Election System Worked,” argued two scholars in an article published just two days after Election Day. In the Economist, Harvard Law School’s Jack Goldsmith observed — in an otherwise sobering account — that “the most remarkable fact about [Trump’s] presidency is how well the American constitutional system stood up to and survived it.”

Despite Trump’s disrespect for the rule of law, the narrative might go, the courts functioned, the press remained free, and — knock on wood — we’ll see a peaceful transition of power. Democracy will have defeated Trump’s authoritarian impulses.

One problem with this story is that Trump revealed how many of the guardrails of our democracy are built on norms rather than on law, and he made clear the limits of the constraining effect of norms. These norms include a basic level of honesty by public officials (so that voters can make informed decisions) and a respect for democratic outcomes by those who lose elections. In ignoring these and other baseline assumptions of the U.S. political system, Trump has not only sown doubt and division in the country but also opened the way for others to do the same.

Trump was a serial liar throughout his presidency, and he and his allies launched an especially vigorous disinformation campaign in the wake of the election, claiming without evidence that there had been massive voter fraud and that the election had been “stolen” from him. Even though courts and election officials — Republican and Democratic — have consistently rejected these claims, millions of Americans believe them.

In an earlier period of our history, traditional news sources might have served as an important guardrail against a flagrantly dishonest president — as they did, for example, during Watergate. But Trump undercut this check throughout his presidency by constantly labeling unfavorable information as “fake news” and by relying on conservative media outlets to offer voters an alternate reality more favorable to him.

Trump’s ability to distort the truth has been abetted by the rise of social media and the general disaggregation of information outlets, diminishing the influence of traditional news sources. Indeed, even though the media highlighted and documented countless acts of dishonesty and abuse of power by Trump throughout his presidency, he still managed to receive more than 73 million votes.

In years past, one might also have expected members of Congress — especially moderate members of the president’s party — to check a president’s excesses. But moderate members of Congress are a dying breed, and extreme partisanship is the new reality. Republican legislators in general have lived in constant fear that Trump would direct his wrath and retribution at them should they publicly question his conduct — and that they would pay a price at the polls. Faced with the possibility of losing party support, many chose silence.

Trump’s presidency has revealed the limitations of other institutional guardrails, as well. Many people had high hopes that Robert S. Mueller III, acting as special counsel, would get to the bottom of Russia’s efforts to interfere with the 2016 election and the Trump campaign’s potential connections to those efforts. But Mueller was hampered by constraints on his team’s ability to gather information, due to, among other things, Trump’s refusal to be interviewed. And because of existing Department of Justice policy, Mueller also felt bound not to consider whether the president was guilty of a crime. While Mueller’s report nevertheless contained damaging information, including about obstruction of justice, this information was misrepresented by Trump’s attorney general before it was released to the public and distorted by Trump and his allies in Congress.

Impeachment is the ultimate constitutional tool for dealing with a corrupt executive. The Democratic-controlled House tried to apply this guardrail after it emerged that Trump had tried to coerce a foreign leader to develop fake dirt on Trump’s chief political opponent, a gross abuse of power. The House indeed impeached him, but partisanship again prevailed in the Senate — a body that, in 2020, seems a far cry from what Alexander Hamilton described in the “Federalist” as a tribunal that would have the “necessary impartiality” to pass judgment on a president’s conduct. Trump not only weathered the impeachment storm but became politically stronger as a result. Impeachment does not seem like much of a limitation on the executive in today’s politically polarized environment.

It has been clear for some time that another test for the system would be whether Trump would accept the election results if he lost. Even now, weeks after the election, the answer is no. Another test was whether Republicans would pressure him to concede defeat; again the answer is no, or at least not very much. Indeed, initially a number of key Republicans in Congress affirmatively supported Trump’s baseless claims of election fraud. Many Republicans have finally begun to accept the reality of Trump’s election loss, but only after weeks of waiting while Trump probed for ways to overturn the result.

Trump’s attempt to reverse the election’s outcome through lawsuits, a blizzard of conspiracy theories, and the recruitment of allies in state legislatures has not succeeded, but not because the system is incorruptible. Trump’s litigation team was especially inept, but a future Trump may have more skilled representation. Trump also faced an almost impossible task of reversing the outcomes in several states, but imagine if the election had been a bit closer and it had come down to just one or two states, or if there had been more plausible disputes about the accuracy of the vote counts. Faced with pressure by Trump’s allies, some state officials like Georgia Secretary of State Brad Raffensperger (a Republican) held firm in defending the counts, but — as the behavior of many Senate Republicans makes clear — such courage and character are not guaranteed, especially given the death threats and career consequences that principled Republican state officials are experiencing now.

A decisive number of state officials in Michigan and elsewhere declined to take Trump up on his invitation to block or delay certification of the election results, and they have resisted his suggestion that they seat alternative electors. But there is nothing in our system that completely rules out such end runs around the democratic process. A few key individuals respected the norms that make our democracy work — this time. But other officials might make a different choice next time, particularly if they are installed in order to make a different choice next time.

The lesson from all of this cannot possibly be how effectively the guardrails of democracy have performed. The lesson, rather, is how narrowly our nation escaped disaster. We have been fortunate that Trump’s malevolence and corruption have been tempered by his incompetence, but we should not let the preservation of our democracy rest on luck. We must strengthen the guardrails of our democracy before a more skilled demagogue comes along and steals a presidential election with the help of enough strategically positioned state officials to do his bidding.