As the new Syria struggles to take shape, old threats are re-emerging.
The chaos since the overthrow of Bashar al-Assad is "paving the way" for the so-called Islamic State (IS) to make a comeback, according to a leading Kurdish commander who helped defeat the jihadist group in Syria in 2019. He says the comeback has already begun.
"Activity by Daesh [IS] has increased significantly, and the danger of a resurgence had doubled', according to General Mazloum Abdi, commander of the Syrian Democratic Forces (SDF), a mainly Kurdish militia alliance backed by the US. "They now have more capabilities and more opportunities."
He says that IS militants have seized some arms and ammunition left behind by Syrian regime troops, according to intelligence reports.
And he warns there is "a real threat" that the militants will try to break into SDF-run prisons here in north-east Syria, which are holding about 10,000 of their men. The SDF is also holding about 50,000 of their family members in camps.
Our interview with the general was late at night, at a location we can't disclose.
He welcomed the fall of the Assad regime - which detained him four times. But he looked weary and admitted to frustration at the prospect of fighting old battles once again.
"We fought against them [IS] and paid 12,000 souls," he said, referring to the SDF's losses. "I think at some level we will have to go back to where we were before."
The risk of an IS resurgence is heightened, he says, because the SDF is coming under increasing attacks from neighbouring Turkey - and rebel factions it supports - and must divert some fighters to that battle. He tells us the SDF has had to stop counter terrorism operations against IS, and hundreds of prison guards - from a force of thousands - have returned home to defend their villages.
Ankara views the SDF as an extension of the PKK - banned Kurdish separatists who have waged an insurgency for decades, and are classed as terrorists by the US, and the EU. It has long wanted a 30km "buffer zone" in the Kurdish region in northeastern Syria. Since Assad's fall, it is pushing harder to get it.
"The number one threat is now Turkey because its airstrikes are killing our forces," said General Abdi. "These attacks must stop, because they are distracting us from focusing on the security of the detention centres," he said, "though we will always do our best."
Inside Al-Sina, the largest prison for IS detainees, we saw the layers of security and felt the tension among the staff.
The former educational institute in the city of Al- Hasakah holds about 5,000 men - suspected fighters or supporters of IS.
Every cell door is padlocked and secured with three bolts. The corridors are divided into sections by heavy iron gates. The guards are masked, with batons in hand. Getting access here is rare.
We were allowed a glimpse inside two cells but could not speak to the men inside. They were told we were journalists and were given the option of hiding their faces. Few did. Most sat silently on blankets and thin mattresses. Two men paced the floor.
Kurdish security sources say most of the prisoners in Al-Sina were with IS until its last stand and were deeply committed to its ideology.
We were taken to meet a 28-year-old detainee - thin and softly spoken - who did not want to be named. He said he was speaking freely, though on the key issues he wouldn't say much.
He told us he left his native Australia at the age of 19, to visit his grandmother in Cyprus.
"From there, one thing led to another," he said, "and I ended up in Aleppo." He claimed he was working with an NGO in the city of Raqqa when IS took over.
I asked if he had blood on his hands, and was involved with killing anyone? "No, I wasn't," he replied, barely audibly.
And did he support what IS was doing? "I don't wish to answer that question because it might have an effect on my case," he replied.
He hopes to get back to Australia one day, though he's unsure if he will be welcome.
There is hope too behind the wire of Roj camp - about three hours' drive away - that freedom is coming. Somehow.
This bleak expanse of tents - ringed by walls, fences and watch towers - is home to almost 3,000 women and children. They have never been tried or convicted but they are the families of IS fighters and supporters.
There are several British women in the camp. We met three of them, briefly. All said they had been told by their lawyers not to speak.
In a windswept corner we came across a woman willing to talk - Saida Temirbulatova, 47, a former tax inspector from Dagestan. Her nine-year-old son, Ali, stood quietly by her side. She hopes the overthrow of Assad will mean freedom for them both.
"The new leader Ahmed al-Sharaa [the head of the Islamist group Hayat Tahrir al-Sham] made an address, saying he will give everyone their freedom. We also want freedom. We want to leave, most likely for Russia. It's the only country that will take us."
The camp manager tells us that others believe IS will come to their rescue and break them out. She asked us not to use her name as she fears for her safety.
"Since the fall of Assad, the camp is calm. Typically, when it's this quiet, it means the women are organising themselves," she said. "They have packed their bags ready to go. They say: 'We will get out of this camp soon and renew ourselves. We will come back again as IS.'"
She says there's a visible change, even in the children, who chant slogans and swear at passersby. "They say: 'We will come back and get you. It [IS] is coming soon.'"
During our time in the camp many children raised the index finger of their right hands. This gesture is used by all Muslims in daily prayer, but it's also widely used by IS militants in propaganda images.
The women in Roj camp aren't the only ones packing their bags.
Some Kurdish civilians in the city of Al-Hasakah are doing the same - fearing a comeback by the jihadis and another ground offensive by Turkey in north-eastern Syria.
Jewan,24, who teaches English, is getting ready to go - reluctantly.
"I have packed my bag, and I am preparing my ID and my important documents, "he tells me. "I don't want to leave my home and my memories, but we are all living in a state of constant fear. The Turks are threatening us, and the doors are open for IS. They can attack their jails. They can do whatever they want."
Jewan was displaced once before from the north-western city of Aleppo, at the start of Syria's civil war in 2011. He is wondering where to go, this time.
"The situation demands urgent international intervention to protect civilians," he says. I ask if he thinks it will come. "No," he replies softly. But he asks me to mention his plea.
Additional reporting by Michael Steininger and Matthew Goddard