The rapid integration of Artificial Intelligence (AI) in education offers massive efficiency but poses complex ethical and spiritual risks, especially in Islamic Education (PAI) which heavily emphasizes the holistic role of a teacher as a spiritual and moral guide (Murabbi). This study aims to analyze the technical challenges, ethical risks, and strategic solutions for implementing AI in Islamic education to ensure it aligns with Islamic values and national legal frameworks.This study employed a qualitative method with a library research approach, evaluating authoritative scientific literature, books, and public policy documents through deep reading, authenticity verification, and critical analysis.The findings reveal that AI adoption faces infrastructure gaps and low digital literacy in madrasas and pesantren. Ethically, over-reliance on algorithms risks dehumanizing learning, eroding critical thinking, and reducing the teacher's vital role as a spiritual role model. As a mitigation framework, this study formulates an Islamic digital literacy strategy and ethical guidelines based on Maqāṣid al-Sharī‘ah—protecting religion (hifz al-dīn), intellect (hifz al-'aql), and soul/honor (hifz al-nafs wa al-'Irdh). These principles are strictly aligned with Indonesian positive laws, including the National Education System Act, the ITE Act, and the Personal Data Protection (PDP) Act. By applying the principle of moderation (Wasathiyyah), AI is positioned as a collaborative tool (wasilah) rather than a replacement for human educators. The integration of AI must maintain divine and human values as the primary foundation to shape a technologically advanced yet morally upright generation. Keywords: Islamic Education, Artificial Intelligence (AI), Maqāşid al-Shari'ah.