Let’s not celebrate the transfer of power to President-elect Joe Biden just yet, but instead look at two risks that could still allow President Trump to obstruct a smooth transition: massive social unrest at home that Trump could argue represents a domestic insurrection, and a war abroad where he could invoke his extraordinary powers as commander in chief.

Thankfully, both explosive scenarios seem unlikely, now that Trump has accepted the start of a formal transition process by the General Services Administration. Biden appears headed for the White House on Jan. 20 and is preparing to govern. But with Trump, it’s always wise to imagine worst-case possibilities and think carefully about how to prevent them. Forewarned is forearmed.

Trump’s behavior since he lost the Nov. 3 election has been chilling. Rather than concede defeat, he and his loyalists now control the “power ministries” of government: defense, the intelligence agencies, in addition to supporters who control justice and homeland security. If this were another country, we would worry that a leader who installed his lieutenants in these command posts after losing an election might be preparing a coup.

America’s greatest moment of vulnerability will be from now to Dec. 14, when the electoral college meets to ratify the voters’ decisions. Analysts have imagined various scenarios for how Trump might evade the archaic electoral college process, but these strategies are unlikely to succeed without the pretext of an additional crisis. So, let’s look carefully at the twin dangers, domestic and foreign, and how they might be defused.

We know Trump considered invoking the Insurrection Act of 1807 against his domestic enemies once before, back in June, when racial justice protests were spreading after the death of George Floyd. He was talked out of it by Gen. Mark A. Milley, chairman of the Joint Chiefs of Staff, and Defense Secretary Mark T. Esper. Trump never forgave Esper and finally “terminated” him in a tweet on Nov. 9.

Over the past two weeks, Trump has been installing a team of super-loyalists at the Pentagon, now headed by acting defense secretary Christopher C. Miller. What’s their mission? We don’t know, but it’s safe to say they would be more likely than Esper to support a Trump call to use the military — either at home in response to social unrest or abroad in armed conflict.

Here’s where it gets scary: On Dec. 12, two days before the electoral college meets, Trump supporters plan to gather for a mass rally at the Lincoln Memorial. The National Park Service has already granted them a permit, according to local reports. The last such rally, touted as a “Million MAGA March” on Nov. 14, drew only several thousand Trump supporters. But they were confronted by a few hundred counterprotesters, and when night fell, the anti-Trump forces “triggered . . . mayhem as they harassed Trump’s advocates,” according to The Post.

The Dec. 12 rally will probably draw a larger pro-Trump crowd, and if counter-protests become violent again, that could give Trump the excuse he may want to claim his opponents have staged a rebellion. The Biden team should be thinking now how to convey a firm message: Keep cool. Don’t take the bait.

Let’s imagine the grimmest scenario. Trump claims that violent protests are “insurrection, or obstruction to the laws,” as the 1807 statute put it, and orders active-duty troops to intervene. Such an order would go first to Miller, the acting defense secretary. Next in the chain of command would be Air Force Gen. Glen D. VanHerck, who heads Northern Command, which oversees U.S. forces in North America.

Milley, as the president’s chief military adviser, might question the order, but his job as JCS chairman is to communicate such presidential directives; he isn’t actually in the chain of command. Would Milley transmit or VanHerck obey such an order? Let’s hope not.

Now consider the other upheaval that could undermine an orderly transfer of power or leave a huge mess for Biden. Trump remains commander in chief until Jan. 20. According to the New York Times, he requested military options for attacking Iran at a White House meeting Nov. 12. Again, Milley talked Trump out of any rash action, backed by Secretary of State Mike Pompeo and other senior officials.

But what if there’s a provocation? Suppose one of the Iranian-back Shiite militias in Iraq fires missiles that kill U.S. troops in Baghdad? Or Hezbollah in Lebanon launches missiles that kill Israelis? Or North Korea’s Kim Jong Un launches . . . Well, you get the point. The president retaliates; war ensues; the president takes action against dissenters. It’s speculation, but it’s not impossible.

Trump wouldn’t succeed if he tried to cling to power. We know that because — well, because every responsible political leader, and, indeed, every citizen, will make sure it never happens. Still, thinking about the unthinkable can help us avoid it.

Read more: