Sec. 8.01. INSANITY.
(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.
Sec. 8.02. MISTAKE OF FACT.
(a) It is a defense to prosecution that the actor through mistake formed a reasonable belief about a matter of fact if his mistaken belief negated the kind of culpability required for commission of the offense.
(b) Although an actor’s mistake of fact may constitute a defense to the offense charged, he may nevertheless be convicted of any lesser included offense of which he would be guilty if the fact were as he believed.
Sec. 8.03. MISTAKE OF LAW.
(a) It is no defense to prosecution that the actor was ignorant of the provisions of any law after the law has taken effect.
(b) It is an affirmative defense to prosecution that the actor reasonably believed the conduct charged did not constitute a crime and that he acted in reasonable reliance upon:
(1) an official statement of the law contained in a written order or grant of permission by an administrative agency charged by law with responsibility for interpreting the law in question; or
(2) a written interpretation of the law contained in an opinion of a court of record or made by a public official charged by law with responsibility for interpreting the law in question.
(c) Although an actor’s mistake of law may constitute a defense to the offense charged, he may nevertheless be convicted of a lesser included offense of which he would be guilty if the law were as he believed.
Sec. 8.04. INTOXICATION.
(a) Voluntary intoxication does not constitute a defense to the commission of crime.
(b) Evidence of temporary insanity caused by intoxication may be introduced by the actor in mitigation of the penalty attached to the offense for which he is being tried.
(c) When temporary insanity is relied upon as a defense and the evidence tends to show that such insanity was caused by intoxication, the court shall charge the jury in accordance with the provisions of this section.
(d) For purposes of this section “intoxication” means disturbance of mental or physical capacity resulting from the introduction of any substance into the body.
Sec. 8.05. DURESS.
(a) It is an affirmative defense to prosecution that the actor engaged in the proscribed conduct because he was compelled to do so by threat of imminent death or serious bodily injury to himself or another.
(b) In a prosecution for an offense that does not constitute a felony, it is an affirmative defense to prosecution that the actor engaged in the proscribed conduct because he was compelled to do so by force or threat of force.
(c) Compulsion within the meaning of this section exists only if the force or threat of force would render a person of reasonable firmness incapable of resisting the pressure.
(d) The defense provided by this section is unavailable if the actor intentionally, knowingly, or recklessly placed himself in a situation in which it was probable that he would be subjected to compulsion.
(e) It is no defense that a person acted at the command or persuasion of his spouse, unless he acted under compulsion that would establish a defense under this section.
Sec. 8.06. ENTRAPMENT.
(a) It is a defense to prosecution that the actor engaged in the conduct charged because he was induced to do so by a law enforcement agent using persuasion or other means likely to cause persons to commit the offense. Conduct merely affording a person an opportunity to commit an offense does not constitute entrapment.
(b) In this section “law enforcement agent” includes personnel of the state and local law enforcement agencies as well as of the United States and any person acting in accordance with instructions from such agents.
Sec. 8.07. AGE AFFECTING CRIMINAL RESPONSIBILITY.
(a) A person may not be prosecuted for or convicted of any offense that the person committed when younger than 15 years of age except:
(1) perjury and aggravated perjury when it appears by proof that the person had sufficient discretion to understand the nature and obligation of an oath;
(2) a violation of a penal statute cognizable under Chapter 729, Transportation Code, except for conduct for which the person convicted may be sentenced to imprisonment or confinement in jail;
(3) a violation of a motor vehicle traffic ordinance of an incorporated city or town in this state;
(4) a misdemeanor punishable by fine only;
(5) a violation of a penal ordinance of a political subdivision;
(6) a violation of a penal statute that is, or is a lesser included offense of, a capital felony, an aggravated controlled substance felony, or a felony of the first degree for which the person is transferred to the court under Section 54.02, Family Code, for prosecution if the person committed the offense when 14 years of age or older; or
(7) a capital felony or an offense under Section 19.02 for which the person is transferred to the court under Section 54.02(j)(2)(A), Family Code.
(b) Unless the juvenile court waives jurisdiction under Section 54.02, Family Code, and certifies the individual for criminal prosecution or the juvenile court has previously waived jurisdiction under that section and certified the individual for criminal prosecution, a person may not be prosecuted for or convicted of any offense committed before reaching 17 years of age except an offense described by Subsections (a)(1)-(5).
(c) No person may, in any case, be punished by death for an offense committed while the person was younger than 18 years.
(d) Notwithstanding Subsection (a), a person may not be prosecuted for or convicted of an offense described by Subsection (a)(4) or (5) that the person committed when younger than 10 years of age.
(e) A person who is at least 10 years of age but younger than 15 years of age is presumed incapable of committing an offense described by Subsection (a)(4) or (5), other than an offense under a juvenile curfew ordinance or order. This presumption may be refuted if the prosecution proves to the court by a preponderance of the evidence that the actor had sufficient capacity to understand that the conduct engaged in was wrong at the time the conduct was engaged in. The prosecution is not required to prove that the actor at the time of engaging in the conduct knew that the act was a criminal offense or knew the legal consequences of the offense.
Sec. 8.08. CHILD WITH MENTAL ILLNESS, DISABILITY, OR LACK OF CAPACITY.
(a) On motion by the state, the defendant, or a person standing in parental relation to the defendant, or on the court’s own motion, a court with jurisdiction of an offense described by Section 8.07(a)(4) or (5) shall determine whether probable cause exists to believe that a child, including a child with a mental illness or developmental disability:
(1) lacks the capacity to understand the proceedings in criminal court or to assist in the child’s own defense and is unfit to proceed; or
(2) lacks substantial capacity either to appreciate the wrongfulness of the child’s own conduct or to conform the child’s conduct to the requirement of the law.
(b) If the court determines that probable cause exists for a finding under Subsection (a), after providing notice to the state, the court may dismiss the complaint.
(c) A dismissal of a complaint under Subsection (b) may be appealed as provided by Article 44.01, Code of Criminal Procedure.
(d) In this section, “child” has the meaning assigned by Article 45.058(h), Code of Criminal Procedure.