This paper develops an Islamic ethical framework for AI, drawing from fiqh to proactively guide responsible development and use of artificial intelligence.

· 16 min read

Introduction
Artificial intelligence (AI) has moved rapidly from the realm of futuristic speculation to an indispensable part of modern life. Embedded in everyday technologies, AI now fundamentally shapes how we communicate, work, and interact with the world. The scale, speed, and reach of AI’s integration into society mark it as a uniquely disruptive force that brings immense promise but also unprecedented ethical, social, and cultural challenges.
Navigating this disruption requires moving beyond reductive binaries of uncritical technological optimism or fatalistic pessimism. The ethical challenges of AI are rarely simple; they frequently present a deeply complex matrix where benefits and harms are inextricably linked. To address this, we propose that the Islamic ethical lens is essential for evaluating AI use and development. Capable of providing a proactive, driving framework that informs innovation and technology, it offers values that help balance individual and communal considerations. This framework goes beyond downstream mitigation to proactively judge and shape form, substance, and approach.1
The paper begins by surveying the emergence and projected impact of AI, alongside its inevitable adoption across a myriad of contexts. By exploring specific applications and integrating relevant guidelines from Islamic scholars, we articulate how core ethical principles can be operationalized. After situating the importance of clear rulings and principles assigned to the technology domain, we present the jurisprudence of balancing (fiqh al-muwazaat), a sophisticated methodology that provides a structured approach to ethical dilemmas where utility and risk coexist.
This paper is methodologically oriented, offering general principles that one should take into account in their ethical decision-making. Generating definitive rulings for every AI case is beyond the scope of this paper; many of the issues raised here remain open questions requiring interdisciplinary ijtihad. Ultimately, the framework presented here establishes the theoretical and practical necessity of an Islamic approach. It provides an approach for the ongoing work required to assess these technologies and the profound civilizational stakes of the algorithmic age.
Social media offers a clear precedent for the risks of uncritical technological adoption: Society and Islamic scholarship were slow to assess its ethical implications, allowing harms to become deeply embedded before meaningful safeguards emerged. What began as niche platforms rapidly expanded into a global infrastructure shaping communication, culture, and economics, driven largely by companies prioritizing growth, engagement, and profit over long-term societal well-being, while regulatory and ethical responses lagged behind. The Muslim ummah’s response was similarly delayed and reactive, with guidance emerging only after widespread adoption had already formed habits and constrained meaningful intervention; even then, Islamic ethical engagement largely focused on mitigating harms within an assumed inevitability rather than issuing foundational judgments about the technology’s purpose, means, and anticipated consequences. Today, generative AI presents a parallel but higher-stakes transformation, advancing more quickly and concentrating unprecedented power in a small number of profit-driven technology firms. Without proactive, principled evaluation of its underlying purposes, design, and consequences, there is a serious risk of repeating the same pattern, allowing structural harms to take root before they are fully understood, underscoring the urgent need for ethical frameworks to guide technological development from the outset rather than attempting to mitigate damage after the fact.
AI is transforming communication, education, health care, finance, security, and culture at once. However, we know that it will not always be beneficial. The same systems that can expand access to knowledge, improve medical diagnosis, streamline services, and unlock new forms of creativity can also entrench bias, destabilize trust, displace livelihoods, and concentrate power. Human design choices, from the way an algorithm prioritizes information to features that encourage user engagement, reflect the values and assumptions of its creators. These choices may appear technical, but they carry ethical weight because they shape how people interact, what information they encounter, and which behaviors are rewarded or discouraged.
Compounding this challenge, technology often spreads at a pace much faster than laws, cultural norms, or institutions can adjust. Regulation typically follows innovation rather than guiding it, which means that once a technology is entrenched, its harms are much harder to undo. In moments like this, societies often let profit and speed set the terms while communities absorb the costs. For this reason, ethical foresight is not optional but essential: Societies must grapple with potential consequences in advance, rather than waiting until negative impacts have already become embedded.
One of the clearest examples of how technology is governed in ways that prioritize growth over responsibility is Section 230 of the Communications Decency Act, passed in 1996. Often described as “the twenty-six words that created the internet,”2 this single provision not only enabled the rapid expansion of online platforms but also institutionalized a model of governance in which legal immunity outpaces ethical accountability. By granting platforms immunity from liability for user-generated content, while allowing them to moderate in “good faith,” the law treats companies such as Facebook, X (formerly Twitter), and YouTube as distributors rather than publishers, shielding them from responsibility for most of the content they host.
By removing the threat of liability, Section 230 helped create the conditions under which platforms could maximize growth and user engagement while minimizing attention to potential harms. Once user-generated content became the lifeblood of the internet, algorithms were optimized to capture attention and drive profits, not to safeguard communities. This model has been described as “surveillance capitalism,” a new economic order in which human experience is treated as free raw material for hidden commercial practices of extraction, prediction, and sales.3 Its harms are not only societal but deeply personal, often disproportionately borne by vulnerable populations.4 For example, content moderation and AI model training are frequently outsourced to workers in developing countries, who must process trauma-inducing content under precarious conditions, often without adequate psychological support. In this way, technology companies generate immense private wealth while externalizing social and human costs—a pattern consistent with broader dynamics in modern capitalism, but amplified by the scale and reach of digital platforms.5
This legal framework can be clarified through an analogy: A publisher, such as a newspaper, is liable for the content it prints, while a distributor, such as a bookstore, is not responsible for the material it sells. By classifying platforms as distributors, Section 230 created a system in which companies can profit from harmful content without bearing corresponding responsibility. This reveals a fundamental limitation of secular legal frameworks: They determine liability but often remain silent on moral obligation. Legal immunity, in this sense, does not equate to ethical innocence. It is precisely this gap, between what is legally permissible and what is ethically justifiable, that invites alternative approaches to governance. Islamic ethics, with its emphasis on accountability, justice, and the moral consequences of action, offers a more comprehensive framework for addressing the responsibilities of technological power.
For Muslims, Islamic ethics serves as a proactive, spiritually anchored framework that governs not only the application of a technology, but its very conception. This multitiered paradigm is not a novel construction; rather, it is a direct reflection of the divine mandate established in the Holy Qur’an and the Prophetic Sunnah. The Qur’an explicitly commands a comprehensive moral framework that transcends bare minimum compliance, stating: “Indeed, Allah orders justice [ʿadl], good conduct [ihsan], and generosity to close relatives.”6 In the realm of technological innovation, ʿadl necessitates strict adherence to legal boundaries that prevent harm and uphold human rights, while ihsan demands that the innovator’s internal disposition and the technology’s ultimate trajectory actively seek the highest communal good. Furthermore, the Prophet ﷺ established that human agency and power constitute a profound trust in his statement, “Every one of you is a shepherd and is responsible for his flock.”7 When developers and executives design AI tools, they wield systems capable of shaping the cognitive and moral fabric of billions, thus assuming the role of shepherds over a vast digital expanse. Consequently, their standard of accountability cannot be limited to merely dodging secular legal liability; it must encompass the holistic fulfillment of this divine trust.
Unlike many contemporary secular models, this Islamic paradigm operates at the very genesis of technological development.8 By judging a technology’s form, purpose, and design from its inception, Islamic jurisprudence provides a mechanism for critiquing systems that are fundamentally corrupt by design, recognizing that structural harms cannot be adequately resolved through superficial, downstream mitigation.9 Furthermore, this paradigm radically expands the calculus of benefit (maslaha) and harm (mafsada). It extends the scope of assessment beyond immediate worldly utility to encompass consequences in both this life and the hereafter. This dual-horizon accountability provides a robust defense against vectors of unregulated profit and exploitation that often evade human legal enforcement, anchoring the innovator’s restraint in the ultimate reality of divine oversight.10
At its foundation, justice (ʿadl) is operationalized through ahkam—clear legal rulings that establish nonnegotiable boundaries of permissibility (halal) and prohibition (haram). In a technological landscape driven by speed and competition, these serve as definitive guardrails, ensuring that core principles such as the preservation of intellect, dignity, and privacy are not sacrificed for innovation. These limits, or red lines, understood as the divinely ordained boundaries (hudud Allah), govern all human activity, including the development of AI.11
Yet the Sharia is not merely a restrictive code; it is a visionary system designed to promote human welfare and flourishing. To construct a functional Islamic ethics of artificial intelligence, we must trace a clear, teleological trajectory from universal divine intent down to practical engineering. This framework begins with the maqasid ʿamma—the overarching, constitutional objectives of the Sharia, such as the preservation of human intellect (hifz al-ʿaql) and human dignity.12 However, because these universal aims are too broad to directly regulate complex algorithms, scholars and technologists must collaboratively derive maqasid khassa: objectives specific to a single domain of activity—here, the digital realm.13 In the context of generative technology, a maqsad khass might, for example, mandate that AI systems function as transparent intellectual scaffolding rather than deceptive, autonomous replacements for human moral reasoning. These domain objectives are in turn specified as maqasid juzʾiyya: the concrete intents behind particular design rules, such as requiring a system to disclose its limitations or to route personal religious questions to a qualified human scholar. This entire hierarchy results in maslaha: Tangible public benefit is secured and harm is repelled when accessible, bias-mitigated tools are deployed to solve pressing societal challenges.14 This progression from universal principle, to domain objective, to the intent of a specific rule, and finally the benefit it secures, ensures that innovation remains anchored in the pursuit of human flourishing.
Yet external structures alone are insufficient. Islamic governance also demands the cultivation of adab—the spiritual etiquette, ethical character, and professional virtues required of those who design and deploy technology.15 Without this moral foundation, even the most robust legal and institutional safeguards will fail. Engineers and executives must recognize their work as a form of stewardship (khilafa), in which technical decisions carry spiritual and societal consequences. Anchored by tarbiya (moral discipline), this internal ethic bridges the gap between abstract code and real-world impact, ensuring that responsibility is imposed from within.
To enforce meaningful ethical guardrails in AI, mechanisms of liability must also accompany moral principles. The Islamic tradition offers a clear precedent in its treatment of medical ethics (adab al-tabib), where practitioners were entrusted with human well-being and held liable for foreseeable harm.16 Developers of generative AI occupy a comparable role today, yet the current landscape—shaped by competitive pressures and exemplified by private AI start-up Anthropic’s retreat from unilateral safety constraints17—disincentivizes restraint. Islamic jurisprudence addresses this through a dual standard of accountability: responsibility before God and enforceable liability in this life (qadaʾ). Rooted in Prophetic guidance, this framework obliges practitioners to anticipate risks, implement safeguards, and provide restitution when harm occurs. Applied to AI, it challenges liability-shielded models by demanding accountability for foreseeable harms and embedding ethical responsibility into both intention and action, ensuring that innovation is tempered by the protection of human well-being.
Further details on the Islamic standards of liability in AI applications are explored in a later section and by reference. To help contextualize the coming frameworks, we also provide an accessible technical primer geared on demystifying generative AI in the appendix. We now move to outline the framework of fiqh al-muwazanat (jurisprudence of balancing) and its proposed application to AI ethics. This framework is anchored in concrete legal rulings (ahkam) such that where an action is clearly prohibited (haram), tools such as muwazanat do not apply. It is also not intended to be applied independently: Nonspecialists should not derive conclusions from it in isolation, nor should specialists employ it without broader scholarly context.
Concerns such as authority, responsibility, and identity show that the ethical challenges of AI are rarely simple. Benefits and harms are often inseparable and unevenly distributed. Addressing them piecemeal risks overlooking the trade-offs that shape real outcomes. Islamic law already offers a principled method for such situations: fiqh al-muwazanat, a methodological framework within Islamic jurisprudence for weighing competing considerations and evaluating consequences when multiple interests are at stake.18 Fiqh al-muwazanat represents a systematic approach to resolving tensions between competing interests (masalih) and harms (mafasid) that is particularly valuable when addressing novel technological challenges not addressed in classical texts.19 As articulated by Ibn al-Qayyim, “the foundation of the Sharia is wisdom and the safeguarding of people’s interests in this world and the next. It is justice, mercy, benefit, and wisdom in its entirety.”20 This framework becomes essential when evaluating AI applications where benefits and harms coexist within the same technological capability.
The fiqh al-muwazanat framework recognizes three distinct types of balancing that scholars must navigate when evaluating AI applications. Understanding these typologies is essential because AI technologies rarely present simple choices between clear good and clear harm. Instead, they typically involve complex scenarios where multiple benefits compete for priority, unavoidable harms must be minimized, or, most commonly, benefits and harms are inextricably intertwined within the same technology.
1. Balancing benefits (muwazanat al-masalih)
This type of balancing occurs when multiple beneficial AI applications compete for limited resources, attention, or implementation priority. For instance, a Muslim educational institution might need to choose between investing in AI-powered personalized learning systems that could dramatically improve student outcomes, or AI-enhanced Arabic language preservation tools that could help maintain Islamic cultural heritage. Both serve legitimate Islamic objectives, education (taʿlim) and preservation of religious knowledge (hifz al-din), but limited budgets may prevent pursuing both simultaneously.
The Islamic legal tradition provides clear principles for such situations. The obligatory (wajib) takes precedence over the recommended (mandub), communal obligations (fard kifaya) generally outweigh individual ones (fard ʿayn) when resources are limited, and benefits affecting larger populations take priority over those benefiting fewer people.21 When applying these principles to AI, scholars must consider factors such as: Which technology serves more fundamental objectives (maqasid)? Which addresses more urgent community needs? Which has greater potential for long-term positive impact?
2. Balancing harms (muwazanat al-mafasid)
Sometimes circumstances force a choice between two harmful outcomes, where avoiding both is impossible. In such cases, Islamic law requires choosing the lesser evil to minimize overall harm. The Prophet ﷺ exemplified this principle when he advised against rebuilding the Kaaba on its original foundations, despite this being religiously preferable, because it might harm the faith of newly converted Muslims.22
In the AI context, consider facial recognition technology. Law enforcement agencies argue it helps locate missing children and prevent terrorism, clear benefits for preserving life (hifz al-nafs). However, the same technology enables mass surveillance that is used to persecute Muslim minorities, as documented in China’s treatment of Uyghurs.23 If a Muslim-majority country must choose between completely banning such technology (potentially hampering legitimate security needs) or allowing it with the risk of abuse, scholars must determine which option minimizes overall harm to both individual privacy and collective security.
3. Balancing benefits and harms (muwazanat al-masalih wa-l-mafasid)
This most complex type of balancing addresses situations where the same AI application simultaneously produces benefits and harms that cannot be separated. The Qur’anic treatment of alcohol and gambling provides the classical model: “They ask you about wine and gambling. Say, ‘In them there is great sin and [some] benefit for people. But their sin is greater than their benefit.’”24 This verse establishes that Islamic law can weigh qualitatively different considerations, benefits versus harms, and reach definitive conclusions.
Most AI applications fall into this category. Social media algorithms, for instance, help Muslims connect with scholars globally, access Islamic knowledge, and build community networks—significant benefits for religious practice. Simultaneously, these same algorithms can promote addiction, spread misinformation about Islam, and expose users to harmful content. The benefits and harms are produced by the same underlying technology and cannot be easily separated.
For scholars and institutions to effectively apply fiqh al-muwazanat to AI ethics, five fundamental conditions must be satisfied. Each of these conditions carries established pedigree in classical usul al-fiqh. Their consolidation into the five conditions of muwazanat, however, is a contemporary systematization rather than a fixed classical taxonomy. Together, they represent the essential foundations upon which the discipline is built. Neglecting them renders effective engagement in interest-balancing extraordinarily difficult,25 and understanding each condition is crucial for those seeking to apply this framework to contemporary technological challenges.
1. Evaluating the objectives of Islamic law (maqasid al-shariʿa) and legal maxims
The maqasid al-shariʿa refers to the higher objectives and purposes that Islamic law seeks to achieve for humanity. Classical scholars identified five essential objectives that the Sharia aims to preserve: religion (din), life (nafs), intellect (ʿaql), lineage (nasl), and property (mal).26 These are not merely abstract concepts but represent fundamental human interests that must be protected for both individual and societal well-being.
Understanding these objectives provides the necessary evaluative framework for assessing AI applications. For instance, when evaluating an AI medical diagnostic system, we consider how it serves the preservation of life (hifz al-nafs). When assessing AI-generated educational content, we examine its impact on preserving and developing human intellect (hifz al-ʿaql). This hierarchical framework helps scholars determine which benefits to prioritize and which harms to prevent.
Additionally, scholars must master key legal maxims (qawaʿid fiqhiyya) that guide decision-making. The principle that “preventing harm takes precedence over securing benefits” (darʾ al-mafasid muqaddam ʿala jalb al-masalih) proves particularly relevant for AI ethics. This means that if an AI application offers benefits but also poses significant risks of harm, Islamic law prioritizes preventing the harm even if it means forgoing the benefits. For example, if an AI system could improve educational outcomes but also risks exposing children to harmful content, the priority would be preventing the harm.


About the writer
Teacher
Barbara Lohr writes heartwarming, sweet romance with a flair for fun. In her novels, feisty women take on hunky heroes and life’s issues. When she’s not writing, she loves to bike, kayak, or golf. She currently lives in [Location] with her family and an overly opinionated cat.
All writings by Fahmida Fahmi