The legal definition of insanity refers to a mental illness or disease that makes it impossible for a defendant to know they were committing a crime or to understand that their actions are wrong. A defendant found to be criminally insane can assert an insanity defense. Insanity functions as a failure of proof defense where the defendant admits to having committed the wrongful act, but claims they are not culpable because their mental defect prevented them from establishing the required mental state. Tests to determine if a defendant is criminally insane vary from state to state. For instance, any jurisdiction that follows the Model Penal Code (MPC) rule looks to see if the defendant lacked both substantial capacity to appreciate the wrongness of their actions and substantial capacity to conform their actions to the law. Jurisdictions that follow common law tests are primarily split between the MNaghten Rule and the irresistible impulse test.
The traditional test of insanity in criminal cases is whether the accused knew "the difference between right and wrong," following the "MNaughten rule" from 19th century England. However, most states require more sophisticated tests based on psychiatric and/or psychological testimony evaluated by a jury of laypersons or a judge without psychiatric training. A claim by a criminal defendant of their insanity at the time of trial requires a separate hearing to determine if the defendant is sufficiently sane to understand the nature of a trial and participate in their own defense. If found to be insane, the defendant will be ordered to a mental facility, and the trial will be held only if sanity returns.
In summary, the legal definition of insanity refers to a mental illness or disease that makes it impossible for a defendant to know they were committing a crime or to understand that their actions are wrong. The tests to determine if a defendant is criminally insane vary from state to state, and most states require more sophisticated tests based on psychiatric and/or psychological testimony evaluated by a jury of laypersons or a judge without psychiatric training.