The integration of edge computing with IoT (EC-IoT) systems provides significant improvements in addressing security and privacy challenges in IoT networks. This paper examines the combination of EC-IoT and artificial intelligence (AI), highlighting practical strategies to improve data and network security. The published literature has suggested decentralized and reliable trust measurement mechanisms and security frameworks designed explicitly for IoT-enabled systems. Therefore, this paper reviews the latest attack models threatening EC-IoT systems and their impacts on IoT networks. It also examines AI-based methods to counter these security threats and evaluates their effectiveness in real-world scenarios. Finally, this survey aims to guide future research by stressing the need for scalable, adaptable, and robust security solutions to address evolving threats in EC-IoT environments, focusing on the integration of AI to enhance the privacy, security, and efficiency of IoT systems while tackling the challenges of scalability and resource limitations.