You may well be right, unlearner, but I was making a distinction between prisons and penitentiaries, which were intended to produce repentance. Regardless, you’re certainly correct that prisons existed even before the Mosaic Law.
Thanks for your response!
Ancient Israel also had “sanctuary cities” as directed by the Torah. They weren’t specifically for immigrants or visitors but were part of the legal / judicial system for those accused of murder but may have killed someone by accident or even in self-defense.