An arrest warrant is not valid if it is not grounded in probable cause, or if it is overly broad. If a defendant is in custody on an invalid arrest warrant, your defense counsel can file what is known as a writ of habeas corpus. A writ of habeas corpus is used to ascertain if the detention of a defendant is lawful.