Joe Biden will become the fourth president to navigate the chaos in Afghanistan since 9/11. The Taliban remain a potent, vicious fighting force. ISIS has established a presence. The economy is now as it has been for the duration of the 19-year conflict — in tatters. Corruption remains the rule, not the exception.

And yet, Biden inherits peace talks that show glints of progress. U.S. Gen. Mark Milley, chairman of the Joint Chiefs of Staff, met with Taliban leaders in Doha, Qatar, in December, a meeting steeped in symbolism: America's top general meeting with leaders of the militant group that safeguarded al-Qaida leader Osama bin Laden before 9/11, and fought America in what has become the country's longest-running war.

Setting the stage for Milley's appearance in Doha was President Donald Trump's deal with the Taliban for the withdrawal of U.S. troops from Afghanistan, if the militant group agreed to sever its ties with al-Qaida, never let the country become a springboard for attacks against the West again and participate in peace talks with Afghanistan's current government.

Milley stressed one more condition. The Taliban must dial down ongoing violence that kills Afghan civilians and security forces and threatens America's remaining 4,000 troops. "Everything else hinges on that," Milley said afterward.

Biden inherits a conflict that needs reframing. Gone are the days when America endeavored to rebuild Afghanistan from top to bottom. Any remaining contingent of U.S. troops in Afghanistan won't be deployed to wage combat. They'll serve as a bulwark against any resurgence of al-Qaida or ISIS. American troops are also part of a larger NATO force tasked with the crucial mission of training Afghan security forces.

Trump's postelection decision to, by Jan. 15, dramatically scale back the number of U.S. troops in the country to a contingent of just 2,500 complicates the task for Biden. Trump still wants to portray himself as the leader who, unlike his two predecessors, finally got American soldiers out of the Afghan quagmire.

Initially, he thought about pulling every last American service member out of the country. That kind of thinking flies in the face of advice from his own top military brass, which recommended the bottom-line troop level should be 4,500.

Perhaps Biden's most challenging task will be ensuring that the Taliban's pledges during peace talks, slated to resume this week between the militant group's leaders and Afghan officials, aren't just words.

How will the new administration make sure that the Taliban indeed decouples from al-Qaida, and keeps the country from ever again becoming a haven for anti-West terrorism? Will a peace pact include, as it should and must, a commitment to protecting women's rights? The Taliban's notorious record with respect to the treatment of women includes banning women from going to school, working or leaving home without a male chaperone. Women who broke the rules were flogged.

Biden is right to set "ending forever wars" as a key foreign policy goal. Achieving that goal, however, must not forsake American ideals and interests — and it must not forsake the future of everyday Afghans who deserve a stable, enduring peace.

FROM AN EDITORIAL IN THE CHICAGO TRIBUNE