Willesliel Taylor, aged 20, was in his cell at HMP Doncaster when the two officers came to deliver his afternoon meal.
As they opened the door, they were met by Taylor, who had an improvised bladed article.Taylor then punched one officer in the face, causing him to fall backwards, and continued to stab and punch his colleague.
Both officers, assisted by another colleague, then tried to restrain Taylor but were punched and slashed several times in the process.
Other staff then arrived, and Taylor was brought under control.
It was at this time that two of the officers realised the extent of the injuries they had sustained.
As a result of the attack on March 25, 2020, one officer suffered a deep, four-inch cut to his neck, bruising and cuts to various other parts of his body.
The other officer, who was assisting his colleague, suffered several deep cuts and injuries to his head and face.
Detective Constable Jon White, in charge of this investigation, said: “Firstly, I would like to commend the bravery of the officers involved. If it wasn’t for their immediate actions, this could have easily been a murder investigation.
"It was a shocking attack on them and I’m pleased Taylor is facing the consequences. Nobody should go to work and experience this level of violence.
"Prison officers are there to offer support and security to inmates, and we will not tolerate incidents such as this, that put them at risk.”
Taylor, of London, was in HMP Doncaster, serving a ten-year six-month sentence for wounding, robbery and weapons-related offences.
On October 14, he was sentenced to nine years in prison after pleading guilty to two counts of section 18 assault and possession of a pointed article in prison at Sheffield Crown Court.
The sentence will be served concurrently with his original sentence.