In the context of cyber-attacks increasing in both number and complexity, traditional security systems are having difficulty protecting important systems and data. This study proposes a security system that uses artificial intelligence (AI) to detect and prevent cyber attacks. This system takes advantage of machine learning and deep learning algorithms to detect unusual behaviors, thereby effectively classifying and preventing attacks. The system development process includes data collection, preprocessing, AI model training, and integration into real environments. Test results show that the AI model is capable of accurately detecting cyber attacks, while improving self-learning capabilities and optimizing security.