AI enhances network security by detecting and mitigating threats in real-time, analyzing patterns of suspicious behavior, and automating responses to potential security breaches. This proactive approach reduces downtime and increases network resilience.