Aaron David Miller, a former Middle East analyst at the State Department and adviser in Republican and Democratic administrations, is a vice president and director of the Middle East program at the Woodrow Wilson International Center for Scholars . Steven Simon is visiting professor of history at Amherst College. He served on the NSC and in the State Department in five administrations and is co-author of "The Age of Sacred Terror." Richard Sokolsky, currently a non-resident senior fellow at the Carnegie Endowment for International Peace, was a member of the Secretary of State's Policy Planning Office from 2005-2015 and served in the State Department in six administrations. The views expressed here are solely that of the authors. Read more opinion on CNN.

(CNN) Reports that US and Taliban negotiators have reached a tentative framework for withdrawing American forces from Afghanistan have set the foreign policy establishment's hair on fire. A former US ambassador described the putative deal with the Taliban as a "surrender."

Make no mistake, if it is done in a precipitous and haphazard manner, there are risks to a withdrawal -- especially if it is without the cooperation of other regional powers with a stake in a peaceful and stable Afghanistan. Important details need to be worked out in US talks with the Taliban and the Afghan government. But even if these things cannot be agreed on -- and it's likely they won't -- the US should still withdraw. We can protect our core interest in Afghanistan -- counter-terrorism against transnational terror groups -- without maintaining thousands of boots on the ground or any kind of permanent US presence on Afghan territory after our troops leave.

The creation of a well-functioning, stable, secure Afghan central government, led by moderate and pro-democratic forces, has been magical thinking for years now.

Although US officials will not publicly admit it, for the past several years the US has defined winning as not losing, which means hoping we can train the Afghan military to keep Kabul and the shrinking territory controlled by the central government out of the hands of the Taliban. But this goal is unachievable, whether US forces leave or stay another 18 years or longer.

To meet this limited objective, the US needs to have a credible, reliable and effective Afghan political and military partner. And Pakistan has to stop giving sanctuary to insurgent forces. The opponents of withdrawal have no viable "theory of victory" for not losing except offering more of the same.

Analogies to Vietnam, made by those who categorize America's pulling out of the area in 1973 as a "surrender," are misleading. In reality, the Nixon administration negotiated a settlement and the withdrawal of US forces precisely because it knew America was in a pointless and unwinnable war. The US had no credible South Vietnamese partner and couldn't eliminate enemy forces in sanctuaries in neighboring countries. South Vietnam fell two years later, but all the other dire predictions about what would follow a US withdrawal -- for example, "falling dominoes" (the common term used to describe the prediction that states in southeast Asia and beyond would rapidly collapse in the wake of an American defeat) -- never materialized and the damage to American credibility was minimal.

Staying in a war that cannot be won doesn't demonstrate resolve but rather a failure to grasp reality. It also leads to tragic and unnecessary US deaths. Since the US formally ended its combat role in 2014, 42 Americans have been killed in Afghanistan, according to a report from the New York Times.

One American dying in a seemingly endless war where we cannot achieve any of our goals is one too many. The Pentagon estimates that the war in Afghanistan is also costing it $45 billion a year.

This cost, projected over an indefinite period, may be affordable in the context of a country with a $19 trillion GDP and an annual defense expenditure of over $600 billion for the last 16 years.

JUST WATCHED Afghan MP: I'm very worried for women's rights Replay More Videos ... MUST WATCH Afghan MP: I'm very worried for women's rights 06:47

But this argument ignores the potential opportunity costs of siphoning off these resources from more urgent and achievable purposes.

Opponents of withdrawal also argue Jihadists will fill the vacuum left by departing US troops. There is no gainsaying this risk if Afghanistan comes under Taliban control. But the probability of an attack coming out of Afghanistan that causes serious damage on the scale of 9/11 is remote.

What emerged from Afghanistan in 2001 was more of an idea, than an operation. The personnel, training, and detailed planning originated or transpired from outside Afghanistan. Bin Laden is dead, al Qaeda is a shadow of its former self in Afghanistan, and the Islamic State is mostly located in Iraq and Syria. From FY 2001 to FY 2019, according to a study from the Watson Institute for International and Public Affairs at Brown University, the US has spent close to over $900 billion on homeland security —apart from military, intelligence, law enforcement and foreign aid—and it is better defended than it has ever been.

We will never be risk-free from homegrown terrorists and Islamic extremists who are inspired by Jihadist ideology. But we are far safer than ever before from the kinds of attacks that might be hatched in an Afghan cave or Pakistani villa. Moreover, the US can take steps -- if necessary, unilaterally -- to mitigate the risks of a resurgent al Qaeda presence.

A withdrawal from Afghanistan will likely entail the loss of the kind of intelligence that ground troops can acquire from interrogation of prisoners, capture of documents and computers, and local scuttlebutt. This shortfall will not be easily offset, although the US can try by establishing an intelligence channel to the Taliban, who will not want to see the US return and might well perceive enemies of the US as a danger to themselves.

There will always be means to kill individuals that the US regards as a serious threat, especially with the increasing range and loiter time of advanced drones armed with precision weapons and with cruise missiles and aircraft based outside of Afghanistan. Once in Afghan airspace, US platforms will be virtually unchallengeable and highly lethal. The US also has experience in deploying special forces over long distances into hostile territory to carry out targeted kill or capture operations (as we saw with the death of Osama bin Laden). The intelligence requirements for these operations will be challenging but can be met, and some will require the assistance of friendly third countries. Conducting counter-terrorism operations from a distance will not be as effective as those conducted on land in Afghanistan, but they should be able to reduce the risk to an acceptable level at far less cost. In any case, the fact is jihadists do not need a safe haven in Afghanistan to hurt us.

Stay up to date... Sign up for our new newsletter. Join us on Twitter and Facebook

The US can't make Afghanistan a coherent functional state with rule of law, gender equality, and respect for human rights, no matter how many troops or additional dollars we throw at this challenge. It is sad and tragic that we promised more in Afghanistan than we could deliver—and that in the eyes of the Afghan people, women in particular, the US has abandoned them. But that's no reason to stay in a never-ending war. What we could not accomplish with over 100,000 US forces -- the maximum number deployed in 2010 -- we certainly cannot with the 14,000 now in the country.

It's neither pretty, satisfying nor politically convenient to admit. But it's time to let go of America's 18-year Afghan war.