<p>This study introduces the Adaptive Multi-Layer Security Framework (AMLSF), a novel approach designed for real-time applications in smart city networks, addressing the current challenges in security systems. AMLSF innovatively incorporates machine learning algorithms for dynamic adjustment of security protocols based on real-time threat analysis and device behavior patterns. This approach marks a significant shift from static security measures, offering an adaptive encryption mechanism that scales according to application criticality and device mobility. Our methodology integrates hierarchical key management with real-time adaptability, further enhanced by an advanced rekeying strategy sensitive to device mobility and communication overhead. The paper’s findings reveal a substantial improvement in security efficiency. AMLSF outperforms existing models in encryption strength, rekeying time, communication overhead, and computational time by significant margins. Notably, AMLSF demonstrates an adaptability increase of over 30% compared to traditional models, with encryption strength and computational time efficiency improving by approximately 25%. These results underscore AMLSF’s capability in delivering robust, dynamic security without sacrificing performance. The achievements of AMLSF are significant, indicating a promising direction for smart city security frameworks. Its ability to adapt in real-time to various security needs, coupled with its performance efficiency, positions AMLSF as a superior choice for smart city networks facing diverse and evolving security threats. This framework sets a new benchmark in smart city security, paving the way for future developments in this rapidly advancing field.</p>