As a U.S. envoy finalizes a “peace” deal with the Taliban, there is good reason to worry that the deal will hand Afghanistan back to the Islamists.

Here’s one way to judge whether the deal holds promise or peril: Does it betray Afghan women?

If this pact sells out Afghan women, who have made very real progress since the Taliban’s ouster, that will signal more than a U.S. betrayal. It will indicate that the Taliban, with tacit White House acceptance, are en route to restoring harsh Islamic rule. Down that road lies a new Afghan civil war, and a possible return of new variants of ISIS and al-Qaeda.

Like the proverbial canary in the coal mine, any betrayal of Afghan women means U.S. security needs will be sold out as well.

To understand why, you need only listen to the warnings of Fawzia Koofi, a deputy speaker of the Afghan parliament and one of the country’s many amazing female success stories. I spoke with her by phone to Kabul on Friday.

Born in the remote Afghan province of Badakhshan, the 19th of her father’s 23 children, she was put outside to die because she was female, but was rescued by her strong, illiterate mother. The only girl in her family to get an education, she was elected to parliament after the Taliban were overthrown. (I visited her and her two daughters at her Kabul home in 2011; one daughter now studies at Montclair State University in New Jersey.)

Koofi has become a spokeswoman for women’s rights and is determined to protect them. But she fears that the concerns of the Afghan people, including females, are being left out of this U.S.-led peace process. If these interests are ignored, she told me, “this creates the environment for all-out civil war.”

So far, the U.S.-Taliban talks have excluded representatives of the elected Afghan government, because the Taliban refuse to recognize its legitimacy.

The terms of the draft peace accord supposedly call for the Taliban to start talks soon with fellow Afghans, but it is still unclear whom they will talk with, or under what terms.

The signs are ominous. The Taliban team call themselves the Islamic Emirate of Afghanistan, the title they used when they ruled in Kabul. Indeed, they reject the very concept of an Islamic Republic of Afghanistan — the current name of the country — because a republic means Afghans can elect representatives to a parliament and have constitutional rights.

An emirate, on the other hand, connotes an Islamic state based on sharia law, and the Taliban hope they can reinstate that. They are aware of how eager President Donald Trump is to quit Afghanistan, which encourages them to believe they can regain to power.

Koofi’s personal experience provides little optimism that the Taliban are willing to make political compromises. She participated in three informal Afghan meetings with Taliban officials in Moscow and Qatar. “They pretend to change,” she says, "but we have to watch carefully. I tried to tell them you can’t take Afghanistan back to when they were ruling. But they use words that make us worry.”

For example, when she pressed them on female education, they said “according to Islam,” which could mean religious education only. When she asked for clarification, they only said there could be no coeducation, which is already the case in Afghanistan through high school. But at college level, she says, “we haven’t enough teachers for separate education.”

The Taliban were similarly vague when it came to the rights of women to work. Koofi asked them, “Will you respect international human rights principles?” Their response: “Such rights contradict Islam.”

If the Taliban refuse to negotiate with government officials from the Afghan republic — along with representatives of wider civil society, including women — Koofi fears a new civil war may be looming.

Here is where the terms of the prospective U.S.-Taliban document really become key.

The deal reportedly focuses mainly on the Taliban’s demand that all U.S. forces leave Afghanistan, in return for Taliban guarantees that they will prevent a renewed al-Qaeda or ISIS from emerging in territory they control.

Intra-Afghan talks are supposed to begin before a complete withdrawal of 14,000 U.S. troops, but they will be lengthy. If the U.S. troop presence, and U.S. aid, evaporate too soon, the talks will falter. The Taliban will push for victory.

So the key question is the timeline for U.S. withdrawal, and whether it will call for all U.S. troops to exit before 2020 elections. President Trump has waffled, at times urging a speedy withdrawal, then saying some troops will remain; but he has reportedly told aides he wants them all out soon.

“If the international community leaves,” says Koofi, “there are no guarantees.”

It is not just women’s rights that are threatened. “My concern is that terrorist networks will start operating again,” she argues.

In other words, the fate of Afghan women and U.S. security needs are bound together, and depend on the terms of this peace document. A politicized U.S. troop withdrawal will severely damage both.