First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment.The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. The Writ of Habeas Corpus is a legal defense against unlawful incarceration. A habeas petition proceeds as a civil action against the State agent (usually a warden) who holds the defendant in custody. General Forms ; GF-21a. Address Confidentiality Order. If the court finds that a person was detained illegally, that person must be set free. A New York Family Lawyer said the respondent wife moved out of the marital residence. If you want information about federal habeas corpus, send a request to Prison Law Office, General Delivery, San.