Latin for "that you have the body." A writ of habeas corpus is used to bring a prisoner or other detainee (e.g. institutionalized mental patient) before the court to determine if the person's imprisonment or detention is lawful. In the US system, federal courts can use the writ of habeas corpus to determine if a state's detention of a prisoner is valid. A habeas petition proceeds as a civil action against the State agent (usually a warden) who holds the defendant in custody.