After months of negotiation, Zalmay Khalilzad, President Trump’s special envoy for Afghanistan, announced that he and the Taliban had agreed on a “framework” for a peace deal. While not formalized, the framework would have the United States withdraw from Afghanistan and the Taliban guarantee to allow no terrorist group to use Afghan territory to strike at America. For Trump and many of his supporters, eager to extricate the U.S. from its longest war, it will suffice.

The problem, however, is that such an agreement has been tried before — and it culminated in the Sept. 11 terror attacks.

First in Commentary Magazine and then in Dancing with the Devil (a history of U.S. diplomacy with rogue regimes and terrorist groups), I outlined the sorry history of past U.S. negotiation with the Taliban. The conventional wisdom that the U.S. turned its back on Afghanistan after the Mujahideen victory over the Soviet Union is wrong. Declassified documents show that, during the Clinton administration, U.S. officials and the Taliban met on more than 30 different occasions. The meetings were not limited to low-level officials. In 1998, for example, Clinton Cabinet member and United Nations Ambassador Bill Richardson met with the Taliban ambassador. Richardson, who in personality and manner is much like Khalilzad, promptly announced that he had achieved a breakthrough to end the ongoing Afghanistan civil war. Needless to say, that conflict has continued to this day.

The broader problem, however, is the shape of the deal Khalilzad proposes making and which Trump apparently wants: Twenty years ago, Amir Khan Mottaqi, the Taliban’s acting Minister of Islam and Culture, assured a visiting State Department peace team led by Assistant Secretary of State Karl Inderfurth that the Taliban would not “allow terrorists to use Afghanistan as a base for terrorism.” After years of engagement with and chaos in Afghanistan, that was music to the Clinton administration’s ears. They were willing to accept on paper what they realized was incongruous with reality.

The price? Al Qaeda leader Osama Bin Laden having carte blanche to plan their Sept. 11, 2001, operation.

Khalilzad, of course, should know better. It was Khalilzad, at the time just a Reagan-era veteran of the State Department, who sought to cultivate the Taliban for the sake of his business interests. Just as years later he would leapfrog from his government position in Iraq to delve in deep into Kurdish oil, at the time he hoped to use the Afghan connections he had established to enable a trans-Afghan oil pipeline. In 1997, he worked with the California-based oil company UNOCAL (which merged into Chevron in 2005) to bring the Taliban to the United States where they were met not by junior diplomats, but by Inderfurth. Those talks, too, went nowhere, though the Taliban were remarkably honest at the time with regard to their desire to disenfranchise women.

Certainly, of anyone, Khalilzad should understand the Taliban and their duplicity. He appears not to have acknowledged where he went wrong in his choice of previous allies and, like too many senior American diplomats, has an inflated sense of the power of his own words. That said, by appointing Khalilzad to lead these talks, Trump found someone willing to accept the Taliban at face value and someone who, at least in the past with regard to Afghanistan and Iraq, has been willing to allow the promise of business opportunities to cloud diplomatic judgment.

The point is that Washington once before settled for the same deal now laid before it. At the very minimum, it behooves Khalilzad and Trump to explain why they believe that the Taliban, emboldened by what they see as the defeat of the U.S., would any more honor their word now than 20 years ago.

That is not to say the U.S. needs to remain in Afghanistan into perpetuity. From Sept. 11 to the present, the problem has always been filling the vacuum in Afghanistan so that terrorists do not fill it. The question then becomes: What strategy does the Trump administration have to fill that vacuum? The answer, alas, is the Taliban and their minders in Pakistan, the same country that hid and hosted Bin Laden.

If the Taliban were truly Afghan nationalist, after all, they would not subordinate their country’s interests to those of their dysfunctional neighbor. Let’s call the Khalilzad plan what it is: A recipe for disaster. Trump may believe he has fulfilled a campaign promise. What he has done in reality is lay the groundwork for a terrorist attack which will shape his legacy long after he has left office.

Michael Rubin (@Mrubin1971) is a contributor to the Washington Examiner's Beltway Confidential blog. He is a resident scholar at the American Enterprise Institute and a former Pentagon official.