The writ of 'Habeas Corpus' is the fundamental legal instrument designed to safeguard individual freedom against arbitrary and lawless government action. Literally meaning to "produce the body," it requires that a person who is under arrest be brought before a judge or into court.
The principle of habeas corpus ensures that a prisoner can be released from unlawful detention or detention lacking sufficient cause or evidence. The remedy can be sought by the prisoner himself (or herself) or his attorney.