Corrections has been breaking the law by gassing prisoners in their cells with a special type of pepper spray called the Cell Buster.
The ruling has come from the High Court.
The Cell Buster is made by an American company and marketed under the tagline Making Grown Men Cry Since 1975.
It involves hosing pepper spray into a closed cell to incapacitate the inmate.
It was used multiple times against Mihi Bassett and Karma Cripps at Auckland Women's Prison in 2019 and the two women took legal action against the Attorney General.
Guyon Espiner has been looking at the judge's ruling in the case and spoke to Morning Report.