As President Donald Trump madly denies defeat while ignoring a raging pandemic, it’s hard to focus on dangers from abroad.

But, even as Trump is dumping a COVID-19 disaster into President-elect Joe Biden’s lap, he’s planting mines aimed at shredding Biden’s foreign-policy options, on Iran, Iraq, Afghanistan, and elsewhere.

One such mine is Trump’s decision to reduce U.S. troops in Afghanistan from around 5,000 to 2,500 just before he leaves office, a move strongly opposed by the military and by former Defense Secretary Mark Esper. As usual, Trump’s decision appears driven by politics — his campaign pledge to end “forever wars” — but is divorced from any strategic thinking.

The withdrawal undermines any slim chance for negotiations between the Afghan government and the Taliban, under a peace plan godfathered by the White House. The last U.S. troops are starting to leave before the Islamists concede anything at all.

» READ MORE: Will the U.S. betray Afghan women in talks with the Taliban? | Trudy Rubin

Down that road lies the reestablishment of an Islamic emirate that will crush the rights of Afghan women and most Afghans, while likely tolerating the regrowth of al-Qaeda and ISIS. To prevent this disaster from occurring on Biden’s watch will require the incoming administration to reframe its thinking about “ending forever wars.”

That slogan, of course, has an attractive ring after two decades of inconclusive wars in Iraq and Afghanistan. Yet, with only small numbers of U.S. troops remaining in Afghanistan, and local U.S.-trained armies doing most of the fighting, one has to question whether we are still talking of “war” or of something else.

It is Afghan soldiers who are now taking almost all the casualties while other NATO nations had roughly the same number of forces in the country as the United States as of last June. The U.S. provides critical air support, intelligence, logistics, and training.

Of course, Biden, too, has promised “to end the forever wars.” Yet ending U.S. involvement doesn’t mean that the threats posed by terrorists in those countries are over. We all recall when President Barack Obama pulled all U.S. troops out of Iraq in 2011 (a plan set in motion by President George W. Bush in 2008). That opened the door for the ISIS caliphate and the return of 5,000 U.S. troops to push them back.

So it makes sense when Biden says he still supports a small U.S. military mission that would work with local troops in Afghanistan to prevent a resurgence of Islamist terrorism. But that raises two important questions:

First, how many troops do you need to convince the bad guys and the region that you are serious, and not ready to quit on a tweet’s notice? Most military experts I’ve asked regard 2,500 troops as too small to do much but protect themselves and other U.S. citizens in Kabul, but say the present number would be sufficient.

And, second, how do you redefine the mission to adequately describe your goal?

In the case of Afghanistan, says a former U.S. ambassador to Kabul and Baghdad, Ryan Crocker, a small mission providing training and air support to Afghan fighters “is a pretty cheap insurance policy” against a Taliban takeover. In other words, a preventative, not a war.

“The Afghans need our support and our and NATO partners’ money,” Crocker told me. A continued U.S. presence would be a hedge against the kind of upheaval and instability we saw during the rise of ISIS, when the upheaval in Iraq and Syria didn’t stay there. Millions of refugees fled to Europe, and terrorists gained a foothold from Asia to Africa to Europe.

Many middle-class Afghans, and members of the large Shiite minority are already thinking of fleeing, because they fear a U.S. exit will embolden the hard-line Sunni Taliban to repress or kill them. None believe the Taliban will fulfill their pledge to keep al-Qaeda or ISIS insurgents in check if they regain power.

Biden will be under pressure from progressives not to reverse the Trump-scheduled withdrawal and to bring all troops home. Let diplomats do the job, the argument will go. Aid to Afghan women can continue no matter who’s in charge in Kabul. The Taliban will be more willing to compromise if U.S. troops leave, and Afghanistan’s neighbors can negotiate a peace if the Americans are gone.

» READ MORE: Will Trump sell out Afghan women and U.S. security? | Trudy Rubin

Would that these arguments held water. They don’t.

If the number of U.S. troops shrinks so sharply they’re seen to be heading for the exits, NATO forces will leave, too. The Taliban will have free rein.

Under siege, U.S. diplomats will be drawn down, their work diminished, their leverage gone. And the Taliban have made clear they still want to end schooling for girls (except for limited rote Islamic learning) along with most work for women.

As for Afghanistan’s neighbors, little help from that direction. Pakistan will continue to support the Taliban. China, cares not whether Islamists persecute women, but is eager build roads and extract minerals, whoever reigns in Kabul.

Either the Taliban will take over, or the country will sink into total chaos. Down that road lie growing Islamist security threats that eventually suck the United States back in.

So the incoming Biden administration would be wise to invest in an Afghanistan insurance policy and make the reasons clear to the public. Such a move would have strong bipartisan support in Congress, which is already trying to block Trump’s drawdown. No one should want to see a Taliban triumph on Biden’s watch.