Footage has been released to RNZ of the attack on Corrections officers at Auckland prison which led to a mass strip search in 2016.
The strip search of 209 prisoners over two days in October 2016was at the centre of a court case at the High Court in Auckland last month where high profile prisoners Arthur Taylor and Phillip John Smith argued it was unlawful.
But the prison staff union, the Corrections Association, said officers faced threats, violence and intimidation every day and the search was the only way of finding any weapons.
The video released by Justice Peters and screened in court shows how on 19 October, 2016, two corrections officers took a mop and bucket to the security door at the entrance to prisoners' cells in a section of C block - a maximum security area at Paremoremo.
When the grate was opened, four prisoners jumped out with home-made weapons strapped to their fists and six officers were hurt, Corrections Association national vice president Paul Dennehy said.
"Initially the staff thought they were just being punched, in fact they were being stabbed and because the weapons were strapped to the prisoner's hands it wasn't very easy for the staff to disarm them."
Within a minute of the attack several officers arrived to help.
An officer stumbled to the floor with stab wounds to the head, which needed hospital attention.
Within two minutes of the attack, two of the four inmates were separated, controlled and surrounded by officers.
Over the next two days the East Divison went into lockdown and 209 prisoners were strip searched.
Corrections told the court it was a pre-meditated, gang-related attack by prisoners drunk on home-brew.
It argued the strip search was justified because the gang had contacts across the prison and other inmates may also have had weapons - or shanks - made from prison-issued televisions.
But Taylor and Smith told the court there was no reason to strip search everyone.
They said there was no proof either of them were concealing contraband and therefore, legally, there were no grounds for them to be strip searched.
Nothing was found on them.
The court heard it was unclear what, if anything, was found from the strip searches of the other prisoners also because clear records were not kept.
But staff backed Corrections' order for cell and strip searches, Mr Dennehy said.
"The improvised weapons that prisoners use and used don't necessarily have to include any element of metal at all - they can be sharpened plastic," he said.
"So there are times when we won't discover a weapon by using a metal detector or a scanner and it will only be through searching - strip searching, cell searching - that we will uncover the weapons to hand."
Minister of Corrections Kelvin Davis would not comment on the case but in a statement said he expected the department to manage risk but also respect prisoners' dignity.
Union worried if justice finds in favour of prisoners
It was difficult for people to understand what staff went through every day, Mr Dennehy said.
"The threats and the violence and the intimidation that we face on a daily basis ... not just the custodial [staff], [but] our case managers, our health staff, our instructors, our admin people," he said.
Justice Peters reserved her judgement in Taylor and Smith's case.
But Mr Dennehy said he worried what the consequences would be if the judge was to find in favour of the prisoners and said the searches were "vital" in ensuring everyone's safety.
"If the ruling goes against the department that will just lead to a more dangerous environment because prisoners will feel able to carry weapons more frequently and that will just heighten the risk to prisoners and staff."
Meanwhile, the Corrections Amendment Bill, which is at Select Committee stage, had a provision to use imaging technology, such as body scanners, in prisons to avoid strip searches.
In its first reading in Parliament late last month, government MP Stuart Nash said the new technology would be effective and afford more dignity to prisoners.
"This change will help keep prisons free from drugs and weapons, making them safer places for staff, visitors, and prisoners, and, at the same time, will make them more humane places."
Green Party justice spokesperson Golriz Ghahraman said it was a human rights issue with mass strip searches being used "to prevent risk rather than assessing whether the risk is actually there".