'The Taliban have committed, to our satisfaction, to do what is necessary that would prevent Afghanistan from ever becoming a platform for international terrorist groups or individuals," said Zalmay Khalilzad, the US official in charge of Afghanistan peace talks, last month.
So why didn't the United States have this discussion with the Taliban 17 years ago, in October 2001?
The American representative has just spent six days negotiating with the Taliban in Qatar, and he has their promise they will never let terrorist groups like al-Qaeda or Islamic State use Afghanistan as a base.
The Taliban are Islamists and nationalists (despite the incompatibility of these two principles), but they were never international terrorists.
The next steps are setting dates for the final American withdrawal from Afghanistan (in around 18 months) and opening direct talks between the US-backed Afghan government and the Taliban. There is still much to do, but this could work.
So congratulations to Donald Trump - and shame on the Washington analysts and experts who could never bring themselves to recommend just ending America's longest-ever war. Some of them are the same people who didn't realise 17 years ago that these talks should have happened then.
The US invasion of Afghanistan in October 2001 was always about 9/11 and nothing else.
The country was targeted because the Taliban, who had come to power five years before, had allowed Osama bin Laden and his Islamist extremists to set up a base in Afghanistan, and they were assumed to be implicated in the horrendous attacks on New York and Washington.
That assumption was almost certainly wrong. The Taliban had come to power in 1996 after a 10-year war against the Soviet invaders and the seven-year civil war that followed. They had been a long time out in the hills, and they were really enjoying power.
What the Taliban did in power was both ridiculous and atrocious - they drove women from public life and closed girls' schools; they made men grow beards and women wear burqas; they banned music, movies and television.
They mutilated people for small offences and executed them for slightly bigger ones (most of which were not offences at all in other Muslim countries).
And they took absolutely no interest in the rest of the world. Under the Taliban, Afghanistan really didn't have a foreign policy at all.
But the leader of the regime, Mullah Omar, was a personal friend of Osama bin Laden, whom he had met in Pakistan in the 1980s when both men were involved in the war against the Soviet occupation.
So when bin Laden was forced out of his refuge in Sudan by the Clinton administration in 1996, Omar let him set up camp in southern Afghanistan - and told him not to carry out political activities on Afghan soil.
Bin Laden abused that hospitality, and approved the 9/11 attacks from there (the actual planning was mostly done in Germany).
Most Taliban would have been outraged by the mortal danger bin Laden was exposing them to.
Could the US have persuaded the Taliban to hand bin Laden over in order not to be invaded and driven from power? Maybe you couldn't have persuaded Mullah Omar, but many of the younger leaders were really not looking forward to being bombed out of the cities and chased back into the hills.
And if they don't listen right away, spread some money around. You can't buy religious fanatics, but you can sometimes rent them if you find the right words to go with the money.
Why wasn't it at least tried? Probably because there was a strong need to "kick ass" in the United States.
Such a horrible crime couldn't be answered with mere diplomacy and legal proceedings. What was needed was bloody vengeance and catharsis. So Afghanistan got invaded, and several hundred thousand people died in the next 17 years.
And since it has always been very easy to invade Afghanistan (though almost impossible to stay there), one invasion didn't provide enough catharsis. Thirty months later George W Bush also invaded Iraq, although there were no terrorists there (and no weapons of mass destruction), and hundreds of thousands more died.
And now they are finally negotiating the very same deal with the Taliban that could probably have been made in 2001. It would have saved a lot of time.
Gwynne Dyer's new book is Growing Pains: The Future of Democracy (and Work)