Forensic psychiatrists work with courts in evaluating an individual's competency to stand trial, defenses based on mental diseases or defects (e.g., the "insanity" defense), and sentencing recommendations. There are two major areas of criminal evaluations in forensic psychiatry. These are Competency to Stand trial (CST) and Mental State at the Time of the Offence (MSO).
This is the competency evaluation to determination that a defendant has the mental capacity to understand the charges and assist his attorney. This is seated in the Fifth Amendment to the US Constitution, which ensures the right to be present at your trial, to face your accusers, and to have help from an attorney.
In English and Welsh law a similar concept is that of "fitness to plead".
Forensic psychiatrists are often called to be expert witnesses in both criminal and civil proceedings. Expert witnesses give their opinion about a specific issue. Often the psychiatrist will have prepared a detailed report before testifying. The primary duty of the expert witness is to provide an independent opinion to the court.
This gives the Court an opinion, and only an opinion, as to whether a defendant was able to understand what he was doing at the time of the crime. This is worded differently in many states, and has been rejected altogether in some, but in every setting, the intent to do a criminal act and the understanding that it was a criminal act bear on the final disposition of the case.