In the state of Texas, the insanity defense and the requirements to raise the defense is codified in the Texas Penal Code Section 8.01:
(a) It is an affirmative defense to prosecution that, at the time of the conduct charged, the actor, as a result of severe mental disease or defect, did not know that his conduct was wrong.
(b) The term “mental disease or defect” does not include an abnormality manifested only by repeated criminal or otherwise antisocial conduct.
An "affirmative defense" allows a defendant to avoid legal responsibility for the charged offense while still admitting guilt; essentially, it provides an excuse or justification for why the action transpired. An affirmative defense has the ability to mitigate the legal consequences of an unlawful action.
In Texas, the insanity defense is available only when there is proof that, because of severe mental disease or defect, the accused did not know his/her conduct was wrong. Very few defendants, even those who are seriously mentally ill and delusional, are incapable of knowing at some level their conduct is wrong or unlawful.
Some individuals with severe, untreated mental illness have symptoms of auditory or visual hallucinations that are quite real to them. While in a delusional state they may be unable to appreciate their acts are either legally or morally wrong.
Importantly, a defendant found not guilty by reason of insanity does not walk out of the courtroom a free person. Instead, that person will be committed for treatment in a maximum security facility and for a disposition within 30 days in cases where there was dangerous conduct. In cases where there was no dangerous conduct, the person will be will be detained for a civil commitment proceeding .
Unfortunately, Article 46C.154 provides that neither party nor the court shall inform the jury of the consequences to the defendant if a verdict of not guilty by reason of insanity is returned. In others words, the jury will not be informed that a person found Not Guilty by Reason of Insanity will not be released – although this seems like it would be relevant and pertinent information for a juror to know when they are struggling with finding a person guilty or not guilty.