He was District Magistrate and Collector of five districts in Kerala. He also served as Agriculture Production Commissioner and as Principal Secretary Agriculture to the Government of Kerala. In March 2019, Government of India prematurely repatriated Swamy from the post of Chairman of the Coconut Development Board (CDB), because he had detected multiple instances of corruption. He is widely known as an anti-corruption crusader and as the Ashok Khemka of Kerala. He has been transferred over 20 times in the past 22 years.He is a prolific writer and won the Kerala Sahitya Akademi Award for Travelogue for Santhimantram Muzhangunna Thazvarayil.