As per the studies on Wireless Sensor Network (WSN), the major concern of WSN is network lifespan and Quality of Service (QoS) improvement as the sensor nodes are having limited processing and battery capabilities. The clustering based methods delivered improved performance compared to non-clustering methods, but cluster heads (CHs) suffered from the excessive load which leads more energy consumption of sensor nodes that becomes the CH in each interval. The mobile agent’s technology solves such problems. But using mobile agent’s leads problems of data security and unreliable communications in WSN. In this paper, we proposed novel mobile specialists based clustering protocol utilizing the adjusted particle swarm optimization (PSO) algorithm called Secure Mobile Agent based Clustering using modified PSO (SMACP). To optimize the clustering performance we design modified PSO based in CH selection and cluster formation performed efficiently. To secure data communications using the mobile agents, we applied the trust evaluation scheme to evaluate each mobile agents and sensors using parameters such as residual energy, distance, and packet forwarding probability. The simulation results computed for different WSNs in terms of energy efficiency, average throughput, packet delivery ratio (PDR), also, start to finish delay. The exhibition demonstrates that SMACP outperformed the previous methods effectively.