Which of My Web Development Tasks Count as Assisting in Sin?
Hanafi Fiqh
Answered by Shaykh Faraz Rabbani
Question
I work on a fruit-selling website whose stock photos show some of a woman’s nakedness. Which of my five tasks are direct and which indirect assistance in sin? Is my salary lawful, and may I have AI place the images so I never see them?
Answer
Your concern is praiseworthy, and your confusion is understandable. These are new situations, but the principles remain the same.
Of your five tasks, only the fourth is not permitted in the Hanafi school. Uploading these photos yourself is direct involvement in what is not allowed.
The other four tasks are permitted: optimizing a site that already has such images, working on the backend or non-visual aspects, rebuilding a site where the images are already present, and migrating posts where some comments might contain impermissible pictures.
The Ruling Follows Your Own Hand, Not the Name of the Project
Hanafi scholars distinguish between the one who does something directly (mubashir) and the one who only causes it indirectly (mutasabbib). The direct doer is held to a stricter standard.
Ghanim al-Baghdadi (Allah have mercy on him) states the rule: “The immediate doer is liable even if he neither intended nor transgressed, and the indirect causer is not liable unless he transgresses.” [Ghanim al-Baghdadi, Majma al-Damanat, 1.165]
So, when considering any task, do not focus on the project name. Rather, ask whether you are the one placing the image before others.
A migration script simply moves content without your choice, and the mere possibility that a comment might contain something impermissible is not a reason for worry.
Optimizing and rebuilding are permitted in themselves. Simply avoid looking at the images as you work. If, however, rebuilding requires you to place those images again, then that becomes the fourth case.
Where Indirect Involvement Still Carries Blame
Allah Most High says:
وَتَعَاوَنُوا۟ عَلَى ٱلْبِرِّ وَٱلتَّقْوَىٰ ۖ وَلَا تَعَاوَنُوا۟ عَلَى ٱلْإِثْمِ وَٱلْعُدْوَٰنِ
“And aid one another in devotion to your Lord in every good and godfearingness, and do not aid one another in sin and transgression.” [Quran 5:2; Keller, The Quran Beheld]
Ibn Abidin (Allah have mercy on him) explains that if you know your action will help a specific wrong, it becomes prohibitively disliked (makruh tahriman) in the Hanafi school, which is sinful though not strictly unlawful.
If you do not know, or if harm is only possible and not certain, then there is no blame.
Your Wage Is Lawful, and Your Worship Is Not Held Hostage
Neither the fourth case nor looking at such images is among the major sins (kaba’ir). Both require repentance (tawba), and Allah accepts repentance from His servants.
Your salary remains fully lawful, as it is payment for your work as a developer.
Any mistake in your work is attached to the action itself, not to your income.
You do not need to estimate or give away any part of your income. Since your earnings are lawful, the concern you mention about acceptance does not apply to you.
Asking to Be Excused from This Task Is a True Solution. Using AI to Avoid the Images Is Not the Same
Ask your employer to excuse you from working with these images, rather than assigning the task to someone else.
If your employer assigns it to another, that person has chosen to take it and is responsible for it. This is a real way out, and you are not passing the responsibility on.
Using AI is not the same, and your caution is correct. As explained before, an AI-generated image that resembles a human has the same ruling as a human image. What is not permitted in a photograph is also not permitted in a generated image.
If you use a tool to place the images, no other person has chosen to do so. The tool is not responsible.
You are still the one acting, even if indirectly. Not seeing the image protects you from looking at what is not permitted, but it does not change the ruling of the fourth case.
Keep the Work, Hand Back the Images
Responsibility is with the one who acts, and it is knowledge that makes a lawful act blameworthy. Keep your job, and do the backend work and migrations with peace of mind. This week, ask to be excused from placing those images. Someone who is this careful about his work is not someone whose worship Allah will turn away.
And Allah knows best.
[Shaykh] Faraz Rabbani
Related Answers
Mawlana Ilyas Patel, Can I Work for a Website Design Company That Develops Websites for Impermissible Businesses? – Addresses working for a company serving impermissible businesses, distinguishing direct involvement in prohibited work from permissible tasks.
Ustadh Tabraze Azam, How to Distinguish When Something Is Indirect or Direct Assistance in Sin? – Explains the distinction between direct and indirect assistance in sin and how this principle applies to professional activities.
Shaykh Faraz Rabbani, Is It Halal to Earn From AI Generated Female Images and Horror Videos? – Examines earning from AI-generated imagery and the relevant rulings concerning images, content, and permissible income.
Shaykh Yusuf Weltch, Can I Work at Companies with Some Haram Items? – Explains the ruling on employment with companies whose activities include both permissible and impermissible products or services.
Shaykh Faraz Rabbani is a recognized specialist scholar in the Islamic sciences, having studied under leading scholars from around the world. He is the Founder and Executive Director of SeekersGuidance.
Shaykh Faraz stands as a distinguished figure in Islamic scholarship. His journey in seeking knowledge is marked by dedication and depth. He spent ten years studying under some of the most revered scholars of our times. His initial studies took place in Damascus. He then continued in Amman, Jordan.
In Damascus, he was privileged to learn from the late Shaykh Adib al-Kallas. Shaykh Adib al-Kallas was renowned as the foremost theologian of his time. Shaykh Faraz also studied under Shaykh Hassan al-Hindi in Damascus. Shaykh Hassan is recognized as one of the leading Hanafi jurists of our era.
Upon completing his studies, Shaykh Faraz returned to Canada in 2007. His return marked a new chapter in his service to the community. He founded SeekersGuidance. The organization reflects his commitment to spreading Islamic knowledge. It aims to be reliable, relevant, inspiring, and accessible. This mission addresses both online and on-the-ground needs.
Shaykh Faraz is also an accomplished author. His notable work includes “Absolute Essentials of Islam: Faith, Prayer, and the Path of Salvation According to the Hanafi School.” This book, published by White Thread Press in 2004, is a significant contribution to Islamic literature.
His influence extends beyond his immediate community. Since 2011, Shaykh Faraz has been recognized as one of the 500 most influential Muslims. This recognition comes from the Royal Islamic Strategic Studies Center. It underscores his impact on the global Islamic discourse.
Shaykh Faraz Rabbani’s life and work embody a profound commitment to Islamic scholarship. His teachings continue to enlighten and guide seekers of knowledge worldwide.
النصوص
[غانم البغدادي، مجمع الضمانات، ١٦٥/١]
«الْمُبَاشِرُ ضَامِنٌ وَإِنْ لَمْ يَتَعَمَّدْ وَلَمْ يَتَعَدَّ، وَالْمُتَسَبِّبُ لَا يَضْمَنُ إلَّا أَنْ يَتَعَدَّ»
[القرآن الكريم، سورة المائدة: ٢]
«وَتَعَاوَنُوا۟ عَلَى ٱلْبِرِّ وَٱلتَّقْوَىٰ ۖ وَلَا تَعَاوَنُوا۟ عَلَى ٱلْإِثْمِ وَٱلْعُدْوَٰنِ»
[ابن عابدين، رد المحتار، ٢٦٨/٤]
«(وَيُكْرَهُ) تَحْرِيمًا (بَيْعُ السِّلَاحِ مِنْ أَهْلِ الْفِتْنَةِ إنْ عُلِمَ) لِأَنَّهُ إعَانَةٌ عَلَى الْمَعْصِيَةِ»