legal action or writ by means of which detainees can seek relief from unlawful imprisonment. Example The lawyer filed a habeas corpus petition to challenge the legality of the client's detention.