Jared Lee Loughner, the 22-year-old who allegedly killed six people and wounded 14 others in Tucson, Ariz., on Saturday, faces five federal charges. According to the New York Times, he may plead not guilty by reason of insanity. How do mental-health experts figure out whether a federal defendant should qualify for the insanity defense?

With difficulty. To prove insanity in court, defense attorneys must demonstrate that their client’s mental illness prevented him from understanding the wrongness of his criminal undertaking at the time of the offense. (This standard is stricter than merely showing the defendant generally cannot not tell right from wrong.) They must also show a clear connection between the defendant’s delusions and the crime he committed. So, for example, a paranoid schizophrenic shoplifter who burgles a melon because he’s hungry probably won’t get off the hook. But a similar shoplifter who steals the melon because he believes the melon will neutralize a chip the CIA planted in his brain probably will. To evaluate whether a defendant was legally insane at the time of the crime, psychologists and psychiatrists interview him and examine “collateral information”—such as the defendant’s arrest warrant, medical records, and criminal history. They also conduct interviews with spouses, friends, and coworkers. In the case of Loughner, collateral evidence would probably include the letters and online message-board postings he’s believed to have written and the YouTube videos that have been attributed to him.

Psychologists have also developed a number of highly specialized tests to ferret out liars and malingerers. None is foolproof, but the Structured Interview of Reported Symptoms, or SIRS, is the gold standard. The SIRS and similar tests work by inviting defendants to endorse exaggerated or highly unlikely symptoms for the illness they claim to have. The specific questions they contain are only available to mental health professionals with the proper credentials—an attempt to keep defendants from gaming the system.

In low-stakes cases, a single psychologist or psychiatrist will handle the evaluation. A study of 5,175 pre-trial sanity evaluations in Virginia found, among other things, that the average evaluator spent about eight hours on the assessment, obtained a copy of the arrest warrant about 90 percent of the time, examined the defendant’s criminal history 45 percent of the time, and used psychological or neuropsychological tests just more than 20 percent of the time. In high-stakes cases, however, a team of several psychiatrists, psychologists, and social workers may evaluate the defendant—and may take a greater range of evidence into consideration.

In the end, evaluators can only state their opinions and how they arrived at their conclusions. Ultimately it’s up to a judge or jury to determine whether the insanity defense holds water.

Before the Insanity Defense Reform Act of 1984—which Congress passed after a jury acquitted John Hinckley Jr. of attempting to assassinate President Ronald Reagan and a dozen other federal charges—the crucial determination in an insanity defense was whether the accused generally understood the difference between right and wrong. The Act revised federal law to place a greater burden on the defense. In particular, it required the defense to show “clear and convincing evidence” that mental illness prevented the defendant from understanding the wrongness of his crime at the time it occurred. Legal standards for insanity at the state level vary—and some states have no provision for it at all.

Bonus Explainer: How often do mental health evaluators conclude that a defendant was insane at the time of the offense?

Not often. According to the aforementioned Virginia study, evaluators concluded that the defendant was insane in just 15 percent of cases. That study also found that evaluators are much more likely to conclude in favor of defendants with psychotic disorders and less likely to conclude in favor of nonwhite defendants and those with prior convictions or personality disorders. A 1991 study of insanity pleas in eight states found that only 26 percent were successful.

Explainer thanks David I. Bruck of Washington & Lee School of Law and William J. Stejskal of Woodbridge Psychological Associates.Like Slate on Facebook. Follow us on Twitter.