The sentences of hundreds of prisoners could be affected by a court ruling that they have not had a fair chance to show they are safe for release.
Some prisoners are not getting proper assessments, judges ruled
The Court of Appeal found that Justice Secretary Jack Straw acted unlawfully by not providing some inmates with access to courses needed for parole.
The ruling came after two offenders challenged their continued detention under "indeterminate sentences".
Judges also found the parole system was not independent enough from government.
The Court of Appeal ruling on indeterminate sentences for public protection (IPP) - under which offenders must prove they are safe for release - came after an appeal by two prisoners - sex offender David Walker and Brett James, jailed for causing grievous bodily harm - last year.
The Court of Appeal ruled there had been "systematic failure" on the part of Mr Straw to put the resources in place to allow such offenders access to rehabilitation courses - such as anger management and alcohol awareness - needed to prepare for Parole Board assessments.
The court warned that if prisoners were detained for a long time beyond their minimum tariff without regular review, they may have to be released.
But the appeal judges threw out an earlier High Court finding that the detention of IPP prisoners after the expiry of the minimum jail term was unlawful.
The two prisoners in this case will therefore continue to be detained even though their tariff expired last year.
Home affairs correspondent Danny Shaw said the ruling was a "final warning" to Mr Straw that he must get resources in place so those on indeterminate sentences had a chance of making their case to the Parole Board.
Walker, who was given an indeterminate sentence with a minimum tariff which expired in October last year, successfully argued in his appeal in July he could not be considered for release because his jail did not offer a parole course.
His lawyers said he was therefore being subjected to arbitrary detention in breach of his human rights.
Appeal judges at the time ruled in his favour and have now rejected an appeal by the Ministry of Justice against the decision.
However, the appeal court allowed the Secretary of State's appeal over the second prisoner, James, whose sentence expired in July last year.
The Lord Chief Justice told the court the two cases "demonstrated an unhappy state of affairs".
Four of the Securitas depot robbers were given indeterminate sentences
"There has been a systematic failure on the part of the Secretary of State to put in place the resources necessary to implement the scheme of rehabilitation necessary to enable the relevant provision of the [Criminal Justice Act] to function as intended," Lord Phillips said.
In 2005, the government introduced "indeterminate prison sentences" to ensure that dangerous offenders remained in prison until the Parole Board assessed them as safe for release.
On Tuesday four of the five men found guilty of the £53m raid on Tonbridge Securitas depot were given indeterminate sentences after the judge decided they would need to be assessed to see if they posed a danger to the public before release.
According to Parole Board figures, there are currently 3,000 IPP prisoners and 50 new ones every month. Some 500 offenders are still in prison even though their minimum term has expired.
A spokeswoman for the Ministry of Justice said Mr Straw was seeking leave to appeal against the court's ruling he breached his duty with regard to IPP offenders.
She added that while prisons needed to provide "the right courses, programmes and training", the ultimate responsibility for satisfying the Parole Board that a prisoner's level of risk was reduced "rests with the offender".
Change of role
In a separate ruling, the appeal judges upheld an earlier High Court decision that the Parole Board in England and Wales did not comply with the human rights of offenders because it lacked the independence from ministers required to make prisoner release decisions.
Rejecting another appeal by Jack Straw, Lord Phillips said the High Court's findings that the board lacked independence were "fully supported" by the evidence.
The cause of the problem, he said, had been the change of function of the Parole Board.
It had been transformed from being an organisation which advised the Secretary of State over prisoner release, to that of a judicial body which decided whether offenders could be released if judged safe, the court was told.
Geoff Dobson, deputy director of the Prison Reform Trust, welcomed the ruling saying the Parole Board should be "independent and located within the court system".
A spokesman for the Ministry of Justice said the department was "disappointed" by the judgment and was considering whether to appeal.
He added: "This judgement will not result in any prisoner being released earlier than otherwise had been the case.
"Neither does it open the way for offenders to seek to apply for compensation."