Is prison part of the problem or part of the solution?

For society increasingly concerned with managing and reducing risk ,is prison part of the problem or part of the solution?