The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. Generally speaking, the writ of habeas corpus is available in any case where the trial court has acted in excess of its jurisdiction.A writ of habeas corpus is a legal order that requires the custodian to bring the detained individual before a court or judge. A writ of habeas corpus stands as a vital legal tool, essential for safeguarding individual rights and averting arbitrary detention. A habeas corpus petition cannot act as a second direct appeal. This Chapter explains the writ of habeas corpus and lays out the procedures you will need to follow to petition for the writ. Habeas corpus means demand of body. Habeas petitions provide prisoners whose rights are being violated with a means of requesting assistance from a judge. A petition for writ of habeas corpus is a legal action that allows individuals to challenge their unlawful imprisonment or restraint. Any prisoner, or another person acting on their behalf, may petition the court, or a judge, for a writ of habeas corpus.