In Sri Lanka, the legislative requirements of the insanity defense are contained within its Penal Code. Wording of this section is identical to the original version of the Indian Penal Code enacted in 1860 by the colonial British administration of India. The Sri Lankan Penal Code was based on the Indian Penal Code with changes to meet local requirements. Similarly, in many countries whose criminal codices were based on the Indian Penal Code, the insanity defense remains identical to that of Sri Lanka and India. While it has been suggested that the provisions for the insanity defense in Sri Lanka is based on the M'Naghten rules, no proper exploration has been done on how the law became to what it is now. This article reviews historical documents and secondary sources to trace the origin of the insanity defense in Sri Lanka and India.