As we absorb the horrifying details of Thursday’s terrorist attacks at the Kabul airport, our first thoughts are with the victims, their families, and all the other Americans and Afghans who are still in danger. We don’t yet know exactly who perpetrated this outrage and what it means for our already chaotic withdrawal and evacuation from Afghanistan.

Even so, it was clear before the attack that extremist groups in Afghanistan and other places are organized, capable and continue to wish us harm. That means the most important question is not whether we have ended “the forever wars.” The premier consideration in national security decision-making should still be: What’s the best way to keep our country and our people safe?

Some will say that Thursday’s attack was possible only because our troops were there in the first place. But that is too easy. The Islamist militants have shown before that they will strike us wherever they can. Unfortunately, leaving Afghanistan will not diminish their willingness to attack us. All it does is weaken our ability to protect ourselves.

The attacks also throw into sharp relief the reality that we can’t depend on the Taliban to bring stability and security to Afghanistan or help us keep a lid on other terrorist groups such as the Islamic State (which is claiming credit for the latest attacks). Now that we’ve withdrawn virtually all of our troops from Afghanistan, our ability to monitor and stage operations against terrorists there is greatly diminished. Indeed, that’s what President Biden himself believed, until recently.

In October 2019, after President Donald Trump approved a mission that killed Islamic State leader Abu Bakr al-Baghdadi, then-candidate Biden told me in an interview he believed national security decisions must not be made based on abstract phrases such as “the forever wars.” He also said that withdrawing troops precipitously was unwise.

“The death of [Baghdadi] is proof in the wisdom of the strategy, that without committing our troops to endless wars, you can still in fact protect our interests and the interests of friends and allies,” Biden said. “You need people on the ground. You need allies on the ground.”

For Biden, who has decades of foreign policy experience, the true measure of a decision like pulling out troops from a dangerous place was how it affected U.S. national security. He told me there was a crucial difference between small counterterrorism forces and large troop deployments aimed at nation-building.

Biden told me he had worked hard to keep some U.S. troops in Iraq in 2011 and later felt sadly vindicated when we had to return in 2014 when the Islamic State took over. Biden said that, if elected, he intended to continue negotiating with the Taliban in Afghanistan (as Trump did), aiming to secure real commitments if he drew down.

“But I would not be just unilaterally at this point pulling everybody out and announcing it ahead of time,” Biden told me.

Biden appears to have discarded that view. These days he sounds much more like a strong opponent of “forever wars,” embracing the support of a previously marginalized sector of the D.C. foreign policy establishment. Many suspect that Biden’s new alliance with the neo-isolationists is more a matter of political expediency than an actual conversion.

Biden got fed up, rightly, with a Washington establishment that perennially asked for more money and more time to achieve an overly ambitious goal in Afghanistan, Rep. Tom Malinowski (D-N.J.) told me. The political case for leaving was sound. The national security case for staying was unpopular.

“We were going to do something important but not satisfying: maintain a long-term project with a problematic government to maintain a fragile progress and avoid a catastrophe,” Malinowski said. “But this was never presented in honest terms.”

But if we cast aside all the abstract language about endless wars, hubris and imperial overreach, Malinowski said, we should be able to do a simple cost-benefit analysis of our current security position. The troops the United States withdrew from Afghanistan aren’t coming home — they’re just moving to other foreign bases in the region. They will retain the mission to fight terrorism in Afghanistan, he said, just from farther away and with no local partner.

Yes, the United States will save billions by not arming the Afghan National Army (problematic partner that it was). But now we face the costs of dealing with the fallout, which already includes caring for tens of thousands of new refugees. The United States undermined its credibility with its allies, damaged its ability to earn the trust of future local partners and abandoned millions of innocent people it professed to care about to a cruel fate. Meanwhile, Taliban-ruled Afghanistan is already becoming a haven for terrorist groups of all stripes.

“There’s no good way to lose a war,” Biden’s new progressive foreign policy supporters say. True, our side lost the Afghan civil war. But the larger war, the terrorists’ war on us, is not over. The enemy is determined to go on fighting. And now we have to fight back from a weaker position.