Legal Advice
Exempting circumstance of insanity

Dear PAO,

I read somewhere that 'insanity' can be used as a way to evade criminal liability. Does the person raising such a defense need to prove it or he may just play along and pretend to be insane in court and be granted immunity from criminal actions? What is insanity as a defense and how does it apply?