Smart cities are a new approach to the innovation of the urban environment, which is impossible to imagine without the latest technologies, including Artificial Intelligence (AI) and the Internet of Things (IoT). These interconnected systems offer creative solutions to various challenges in significant sectors like energy, transportation, safety, and healthcare. Thus, smart cities can be defined as dynamic ecosystems based on data-driven technologies for real-time decision-making, resource management, and citizen engagement. However, the increase in the integration of AI and IoT comes with many challenges. This paper seeks to present both sides of these innovations, which can improve the urban ecosystem while also increasing its sustainability and vulnerability. Key risks include data breaches, algorithmic bias, and cyber threats to critical infrastructure that can jeopardize trust and resilience. The study also notes the lack of harmony in the evolution of research on AI-related developments and cybersecurity, which underpins the need for equilibrium in innovation. This paper aims to contribute to the understanding of the integration of AI in smart cities and their core systems, such as energy networks, transportation, and healthcare, through an assessment of current research and practices. It also stresses the significance of strong governance, ethical principles, and risk management. Thus, the potential of smart cities as safe, inclusive, and adaptive environments for future generations can be fulfilled. In this way, the paper aims to offer a way forward for the development of secure, fair, and creative urban environments in the networked society.