The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. A writ of habeas corpus is used to bring a prisoner or other detainee (e.g.The privilege of the writ of habeas corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it. The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. In United States law, habeas corpus is a recourse challenging the reasons or conditions of a person's confinement under color of law. A person is eligible for a writ when they are incarcerated with no bond set. The privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it. Prosecutors must show that they have a valid reason for detaining the person. If the detention is illegal, the detainee can be released.