Skip to content
Shariah Agent

Grounded AI

Grounded AI for Islamic questions: how 'no source, no answer' works and where it still fails

A grounded AI answers only from passages it retrieved from a defined library of scholarly sources, quotes them, names the school, and declines when it finds nothing. It is the difference between a reference tool and a fluent guesser. It is not a mufti, it still fails in known ways, and this page lists them.

By HalalScreener ResearchUpdated 5 min read

Two assistants are asked the same question: "Can I keep the interest my bank pays me?" The first writes a thoughtful paragraph from memory. The second searches a library of fatwas, finds a Dar al-Ifta ruling and a ruling from Ayatollah Sistani's office, asks which school you follow, and quotes the relevant one with a link. Both answers might be accurate. Only the second one can be checked. That difference is what "grounded" means.

Why chatbots fail on religious questions

A general-purpose language model learns from an enormous mix of text: scholarly works, forum posts, marketing, translations of varying quality, and arguments between all of them. When you ask it a fiqh question, it produces the most plausible continuation given all of that. Three documented consequences:

  1. Blended schools. The answer may stitch Hanafi, Shafi'i and Ja'fari positions into one confident paragraph that no school actually holds.
  2. Permissive drift. A University of Malaya comparative study found a systematic bias toward permissiveness, with reliance on secondary sources rather than authoritative collections.
  3. Invented citations. Asked for a source, a chatbot can produce a realistic-looking reference that does not exist.

None of these is a bug that a better model necessarily fixes, because the model is doing what it was built to do: continue the text plausibly. The fix is architectural.

How grounding changes the answer

  1. A library is defined. Named sources only: for example, the English fatwa archive of Dar al-Ifta al-Misriyyah, the rulings published by the office of Ayatollah Sistani, named standards such as AAOIFI's. Each document carries its institution, school, date and link.
  2. The question is used to retrieve. The system searches the library for passages relevant to the question, usually by meaning rather than exact words.
  3. The school is established first. A well-built system asks which school or marja' you follow before answering, because the right passage depends on it.
  4. The answer is generated from the retrieved passages only. The model is instructed to explain what the passages say and nothing more.
  5. The passages are shown. Quote, source, date, link. You can read the original.
  6. Nothing found means no answer. The system says it found no relevant source from your school and suggests asking a scholar.

The result is a reference tool with a conversational interface. Every answer passes the five-question check by construction, because the source, the school and the date come from the retrieved document and the decline behaviour is built in.

What grounding does not do

Grounding makes an answer checkable. It does not make it a ruling. Dar al-Ifta's fatwa 22255 bars relying on AI applications to obtain a fatwa; the reasoning concerns the nature of a fatwa as the act of an accountable, qualified human, and a better retrieval system does not alter that. A grounded tool's correct self-description is "here is what this scholar said about a question like yours", followed by "ask a scholar of your school about yours."

Known failure modes, honestly

FailureWhat it looks likeMitigation
Wrong passage retrievedA ruling on a similar but different questionShow the passage so the reader can see the mismatch; retrieve several and let the model note differences
Inaccurate paraphraseThe explanation softens or sharpens the sourceQuote the original alongside; instruct the model to prefer quotation
Incomplete libraryYour school's position is missing, so the tool offers another'sAsk the school first; decline rather than substitute; publish what the library contains
Stale sourcesA superseded rulingDate every source; refresh the library on a schedule; show the date
Authority confusionThe user treats the answer as a fatwaSay, every time, that it is a reference and name the next step
Over-retrievalSomething is always "found", so the tool never declinesSet a relevance threshold and test it with questions that should fail

A tool that tells you about these failures is more trustworthy than one that claims to have none.

Worked example: HalalScreener's Scholar

We run this site, and we run a grounded assistant, so it is the honest example to use. Here is how it is built and how to catch it out.

  • Library. Fatwas from the English archive of Dar al-Ifta al-Misriyyah and rulings from the office of Ayatollah Sistani, among others, each tagged with institution, school and date.
  • School first. If your profile does not record a school, Scholar asks before answering.
  • No source, no answer. If retrieval returns nothing relevant from your school, Scholar says so and points you to a scholar. It is designed not to fill the gap from the model's memory.
  • Sources shown. Each answer carries the passage and the link.
  • Not a mufti. Scholar's answers are framed as references to named rulings, with the recommendation to consult a qualified scholar for anything that matters.

How to test it: ask something your school has not addressed in those archives and see whether it declines. Ask the same question twice in different words and compare. Open every link. If it fails any of the five questions, tell us at hello@halalscreener.app and we will fix it or document the limitation here.

Scholar is a HalalScreener product. HalalScreener screens stocks, ETFs and crypto; it does not certify, and it does not issue rulings.

The standard this implies

Grounding is one of the seven commitments in the Shariah Agent Standard, alongside school declaration, dating, decline behaviour, human hand-off, logging and a named accountable person. Any builder can adopt it. Any user can check it.

Questions people ask

What does grounded mean for an AI assistant?
That the assistant answers only from text it retrieved from a defined set of sources at the moment you asked, and shows you that text. The language model's job is to find and explain, not to recall from training. If nothing relevant is retrieved, a grounded system says so instead of answering.
Is a grounded AI the same as a mufti?
No. It is a reference tool. Dar al-Ifta's fatwa 22255 bars relying on AI to obtain a fatwa, and grounding does not change that. What grounding changes is that you can check the answer against its source, which you cannot do with a chatbot.
How can I tell if a tool is actually grounded?
Ask it something obscure that is unlikely to be in its library. A grounded tool declines or says it found nothing close. A chatbot answers anyway. Also check that its citations open and say what the tool claimed.
What are the failure modes of grounded systems?
Retrieving the wrong passage, paraphrasing a source inaccurately, a library that is incomplete or biased toward one school, stale sources, and the user treating a reference lookup as a ruling. A good system mitigates each; none eliminates them.
Does HalalScreener's Scholar issue rulings?
No. It retrieves from a library that includes Dar al-Ifta fatwas and the rulings of Ayatollah Sistani's office, asks which school you follow before answering, shows the source passage, and declines when it finds nothing. It is built by the team that runs this site, which is why we use it as the worked example and why we invite you to test it against the five-question check.

Sources

Every figure and ruling on this page links to where it came from. Check them.

  1. Using AI applications to obtain fatwas (fatwa 22255), Dar al-Ifta al-Misriyyah
  2. Digital authority and Islamic legal reasoning: a comparative study of AI-generated and human-issued fatawa, University of Malaya
  3. Islamic chatbots in the age of large language models, arXiv, 31 December 2025
  4. Dar al-Ifta al-Misriyyah fatwa archive (English), Dar al-Ifta al-Misriyyah
  5. Islamic Laws (official English rulings), Office of Ayatollah Sistani
  6. HalalScreener Scholar (the worked example on this page), HalalScreenerBuilt by the team that publishes this site.

Be first when this becomes real

A short note when something changes: a new ruling, a live issuance, a tool worth testing. No weekly filler.