The development of sensor technology has led to applications ranging from academic to military. These tiny sensors are deployed in environments where security for data or hardware cannot be guaranteed. Unfortunately due to the resource constraints, traditional security schemes cannot be directly applied. In this paper, an efficient way of detecting an intrusion using ant colony is proposed. The architecture strategically enables ant agents to detect and track the intruders threatening the network. The proposed framework is evaluated based on accuracy and speed of intrusion detection before the network is compromised. This process of detecting the intrusion earlier helps learn future attacks, but also a defensive countermeasure.