A man locked up on secret charges in Canberra's prison had his cell and brother's house raided after jail authorities told police about a memoir he had written behind bars.
The manuscript, the prisoner said, was part of a mental health recovery plan devised with a nurse when he first entered prison and was an account exploring parts of his time in jail.
But a red flag was raised when a local Canberra author booked in to see the man in a prison visit.
The man's case is shrouded in secrecy.
Prison authorities do not know the exact nature of the charges against him, nor the details of a set of strict Commonwealth orders governing the case except that they barred the sharing of information about the prisoner and the offences for which he was convicted.
The man himself, referred to in a recent court judgement as Alan Johns, did not know the exact nature of the Commonwealth orders. And because of the nature of the offences, as well as the orders, he was able to have only limited contact with family and friends.
But light has been shone through a small window of the case after Mr Johns took action against the prison in the ACT Supreme Court arguing an abuse of power, after prison management told police about the manuscript and how he had sent it to his family.
When the man started his sentence, the Australian Federal Police, charged with supervising the orders, had asked the Alexander Maconochie Centre to inform it if anything came up that might suggest a risk the orders were to be breached.
In February, a Canberra-based author who was not on Mr Johns' approved list of visitors, booked in to see the prisoner.
The prison's general manager Corinne Justason, aware of the existence of the Commonwealth orders though not their detail, alerted the AFP, which had concerns the new visitor appeared to be a writer.
The request was refused.
During these conversations, Ms Justason asked the AFP if it knew Mr Johns had been writing a manuscript and sending it to his family via the prison email system. The sending of the manuscript had been previously accepted by her predecessor, the court heard.
The AFP requested and was sent a copy of the most recent manuscript. A few days later, the prison restricted Mr Johns' prison email access. The AFP raided his brother's home, then Mr Johns' cell and the prison's email server.
Mr Johns was due for release in August but took action against the jail in July, arguing that Ms Justason's decision to tell the AFP that he had written and sent a manuscript to his brother was an improper exercise of power.
The man, who represented himself, said among other matters that Ms Justason had failed to take into account the mental health recovery plan in which he had been set a goal of writing and submitting three manuscripts, and his letter to her clearly explaining that the manuscript was uncontroversial. The court heard he had written a second novel length manuscript described as "an alternative history fiction novel".
But in a decision published on Monday, Justice John Burns dismissed the man's application, finding the prison was not in breach of any statutory obligation and there was no abuse of power.
Given the prison authorities were not privy to the orders, it was not for Ms Justason to determine if the memoir breached the orders, he said. He found her concerns about a potential breach were not "unreasonably held".
Mr Johns had also complained that it was an abuse of power when the prison took action against him by withdrawing his email privileges. But Justice Burns rejected this complaint too. The prison had a wide discretion when it came to privileges, and in this case the withdrawal was not arbitrary but in response to concerns about the manuscript.
Justice Burns also observed there would have been no point ordering the prison to lift restrictions on his email access, given the prisoner had since been released.
The judge dismissed the man's application and ordered he pay the prison's costs.