ok imma start with your use of the word 'should'. these days i find the word almost completely useless. of course there are many ways to use any word, for instance 'should' is often used to refer to likelihood; i.e. 'that should work'. in your question however, 'should' seems to imply a questioning of what is 'correct', or 'right', 'righteous', what 'duties' and 'obligations' we have etc. i do not think there is any such thing as 'correct' action, there are only situations, and what i choose to do in response. can i reflect on the past, analyse past situations, my responses to them, and the new situation that my response helped creat? of course i can, and through this i can inform my responses to future situations. however what i cannot, and can never do is ascertain whether the action i chose was 'correct' or 'right', in any non-personal sense. the concepts of 'correct', 'obligation' etc are abstractions that must be constructed from experience. they cannot be experienced directly, at least i never have, and as such these concepts remain utterly personal, more so than other experiences that is. similar issues surround the word 'justifiable'. it seems you want some sort of universal, non-personal 'justifiable', but the fact is that every person is going to view 'justifiable' different. you just need to read isis, or police statements after one of their killings goes public to see evidence of this.
now onto the question proper; do prisons keep us safe from others who have caused harm? no, i would not say that they do. indeed, i find the wording of the question very interesting. 'do prisons keep us safe' is in the present tense, with 'caused harm' in past tense. clearly you dont mean that the prisons can keep us safe from 'past' events; imprisoning someone cannot reverse a murder, assault, rape etc. i think a fair understanding of your question is simply 'do prisons keep us safe?', or perhaps 'do prisons help make us safer?', the tense being that of the present and future. the 'from people who have cause harm' seems a concession to the fact that people are put in prison because they are perceived by the justice system to be a likely source of harm, usually because they have been convicted of some act that is thought of as harmful. basically 'do prisons keep us safe from others who are likely to cause harm?' my answer to this is still no.
how the legal system views harm is not necessarily compatible with what i think of as harmful. there are many behaviours i think are harmful that the legal system does not target, and many behaviours the legal system targets that i dont think are harmful. i reckon the average black dude imprisoned for possessing cannabis is not nearly as harmful any one of the politicians, lawyers, or policemen that put him there. an even for he things that are illegal, the punishments are far more severe for those at the bottom of the economic ladder than for those at the top. some bloke who murders someone will get put away for a long while, but arms manufactures, negligent pharmaceutical companies, or even just people who price hike food and life-saving medicine will likely never even be near a cell. that is until they cheat rich people out of there money, then they go away for fraud. and we havent even considered police and state violence yet. the criminal justice system is not about protecting the public, its about maintaining the control of current power structures. it does not put the people with the power and incentive to cause large scale harm behind bars, the military, the government, corporate leaders etc. because they are the people that benefit from the prison system. just my two cents.