Khaled Sharrouf: released and unrepentant. Take the first approach, and extremism could fester within an inmate for years. When the reinforced steel door of his cell is pushed open, he is unleashed on the world, unrepentant and determined to avoid being caught again. Think Islamic State barbarian Khaled Sharrouf, who posted photos on social media of his son holding the severed head of an enemy. Take the second, and you could be allowing a svengali to move through prison units, whispering his untruths to the vulnerable, letting his radicalism infect others. Like the Algerian-born Abdul Nacer Benbrika, the first Australian to be convicted of leading a terrorist group, who has twisted the minds of two generations of local extremists. Or maybe, regardless of the approach, but with careful monitoring and access to treatment, a former extremist can be safely freed. Like Mazen Touma, the most recently released convicted terrorist in Australia, who authorities are convinced is reformed and has become "a constructive member of the community". This is the grand experiment taking place in Australia's prisons, and, indeed, in prisons across the world. How can you jail extremists without creating more terrorists?

Abdul Nacer Benbrika: isolated from other inmates. The beginning of a challenge At about 2.30am on November 8, 2005, heavily-armed police in Melbourne and Sydney huddled outside the doors of men linked to two terrorist cells. The largest terrorism operation in Australian history, Operation Pendennis, was about to begin. As investigators built their case against the Pendennis accused, Australian prison authorities tried to work out what to do with the 22 men who were charged. Mazen Touma: "a constructive member of the community".

It was the first time so many accused terrorists had to be imprisoned, and there had been little preparation. The approach had to fit somewhere between how the Bush administration handled suspects in Guantanamo Bay and the way Australian authorities handled low-security inmates. The Olearia Unit at Barwon Prison is the highest security unit in Victoria, and opened last year. But should it be used for convicted terrorists? Credit:Jason South But there were significant holes in what authorities knew about the Pendennis accused, making it difficult to assess the risk; it was unclear, for example, whether they were important enough to al-Qaeda for the terrorist group to consider breaking them out. Both states settled on similar models: the accused would be clustered together in prison and treated as high-security inmates, complete with onerous conditions regarding their cells, communications, visits, exercise and movements to court.

Australia's approach had to fit somewhere between how the Bush administration handled suspects in Guantanamo Bay and the way Australian authorities handled low-security inmates. Credit:Jason South But in March 2008, Corrections Victoria were ordered to pull back. The Supreme Court ruled that the men were being treated so inhumanely in Barwon Prison that it endangered their right to a fair trial. One of the men collapsed in a prison van that reached 50 degrees; the accused were often kept alone in their cells for more than 20 hours a day; and they were regularly strip-searched, despite being under constant surveillance. Their treatment either had to be drastically altered or they had to be released on bail, Justice Bernard Bongiorno ruled. There was no such ruling in NSW.

By the following August, when another significant terror plot was uncovered - a plan to attack Holsworthy Barracks, an army training base in Sydney's outer south-west - Victoria had moved away from holding inmates accused or convicted of terrorist offences in the same prison unit. The current method - spreading these inmates through the prison system, reasoning that interaction with others will break the hold of radicalism - was born. The gap between the two states has been widening ever since. To Supermax or not to Supermax? There are now almost 60 inmates suspected or convicted of terrorist activity in Australia, with 35 in Supermax alone, and several others in juvenile and women's prisons in NSW.

There are 20 in Victoria, all of whom are men, two men in Queensland and one woman in South Australia. But while the numbers in custody have increased in the past decade - and particularly since 2014 - there is no consensus on how to deal with them. This June, the NSW government announced it was effectively doubling down on its approach: it would build a $47 million prison within a prison, exclusively for extremists, that could hold 54 inmates and will be finished next year. The reaction to the Supermax II announcement spoke volumes about the uncertainty surrounding extremists in prison. "If we isolate or separate inmates that are either young or have the possibility to change, then we might be compounding the issues that got them there in the first place." Credit:Jason South

Federal Minister for Immigration and Border Protection Peter Dutton commended the NSW government. "We don't want people within the prison environment being indoctrinated, being converted into a radical form of Islam," he said. Attorney-General George Brandis was more guarded, saying it would work "so long as the way these prisons are designed and configured doesn't mean the terrorists are together in each other's company, reinforcing each other's ideology". A few days before the announcement, Victorian Premier Daniel Andrews - in clear contrast to the model adopted in his state for almost a decade - told COAG he wanted a federal prison built for terrorism offenders. Earlier that week, Yacqub Khayre - who had been charged but found not guilty in relation to the Holsworthy plot - had murdered a man, taken a woman hostage and shot at police during a terrorist siege in Brighton. Despite the fact Khayre was not a convicted terrorist, he was seen as an example of what could go wrong when authorities mismanaged extremists.

'They would pose a very high risk' Experts and authorities agree that the sample size of jailed Australian extremists is too small to draw conclusions about what has worked. There are case studies more illuminative, however, than that of Khayre: the 18 men convicted of their role in the Pendennis plot. These men remain in the cells of Barwon Prison and Supermax, are living in the outer suburbs of Melbourne and Sydney, or died amidst the rubble of Raqqa. Seven are in prison, the majority of whom are considered to retain extremist beliefs. Benbrika is considered an influence so troubling that lawyers and academics say he is the catalyst for hardline federal laws passed in recent years to control terrorists, including the post-sentence detention scheme and powers to deport extremists with dual nationalities.

The others in custody are in Supermax: Mohamed Ali Elomar, Abdul Rakib Hasan, Khaled Cheikho, Moustafa Cheikho, Mohammed Omar Jamal and Omar Baladjam. NSW Corrective Services commissioner Peter Severin is open about the challenges posed by those serving terrorism sentences. "If they would be finishing their sentence tomorrow they would pose a very high risk to national security," he says. "There would be a number that would clearly be of great concern to us. " Three of the Pendennis group are suspected to have died in the Middle East after joining Islamic State: Sharrouf, Ezzit Raad and Amer Haddara. At least two others - Fadal Sayadi and Shane Kent - are reported to have had their passports cancelled, and Ahmed Raad, Ezzit's brother, is suspected of acting as an IS recruiter.

Of the five others, three are understood to be no longer considered a risk. One of these is Touma, who was released on parole earlier this year after serving a 12-year sentence. But even Touma's success comes with a qualification, in terms of its relevance to the extremists who will be released in his wake. As Deakin University academic Greg Barton puts it, al-Qaeda did not want people who could not be controlled, but IS actively sought out the very same people. It means that even in cases of redemption, such as Touma, the ground is constantly shifting. That is without even considering that many of his co-accused went into prison inspired by al-Qaeda and then changed their allegiance to IS. Touma was also the only Pendennis offender who was not automatically released on parole under federal laws that have since been overhauled.

Touma's deradicalisation worked, essentially, by using the discipline attached to his al-Qaeda training for good, not evil, Severin says. Severin monitored Touma closely for 4½ years prior to his release. "We didn't let him do a lot of work in the community but we allowed him to do quite a lot of work on our correctional precinct in all sorts of areas, he had a bit of a position of trust at some stage and he never misused that. "I think that builds a bit of self-esteem and it also builds the ability to plan constructively for future goals, or set future goals, and then there was family. "The combination of all of that - and fundamentally, of course, his decision not to do it anymore - resulted in him now becoming quite, as I understand it ... a constructive member of the community."

The possibility of change The Touma case appears to underline what Clarke Jones, an expert on prison radicalisation at the Australian National University, describes as the possibility for change. That possibility is not presented when you lock extremists in with other extremists, but when they are encouraged to think differently, he argues. "I'm concerned that if we isolate or separate inmates that are either young or have the possibility to change, then we might be compounding the issues that got them there in the first place," he says. "We don't want to create stigma, alienation or any excuse to allow them to continue a violent extremist belief system."

In Victoria, the success of deradicalisation efforts is inseparably linked to the Community Integrated Support Program, which involves partnering sheikhs or imams with extremists or those with radical views. That program - which Khayre had participated in - was seen as compromised in August when the Islamic Council of Victoria confirmed it would no longer support it, instead allocating resources to other measures. But police and prison sources, and community groups, remain bullish about its future. Corrections Victoria deputy commissioner Rod Wise, who has worked within the prison system for more than three decades, says local issues and experiences with extremists across Australia and internationally were used to frame the Victorian approach. In the US and Germany, most jailed extremists are right-wing or neo-Nazis, meaning experiences there are less relevant to Australia. In Britain, so-called "jihadi jails", that are similar to the Supermax II proposal, started opening in July. Three units built in existing prisons will eventually hold 28 inmates, and signify a move, in rudimentary terms, away from the Victorian model towards that used in NSW.

Belgium has also moved towards this model in the past year, in a move dubbed "Guantanimisation" by a local prison advocate. Should Victoria also reconsider and embrace the NSW model, Wise says they have a prison unit capable of doing so: Barwon Prison's 40-bed Olearia unit. But there are no plans to do so. It is more a case of tweaks and keeping a close watch on emerging trends, he says. An exercise yard at the Olearia Unit at Barwon Prison. Credit:Jason South But a training program has been developed for prison guards to help them tell the difference between a devout convert and someone who has become radicalised, Wise says.

Severin says that the model in NSW will move somewhat towards Victoria. But he also expected changes in Victoria that would bring it closer to the NSW model. Part of this, he says, is due to extremists in NSW being part of larger criminal networks, a trend now being seen in Victoria. It makes it difficult, for example, to know whether the armed robber who shares a prison unit with an extremist also happens to be a relative or associate. "I would never ever say only one approach works," Severin says. "I'm as much in favour of centralisation [of inmates] as I am of dispersal." Wise would not be drawn on comparisons with NSW, and the possibility of Victoria moving towards centralisation, but says that: "A lot of the terrorists we have seen in Victoria are not so different to other offenders - including poor educational abilities, poor job prospects and low self-esteem." 'What is the purpose behind jail?'

It has been 12 years since the Pendennis accused spent their first night in prison, and Australian authorities were forced to confront the issue of how to imprison extremists. What will the next 12 years bring? Wissam Haddad, the founder of Brothers Behind Bars, a charity that supports Muslims in prison and their families, thinks the NSW model will lead to a new generation of extremists. The charity has not been without controversy, given Haddad and co-founder Junaid Thorne are considered by authorities to encourage a hardline interpretation of Islam, but there is no question it is uniquely placed to gauge the impact of the prison system on inmates. "Keeping an animal in a cage for that long, they're not going to come out normal. Whether they're radicalised or not." Credit:Jason South

"If you isolate someone, it's not good for them, or for anyone else. What is the purpose behind jail? Is it to rehabilitate them or to punish them? We need to ask what jail is for. "Keeping an animal in a cage for that long, they're not going to come out normal. Whether they're radicalised or not."