http://revach.net/article.php?id=1820

Section: Halacha   Category: Tshuvos
Putting Someone in Jail On Shabbos
The Shulchan Aruch paskens (OC 339:4) that you cannot judge someone on Shabbos.  The Rema says that based on this you cannot put someone in jail on Shabbos even if it means that he will escape before Motza'ei Shabbos.  The Mishna Brura (14) says that if a person may run away and cause his wife to become an Aguna where she cannot remarry then it is permissible to lock him up to make sure he doesn't run away.

The Piskei Tshuvos brings from the Tzitz Eliezer that a person who endangers the welfare of the people may also be locked up on Shabbos.  However he suggests that if possible you should lock him in his house instead of the jailhouse.  Also it is better to have goy lock him up.

Disclaimer: We try to convey the Tshuva to the best of our ability. We admit that our understanding may not be accurate. Please also understand that this Tshuva may not be the final word on this topic. One should consult a Rav before drawing any conclusions.