Due to the wide deployment of sensor networks recently security in sensor networks has become a hot research topic. Popular ways to secure a sensor network are by including cryptographic techniques or by safeguarding sensitive information from unauthorized access/manipulation and by implementing efficient intrusion detection mechanisms. This paper proposes a novel ant colony based intrusion detection mechanism which could also keep track of the intruder trials. The IDEAS technique could work in conjunction with the conventional machine learning based intrusion detection techniques to secure the sensor networks. The algorithm is presented and illustrated by simulating a sensor network.