This paper presents a novel hybrid optimization algorithm that combines JADE Adaptive Differential Evolution with Artificial Protozoa Optimizer (APO) to solve complex optimization problems and detect attacks. The proposed Hybrid APO-JADE Algorithm leverages JADE’s adaptive exploration capabilities and APO’s intensive exploitation strategies, ensuring a robust search process that balances global and local optimization. Initially, the algorithm employs JADE’s mutation and crossover operations, guided by adaptive control parameters, to explore the search space and prevent premature convergence. As the optimization progresses, a dynamic transition to the APO mechanism is implemented, where Levy flights and adaptive change factors are utilized to refine the best solutions identified during the exploration phase. This integration of exploration and exploitation phases enhances the algorithm’s ability to converge to high-quality solutions efficiently. The performance of the APO-JADE was verified via experimental simulations and compared with state-of-the-art algorithms using the 2022 IEEE Congress on Evolutionary Computation benchmark (CEC) 2022 and 2021. Results indicate that APO-JADE achieved outperforming results compared with the other algorithms. Considering practicality, the proposed APO-JADE was used to solve a real-world application in attack detection and tested on DS2OS, UNSW-NB15, and ToNIoT datasets, demonstrating its robust performance.