The insanity defense, also known as the mental disorder defense, is a defense by excuse in a criminal case, arguing that the defendant is not responsible for their actions due to an episodic or persistent psychiatric disease at the time of the criminal act. This is contrasted with an excuse of provocation, in which defendant is responsible, but the responsibility is lessened due to a temporary mental state. It is also contrasted with a finding that a defendant cannot stand trial in a criminal case because a mental disease prevents her from effectively assisting council, from a civil finding in trusts and estates where a will is nullified because it was made when a mental disorder prevented a testator from recognizing the natural objects of her bounty, and from involuntary civil commitment to a mental institution, when a person is found to be gravely disabled or to be a danger to herself or to others.
Exemption from full criminal punishment on such grounds dates back to at least the Code of Hammurabi. Legal definitions of insanity or mental disorder are varied, and include the M'Naghten Rule, the Durham rule, the 1953 British Royal Commission on Capital Punishment report, the ALI rule (American Legal Institute Model Penal Code rule), and other provisions, often relating to a lack of mens rea ("guilty mind"). In the criminal laws of Australia and Canada, statutory legislation enshrines the M'Naghten Rules, with the terms defense of mental disorder, defense of mental illness or not criminally responsible by reason of mental disorder employed. Being incapable of distinguishing right from wrong is one basis for being found to be legally insane as a criminal defense. It originated in the M'Naughten Rule, and has been reinterpreted and modernized through more recent cases, such as People v. Serravo.