Moroccan Lawyers’ Professional Secrecy and Generative AI
AI News

Moroccan Lawyers’ Professional Secrecy and Generative AI

A lawyer’s use of generative artificial intelligence may involve transmitting information from a client’s file to an external service provider. This operation is often examined only through personal data protection. Moroccan law, however, also subjects lawyers to professional secrecy, whose purpose and scope are not identical to those of Law No. 09-08. This article argues that the two forms of protection must be applied cumulatively. It distinguishes personal data from information protected by professional secrecy and separates technical transmission, possible access, actual access, and legally punishable disclosure. It also explains why contracts, anonymisation, and client consent may reduce certain risks without providing a general authorisation to transmit protected information. The practical issue is therefore not whether lawyers may use generative AI in general, but what information may be entrusted to a particular service under documented conditions.

The digital transformation of Moroccan justice no longer concerns only court administration, electronic procedures, and access to judicial information. It now affects the intellectual work performed inside law firms. Generative artificial intelligence can summarise documents, establish a chronology, translate correspondence, reformulate an argument, or produce a preliminary draft.

The legal difficulty appears when a lawyer enters information from a client's file into a service that operates outside the firm's controlled environment. What appears to be a simple request may involve the transmission and retention of content, the recording of the interaction, access by authorised personnel, the participation of further processors, or the transfer of information to infrastructure located abroad. The conditions may also vary between a consumer chatbot, a professional subscription, an application programming interface, and a privately deployed system.

The expression "using AI" therefore says little about the legal operation taking place. The relevant questions concern the information leaving the firm, the persons or organisations that may receive it, the purposes for which it may be used, and the period during which it may be retained.

Personal data protection offers an initial legal framework. Law No. 09-08 regulates the processing of personal data and imposes requirements concerning purpose, proportionality, security, processors, and international transfers. The National Commission for the Control of Personal Data Protection, or CNDP, has confirmed that artificial intelligence processing involving personal data remains subject to this legislation.

Compliance with data protection law does not resolve the entire question. Moroccan lawyers are also bound by professional secrecy. Article 46 of Law No. 66.23 on the organisation of the legal profession establishes this obligation, while Article 446 of the Moroccan Criminal Code addresses the disclosure of secrets by persons entrusted with them through their status, profession, or function.

The two legal frameworks are connected, but they do not protect exactly the same interests. Personal data law regulates information concerning identified or identifiable natural persons. Professional secrecy protects information connected with the lawyer's professional activity, including information that may not identify a natural person.

This leads to the central question: to what extent can the processing of case-related information by a generative AI service provider be organised without undermining the professional secrecy binding Moroccan lawyers?

The answer requires a cumulative reading of the applicable protections. It is necessary, first, to distinguish the different legal classifications arising from the transmission of information to an AI service and, second, to determine the value and limits of the safeguards surrounding that transmission.

I. Outsourcing Case-Related Information as an Operation Subject to Distinct Legal Classifications

A. The Distinction Between Personal Data and Information Protected by Professional Secrecy

Law No. 09-08 defines personal data broadly. It covers information relating to an identified or identifiable natural person, regardless of the medium in which the information appears. Identification may be direct, through a name or identification number, or indirect, through a combination of factual elements.

A contract, court document, email, or factual account may therefore contain personal data even when the person's name has been removed. A date, location, financial amount, professional position, or unusual sequence of events may be sufficient to identify the person concerned.

A lawyer's professional secrecy follows a different logic. It does not protect only the client's identity or other personal details. It may cover the existence of confidential negotiations, a company's strategy, the structure of a transaction, a contemplated argument, or information provided by a third party.

Some information will fall within both categories. A client's correspondence may contain personal data and also be protected by professional secrecy. Other information may remain professionally confidential without constituting personal data. A strategy concerning a legal person, for example, may not identify a natural person but may still belong to the confidential sphere of the lawyer's assignment.

This difference has practical consequences. Removing the client's name does not necessarily take a document outside personal data law because indirect identification may remain possible. Nor does it necessarily remove professional secrecy because the content may continue to disclose confidential reasoning or strategy.

Consider a lawyer who replaces the client's name with "Company A" but retains the date and amount of a transaction, the counterparty's identity, and the argument intended to obtain a concession. Those elements may allow the people involved to be reidentified. Even if no natural person can be identified, the document still reveals a legal or commercial strategy entrusted to the lawyer.

Substituting letters for names is therefore not enough to establish that the information can safely be transmitted. The lawyer must examine the complete context of the document and the confidential value of its content.

Personal data law itself supports this cautious approach. The definition of processing includes collection, recording, retention, consultation, use, and communication by transmission. Sending a document to a generative AI service therefore constitutes processing even if no employee of the provider actually reads it.

Terminology must nevertheless remain precise. A provider that processes personal data on behalf of the lawyer or law firm may qualify as a processor under Law No. 09-08. The law's definition of a third party excludes the processor and persons acting under the authority of the controller or processor.

This classification does not settle the question of professional secrecy. The fact that a provider is not legally classified as a third party for personal data purposes does not automatically authorise the lawyer to communicate every category of confidential information to that provider.

Personal data and professional secrecy should therefore be understood as partially overlapping protections. Personal data law protects identified or identifiable natural persons and regulates the processing of their data. Professional secrecy protects information associated with the lawyer's assignment, including information concerning legal persons or non-personal strategies.

B. The Distinction Between Technical Processing, Access, and Legally Punishable Disclosure

Uploading information to external infrastructure does not, without further examination, establish a criminal disclosure. Article 446 of the Moroccan Criminal Code requires the disclosure of a secret by a person entrusted with it through status, profession, or function. Its application depends on the legal elements of the offence and the facts of the case.

In the context of generative AI, technical transmission, possible access, actual access, and legally punishable disclosure must be distinguished.

Technical transmission occurs when content is sent to infrastructure outside the firm's controlled environment. The possibility of access depends on the architecture of the product, the provider's internal authorisations, its logging practices, and its contractual terms. Actual access may occur during maintenance, support, security, moderation, or quality-control operations. Whether those circumstances amount to a legally punishable disclosure is a separate question that must be assessed under Moroccan law.

The absence of demonstrated human access does not necessarily end every professional concern. At the same time, the mere movement of data through a network is not sufficient, by itself, to prove that a criminal offence has occurred.

This distinction is necessary because law firms have long relied on external information technology services. Email providers, cloud storage, digital backups, practice-management platforms, and maintenance services may all process professional information. If the involvement of any external provider automatically made processing unlawful, much of the legal profession's ordinary digital activity would become impossible.

Generative AI should not be treated as entirely separate from those services. It nevertheless requires particular attention because the submitted content may be retained in conversation histories, recorded for security purposes, transmitted to further processors, or reused to improve the product, depending on the service and its settings.

Comparative professional guidance supports examining the actual flow of information. The Council of Bars and Law Societies of Europe advises lawyers not to submit personal or confidential client information to a generative AI service without appropriate safeguards. The American Bar Association's Formal Opinion 512 similarly calls for an assessment of the particular product, its policies, and the circumstances of its use.

These documents do not create obligations under Moroccan law. Their contribution is practical: they identify facts that should be examined before protected information is transmitted.

The British Upper Tribunal adopted a strict position in UK and R (Munir) v Secretary of State for the Home Department concerning confidential documents entered into an open AI tool. That decision belongs to British law and should not be generalised to every professional or privately deployed service. It nevertheless shows the danger of assuming that all AI products provide the same level of confidentiality.

This article does not rely on any published Moroccan decision directly addressing the transmission of a lawyer's file to a generative AI service. Two opposite conclusions must therefore be avoided. It would be excessive to state that every form of outsourcing automatically constitutes an offence. It would be equally unsafe to assume that a processor bound by a confidentiality clause automatically belongs within the protected professional relationship.

A proportionate position requires the lawyer to examine the necessity of the transmission, the nature of the information, the control of access, the permitted uses, and the safeguards offered by the particular service.

II. Processing Safeguards as Protection Whose Scope Must Be Defined

A. The Contribution and Limits of Contracts, Anonymisation, and Consent

A contract with the service provider is an important safeguard. Article 23 of Law No. 09-08 requires the controller to choose a processor offering sufficient technical and organisational guarantees and to ensure compliance with those guarantees.

For a generative AI service, the contract should clarify the purposes of processing, the retention period, the possibility of human access, the involvement of further processors, the location of processing, the use of information for training or product improvement, the applicable security measures, and the conditions governing deletion and return of data.

A confidentiality clause cannot, however, provide an absolute justification for the transmission. It may coexist with provisions permitting particular forms of access, logging, monitoring, or secondary use. It may reduce the risk of wider dissemination without answering whether the lawyer was professionally entitled to transmit that particular content for the requested task.

The provider's undertaking also does not eliminate configuration errors or the use of personal accounts by employees. Product functions and contractual conditions may change after the service has been adopted. The contract is therefore a means of controlling the relationship with the provider, but it cannot replace careful selection of the information or examination of the product actually used.

Anonymisation must be approached with the same caution. Effective anonymisation can reduce personal data risks when it makes identification reasonably impossible. Replacing names with initials or invented labels, however, is generally a form of pseudonymisation when the remaining details still permit the original link to be restored.

Dates, professional positions, rare events, locations, and financial amounts may permit reidentification. More importantly, anonymisation for personal data purposes does not necessarily remove the confidential character of a legal or commercial strategy.

Minimisation, pseudonymisation, and anonymisation must therefore be distinguished. Minimisation means transmitting only what the task requires. Pseudonymisation replaces identifiers while leaving open the possibility of restoring the link. Anonymisation seeks to prevent reasonable identification. None of these operations automatically establishes that professional secrecy has been preserved.

Client consent is also sometimes presented as a complete answer. Under Law No. 09-08, consent must be free, specific, and informed. It can be relevant to the lawfulness of personal data processing and may play a role in certain international transfers.

Several limits remain. A case file may contain information about opponents, employees, children, witnesses, experts, and other persons whose rights cannot be exercised by the client. A general clause in a retainer agreement does not necessarily establish that the client understood which service would receive the information, what data would be transmitted, how the content would be used, and what risks the operation involved.

The effect of consent on professional secrecy must be determined under Moroccan law. It cannot be inferred mechanically from the role that consent plays under personal data legislation. Consent may contribute to the legal assessment, but it should not be treated as advance permission for every future technological use.

Contracts, anonymisation, and consent consequently have real but limited value. The contract regulates the relationship with the provider. Anonymisation may reduce exposure. Consent may contribute to the lawfulness of processing within its proper field. None of them proves, in isolation, that professional secrecy has been respected.

B. Selecting the Information and Assessing the Service

The practical consequence of this analysis is not a general prohibition on generative AI. It is a method of decision based on two successive assessments: the information and the service.

The first question is whether the task genuinely requires information from the file. Many uses can be completed through an abstract legal question, a fictional example, or a public document. A request for a general research structure or stylistic reformulation does not necessarily require the client's identity, confidential strategy, or complete set of documents.

The principle of minimisation, already present in Law No. 09-08, corresponds here with the lawyer's professional obligations. Information that is unnecessary for the task should not leave the firm's controlled environment.

The second question concerns the nature of the information. The lawyer should determine whether it is public or abstract, whether it contains ordinary personal data, whether it includes sensitive or judicial information, whether it is protected by professional secrecy, and whether several apparently harmless elements could reveal an identity or confidential strategy when combined.

This is not a statutory classification. It is a practical method for distinguishing the risk attached to identification from the risk attached to confidential content. The more sensitive the information becomes, the less appropriate an open general-purpose service is likely to be.

The third question concerns the exact service being used. The assessment should not be based solely on the provider's name. A consumer chatbot, professional account, application programming interface, and private deployment may have different contractual and technical conditions.

The lawyer should establish who legally receives the information, whether the provider acts only on instructions, which further processors are involved, where the content is processed, and how long it is retained. It is also necessary to determine whether the material may be used for training or improvement, when human access is permitted, whether complete deletion is possible, and what security and incident-notification guarantees apply.

Particular attention should be paid to international transfers. Articles 43 and 44 of Law No. 09-08 regulate transfers of personal data abroad. The CNDP's procedures should therefore be examined when a service processes information outside Morocco.

A foreign processing location does not, by itself, establish a breach of professional secrecy. It does add recipients, applicable legal systems, formal requirements, and risks that should form part of the decision.

Where the conditions governing retention, access, reuse, or transfer cannot be established, the lawyer lacks the information needed to justify the communication of protected content. The appropriate response is to formulate the request more abstractly, remove additional information, use fictional data, select a service with documented safeguards, or refrain from transmitting the material.

An abstract question that contains no information from the file generally presents limited confidentiality risk. A pseudonymised scenario still requires an examination of reidentification and confidential content. A professional product governed by documented contractual and technical safeguards may be suitable when the information is necessary and the applicable formalities have been completed. By contrast, an identifiable file should not be uploaded to a consumer service whose retention, access, reuse, and transfer conditions are unknown.

This approach neither rejects generative AI nor assumes that it is harmless. It places the tool within the lawyer's existing professional obligations. A lawyer does not need to become an engineer, but must possess enough information about the service to decide what may be entrusted to it without weakening the protection owed to the client's file.

Conclusion

Generative artificial intelligence does not create lawyers' professional secrecy and does not make it disappear. It gives a new form to an older problem: communicating protected information to an external technical provider.

Moroccan law already provides two relevant frameworks. Law No. 09-08 regulates personal data processing, security, processors, and international transfers. Law No. 66.23 and Article 446 of the Criminal Code protect secrecy associated with professional practice. The two frameworks should operate cumulatively.

Personal data and information protected by professional secrecy are not identical categories. Effective anonymisation for identification purposes may still leave confidential content exposed. Technical transmission, possible access, actual access, and legally punishable disclosure must also be distinguished. This prevents both the normalisation of all outsourcing and the excessive conclusion that every technical operation automatically constitutes an offence.

Contracts, anonymisation, and consent remain useful safeguards, but they are not general permissions. Their effectiveness depends on the information involved, the task requested, and the conditions of the specific service.

The practical position is therefore restrained. The lawyer should classify the information before choosing the service, prefer abstraction and minimisation, examine the processing chain and international transfers, and refrain from transmitting protected information when the safeguards cannot be established.

Responsible use of generative AI does not require the legal profession to reject the technology. It requires lawyers to remain in control of what leaves the professional environment and of the conditions under which it is processed.

A note on scope:

This article provides general legal analysis and does not constitute legal advice. Service providers' policies and technical conditions may change and should be checked before any professional use.

Explore AI tools and guidance on AISetApp

Understanding what a tool actually does with your data is the first step to using it responsibly. Explore clear, practical AI guides and tools on AISetApp, in Arabic, French, or English.

Explore more on AISetApp
Sources and Further Reading

Moroccan Legislation and Official Sources

  1. Kingdom of Morocco, Law No. 09-08 on the protection of natural persons with regard to the processing of personal data.
  2. Kingdom of Morocco, Decree No. 2-09-165 of 21 May 2009 implementing Law No. 09-08.
  3. Kingdom of Morocco, Law No. 66.23 on the organisation of the legal profession, promulgated by Dahir No. 1.26.75 of 18 August 2026, Official Gazette No. 7536 of 20 August 2026.
  4. Kingdom of Morocco, Moroccan Criminal Code, particularly Article 446.
  5. CNDP, "IA et protection des données à caractère personnel", press release of 18 March 2025.
  6. CNDP, "Sécurité du système d'information".
  7. CNDP, "Conditions applicables aux traitements".
  8. CNDP, "Transfert de données à l'étranger".
  9. CNDP, Notification procedures concerning transfers of data abroad.

Professional Guidance and Comparative Sources

  1. Council of Bars and Law Societies of Europe, Guide on the Use of Generative AI by Lawyers, 2 October 2025.
  2. French National Bar Council, Guide pratique — Utilisation des systèmes d'intelligence artificielle générative, September 2024.
  3. American Bar Association, Standing Committee on Ethics and Professional Responsibility, Formal Opinion 512 — Generative Artificial Intelligence Tools, 29 July 2024.
  4. Law Society of England and Wales, "Using Artificial Intelligence in Legal Practice".
  5. Barreau du Québec, "Intelligence artificielle générative".

Comparative Case Law

  1. UK and R (on the application of Munir) v Secretary of State for the Home Department [2026] UKUT 81 (IAC), particularly paragraph 21. This decision concerns British law and is used only for comparison.
  2. French Court of Cassation, Criminal Chamber, decision of 16 May 2000, No. 99-85.304, Criminal Bulletin No. 192. This decision is not a source of Moroccan law.

Academic Literature

  1. Hamza Jabir, Oum Kaltoum Beni Abbassi and Hassan Assakti, "Digitalisation, intelligence artificielle et régulation juridique : la justice marocaine face aux défis de la prédiction algorithmique," Revue juridique et politique en Afrique, 2026/1, No. 8, pp. 4–28, DOI: 10.3917/rjpa.008.0018.
  2. Soufyane El Homrani and Ahmed Lachhab, "IA générative et sécurité juridique de l'écrit professionnel," Journal of Business Disputes, Vol. 13, No. 3, April 2026, pp. 543–559, DOI: 10.34874/PRSM/Contentieux-Affa-66142.
  3. Václav Janeček and Thomas Melham, "Privilege and Confidentiality in Generative AI Workflows", preprint, 2026, arXiv:2607.05479. This document is a preprint and has not been peer reviewed.
  4. Jordyn C. Tye, "Exploring the Intersections of Privacy and Generative AI: A Dive into Attorney-Client Privilege and ChatGPT", Jurimetrics Journal, Vol. 64, 2024, pp. 309–340.
  5. Abdelmajid Tijani, Le secret professionnel en droit marocain et en droit comparé, doctoral thesis, University of Perpignan, 2015, national reference 2015PERP0013. Only the bibliographic record and abstract were consulted for this article.
  6. Marie-Anne Frison-Roche, ed., Secrets professionnels, Autrement, 1999. The complete book was not consulted for this article.

Provider Documentation

  1. OpenAI, Data Usage for Consumer Services FAQ.
  2. OpenAI, Privacy Policy.
  3. OpenAI, Data Controls in ChatGPT.
  4. Anthropic, Is my data used for model training?.
  5. Anthropic, How long do you store my organization's data?.

Guest article by Abdenbi Mekkaoui, Holder of a Master's degree in Digital Law, Hassan First University of Settat. Formatted for publication on AISetApp; the analysis and views are the author's own.