Indonesia has to manage its war against terror on two fronts, security experts say.
One is to prevent local militants returning from the Middle East after fighting alongside the Islamic State in Iraq and Syria (ISIS) from spreading their extremist ideology back home. The second is to ensure that those who have served time in jail for terrorism do not relapse.
While the attention in recent weeks has fallen on Indonesians said to have returned after joining ISIS, failing on either front may have a devastating effect on a country which has suffered more than a dozen terrorists attacks in the last 15 years, including the Bali bombings that killed 202 people in 2002.
At least 40 former terrorist convicts have returned to militancy within two to three years of parole in Indonesia, said counter-terrorism and security expert Susan Sim.
"The numbers obviously do not tell the full story and in any case are debatable since there is no nationwide database in Indonesia," she told The Straits Times yesterday. "What should give cause for concern is what these recidivists have been doing."
Her research has shown that in recent years five were killed in shoot-outs with police, at least one is known to have joined ISIS in Syria, while several others started or joined new extremist groups that have been targeting police officers.
The militants include Abu Wardah, better known as Santoso, the head of the East Indonesia Mujahidin (MIT), who has been behind several terror attacks since 2012.
Two recidivists have become ideologues who have sworn allegiance to ISIS, and still exert influence in extremist circles with their jailhouse publications.
More than 600 Indonesians, previously jailed for terror-related activities, have been freed after serving time in prison, said national counter-terrorism chief Saud Usman Nasution. He told The Jakarta Post recently that Indonesia has a "big job to do", keeping tabs on these former terrorists.
Ms Sim, a former intelligence analyst and now a vice-president (Asia) at New York-based The Soufan Group, has also studied prison dynamics and terrorist recidivism in Indonesia.
She said it is no secret that prisons are a weak link in Indonesia's counter-terrorism efforts.
"Rarely does ideological change take place in Indonesian prisons. Hardcore terrorists see being in prison as a break from their day job," said Ms Sim. "They make sure other inmates continue to accept that... violence against the enemies of Islam is legitimate."
The forces driving released prisoners back to militancy are not unlike those faced by convicts in general - for instance, the lack of a second chance. "Many released terrorists have no choice but to associate with friends from their former networks, leaving them susceptible to recruitment again."
ISIS has a far wider reach today, thanks to the Internet, where it has used social media both to sow fear among its enemies and to lure recruits to join their cause.
Ms Sim said that in Indonesia, where extremist groups are fairly well-entrenched, the fighters returning from Syria will be considered too precious a resource to be left alone, as they will have experience and skills currently in short supply.
"In other words, returning fighters will be the reality TV version of the conflict videos that were used to radicalise a generation of Indonesian militants in the pre-9/11 era," she said. "It will take a very determined returnee to walk away from the adulation that the jihadi community at large will throw at him."