In the smart agricultural environment such as greenhouse or vertical farm, the automation process is performed using the environment sensors to maintain the growth of the crops. Currently, the system rely on the defined rule to perform automation, but the situation can turn catastrophic.With the interruption in the communication, data forging, or eavesdropping, the crops will be rotten and destroyed. Therefore, to maintain the automation without failure, the connection needs to be secure and tampering has to be avoided. In this paper, we discuss the security solution for the wireless sensor networks in the automated agricultural environment without any human intervention. The sink node that collects the sensor values organizes the data and transfer the data to the server, along with the XML encryption and private key mechanism for the communication. The secure protocol is used to make connection using the private key, XML ecryption prevents the system from eavesdropping, and forging. Some of the events discussed in the papers are EVNData, SENSOR Error , DDoS Attack , and Conn Threat . With the help of the event and the tag information, the data security and confidentiality is increased, for the better automation and crop growth.