A mobile ad hoc network (MANET) is a wireless network with high of mobility, no fixed infrastructure and no central administration. These characteristics make MANET more vulnerable to attack. In ad hoc network, active attack i.e. DOS, and blackhole attack can easily occur. These attacks could decrease the performance of the routing protocol. We have proposed a new trust mechanism to secure the AODV routing protocol called Trust AODV. In this paper, we improve the performance of our proposed secure protocol by using an ant algorithm. Ant agent put a positive pheromone when the node is trusted. Path communication is chosen based on pheromone value. We evaluate and compare the performance of proposed protocol before and after using ant algorithm under DOS/DDOS attack. The simulation result shows the performance of proposed protocol increases while using ant algorithm in term of packet delivery ratio and throughput. However, in term of end-to-end delay there is no significant effect to the performance.