I'd add a third scenario, vengeance.
You're talking about exile now, which I also think is justified. But now you've got to consider, is it just to put someone in a cage with monsters? If it's not just to kill someone for being bad to those around them, it's certainly not just to lock them in a cage with people who will prey on them, that's more akin to torture.
If someone is damaged in some way to the point where they present mortal danger to those around them, it is unjust to subject anyone to that behavior, even another like them.
I have some very unpopular views on this topic, and some popular ones, but I've thought a lot about it and I think I understand pretty clearly what a just justice system would look like, and it doesn't preclude the death penalty, or other corporal punishment, but it does preclude prison.