Prisons are for to protect the innocent from people who’ve hurt them and would do it again. Intentionally or unintentionally, the original punishment for being in prison is the lost of freedom and going through strict security requirements like keeping weapons out of the prison. But prisons aren’t suppose to be torture chambers especially in a Liberal-Democracy and even for people who are serving life in prison. But there to keep criminals behind bars until they’ve paid their debt and society, as well as showing they can be successful legally once they are out of prison. Prisons should be a productive place for the staff, the inmates where they can benefit from their time behind bars. That benefits society as well but prisons most importantly should benefit the people who pay for them.
So a productive prison system would be a system where people enter as criminals but leave as people with the skills to succeed successfully on the outside. And now have given up their criminal careers because they simply no longer need to be criminals in order to survive and no longer want to hurt people. That means having rules that protects the staff as well as inmates and sanctions for inmates as well as staff for when they break the rules. But not torture but you broke a rule and there’s a price to pay for that but we aren’t going to do anything to you to make you worst then you already are. That even includes solitary confinement for inmates who attack other inmates and staff. But isolation should be there to make those inmates betters not to torture them and make them harder to deal with.
So in a humane prison, inmates are following the rules, making good use of their time. By educating themselves and using those skills to get a good job while in prison but doing a good job in prison. Contributing to their cost of living and even to their victims and family and once they leave prison they now have the skills to succeed on the outside.