The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. A habeas corpus petition is a civil matter that contests a defendant's incarceration or restriction imposed as a sanction in a criminal case.A writ of habeas corpus is a petition that an individual uses to challenge their conviction or sentence in California. The inmate may file a petition for writ of habeas corpus. Habeas corpus refers to the principle of freedom from unlawful detention. To file a habeas action, send the court the following items: ▫ Your original, completed petition form. United States district court to challenge violations of the Constitution or laws or treaties of the. They must have also filed a direct appeal to the appellate court and then to the California Supreme Court. The petition can be used to challenge a conviction, sentence, or the conditions of incarceration. Latin for "that you have the body.