A prisoner who suffers severe social phobia is challenging a prison governor's refusal to let him complete his jail term under curfew at home.
The inmate, referred to as PA for legal reasons, is serving a three-year sentence at Lewes Prison, East Sussex, for attacking his son in 2009.
His lawyers said jail was the "worst possible environment" for him.
Rosemary Davidson, appearing for the governor, said her client's decision was "properly considered".
The High Court in central London was told PA, who is in his mid-20s and fears contact with people, "has not been out for fresh air or exercise for over a year".
'Intense and debilitating'
His barrister, Elizabeth Prochaska, said his condition was such that he could no longer manage eye contact with his mother.
She said he was was unable to share a cell, did not shower, struggled to go and get food and was being housed in the prison's vulnerable prisoners wing.
Mr Justice Burnett was told that a consultant psychiatrist had described PA's condition as "one of the most intense and debilitating" he had seen.
Ms Prochaska said he did not want to finish his term in an open prison because he would have more contact with people and had self-harmed when a transfer was suggested.
She claimed the governor was unlawfully refusing to exercise his discretion to release PA on home detention curfew.
PA, from the Brighton area, was jailed for three years after pleading guilty to grievous bodily harm and cruelty to his infant child.
The governor is arguing that he is entitled not to order the release based on the evidence before him.
'Disability not exceptional'
Ms Davidson said the governor's decision was "reasonable and properly considered" and PA's legal challenge should be dismissed.
She added: "He has taken account of all available information in reaching what is a very finely balanced and difficult decision.
"He has considered all the relevant facts he needs to consider."
The court was also told that a report by a forensic psychiatrist concluded PA's disability was not "exceptional".
Mr Justice Burnett has reserved his judgement until at least next week.