Skip to main content
Compliance & regulation

AI and law 09-08: can you send personal data to an AI model?

Yes, but not just any way: a model hosted outside Morocco receives a data transfer governed by articles 43 and 44 of law 09-08. What to decide before you send anything.

Digi4·· Last reviewed: ·9 min read

Yes, you can, but it is never neutral. Sending personal data to an AI model hosted outside Morocco is a transfer of data abroad under law 09-08: it is only allowed in the cases set out in articles 43 and 44, and it must appear in your CNDP filing. The good news: in many projects you can reduce or remove that transfer by sending less data, or data that no longer identifies anyone.

This guide is information, not legal advice. The texts cited are those published by the CNDP on cndp.ma; for a specific filing, have your analysis checked by a lawyer or by the CNDP itself.

Updated on 17 November 2026.

Why is a call to an AI model a transfer?

When software sends a text, an invoice or an ID document to a language model API, that content leaves your server and is processed by the model provider on its own machines. Most large models are operated from abroad. If the content includes a name, a national ID (CIN) number, an address, a phone number, a medical record or a payslip, you are transferring personal data to another country.

It does not matter that the data only stays there for a few seconds: the law looks at the fact that data is communicated abroad, not at how long it is stored. It is the same logic we describe for cloud hosting in the guide health data and the CNDP: a provider based outside Morocco is a destination you have to declare.

What exactly do articles 43 and 44 say?

Article 43 sets the rule: a data controller may only transfer personal data to a foreign state if that state ensures a sufficient level of protection of privacy and of people’s rights. That level is assessed in particular on the state’s legislation, the security measures applied, the purpose and duration of the processing, and the nature of the data. The CNDP draws up the list of states that meet these criteria.

Article 44 sets out the exceptions, for a state that is not on that list. The transfer is still possible:

  • if the data subject has expressly consented to the transfer;
  • if the transfer is necessary, for example to perform a contract between you and that person, to establish or defend a legal claim, to save their life, or for the prevention, diagnosis or treatment of medical conditions;
  • if it is carried out under a bilateral or multilateral agreement to which Morocco is a party;
  • with the express and reasoned authorisation of the CNDP, where the processing guarantees a sufficient level of protection, in particular through contractual clauses or internal rules.

Source: text of law 09-08 published by the CNDP (cndp.ma, in French). Which countries are currently on the article 43 list: to be confirmed directly with the CNDP at the time of the project; we do not reproduce a second-hand list.

What do you file with the CNDP?

The CNDP publishes a dedicated form: F118, “Request for transfer of data abroad”, which explicitly refers to articles 43 and 44. It asks you to identify the recipient (its country, its role, for example a processor), to describe the data transferred, the purpose, the frequency and the transfer method, to state whether people have consented, and, for a country without sufficient protection, to tick the specific exception you rely on. When the basis is a contract, you attach the contractual clauses or internal rules: this is the case where the law speaks of express and reasoned authorisation.

This form comes on top of the formalities for the processing itself: F211 or F214 for a declaration, F112 or F113 for a prior authorisation request, as explained in which CNDP form to choose. The processing time of an F118 request, and exactly how notification and authorisation fit together case by case, are to be confirmed with the CNDP for your filing; the rule already known still applies here: an incomplete file starts no clock.

Is consent enough for an AI project?

On paper, express consent is one of the exceptions. In practice, it is rarely the right basis for business processing:

  • it must be express and cover the transfer, not just a general privacy policy;
  • it must be possible to withdraw it, and your process must then work without AI for that person;
  • it is fragile in an unbalanced relationship, typically between an employer and its employees.

Consent you cannot prove or honour is worth very little, as we explain in the consent guide. For a regular flow to a model provider, a contractual framework and reducing the data sent are generally more solid.

Can you avoid the transfer by anonymising?

Often, in part. Law 09-08 protects data that can identify a person. Truly anonymised data, meaning data that no longer identifies anyone, even when combined with other information, falls in principle outside its scope. It is a cautious reading to have confirmed for your case, but it opens up three very practical techniques:

  • Minimise. Send the model only what it needs. To classify a complaint, it needs the text of the complaint, not the customer’s name, phone number and address.
  • Mask before sending. Replace names, CIN numbers, phone numbers and IBANs with placeholders, send the masked text, then put the values back once the answer returns, on the server in Morocco.
  • Extract structured data locally. An invoice number, a date or an ICE (Moroccan company identifier) can often be found with simple rules, without an external model.

Watch out for two traps. Reversible masking (pseudonymisation) is not anonymisation: as long as you keep the lookup table, the data remains personal and the transfer must be assessed as such. And some documents are personal end to end: a scanned ID card, a prescription, a payslip. Masking free text is doable; masking an image of a CIN leaves nothing to read.

What are the model hosting options?

Choosing a model is first a choice of where the data goes. Four options, from simplest to most demanding:

  • API from a provider abroad, without personal data. Possible when minimisation and masking are enough. It is often the cheapest and best-performing option.
  • API from a provider abroad, with personal data. A transfer to declare and justify (art. 43 or 44, form F118), with a contract stating what the provider does with the data: retention period, whether it is used to train its models, sub-processors, place of processing. These terms vary between providers and change over time; they are checked at the time of the project.
  • Model run in a specific hosting region. Some providers let you choose the country or region of processing. This does not remove the transfer if that country is abroad, but it can make a difference if the country offers protection deemed sufficient (article 43 list, to be confirmed).
  • Open model hosted on your premises or in Morocco. No transfer linked to the model. The trade-off: a server to size and maintain, and models that are often less capable than the largest commercial models. For document reading or classification, a smaller model is sometimes enough; that is measured on a sample, not on a promise.

What does an AI and CNDP scoping cost?

ServiceRange (DH excl. VAT)Assumption
AI audit (use cases, data, model destination)15,000 – 30,000One process, data described by the client. Source: Digi4 price list
Prototype on your documents12,000 – 60,000One use case, real sample, quality measured. Source: Digi4 price list
Integration into a workflow18,000 – 200,000Masking, logging and human validation included. Source: Digi4 price list
CNDP compliance of the system40,000 – 180,000Inventory of processing, purges, access, filing. Source: Digi4 price list

Model usage fees (billed by the provider by volume) and any lawyer’s fees are not included. The wide ranges reflect different projects; an audit places yours.

When should you not use an external model?

When the data is sensitive by nature (health, biometric data, children’s records) and the gain justifies neither the transfer nor the filing. When a simple rule does the job: a format check, a calculation or matching amounts does not need AI. And when you cannot get written guarantees from the provider on how the data is used. In those cases we recommend either a locally hosted model or no AI at all. This is not a stance: it is the most common outcome of an honest audit.

What we do, and what we do not do

We map the flows (which data goes where, and why), we set up masking, logging of model calls and human validation, and we prepare the technical part of the filing. We do not give legal advice and we do not train models on your data. See our CNDP compliance service and our AI services.

To assess your current processing, take our eight-question CNDP self-assessment. Our platforms that handle health data, such as LA MAS (member portal, healthcare partner area, back office for staff), show the kind of system where these questions arise; they are not AI projects. For a specific project: request a quote.

Frequently asked questions

Is a model used “just for testing” covered?

Yes, if you send it real personal data. Test with fictitious or masked documents until the framework is in place.

Is the provider’s GDPR compliance enough?

No. A transfer out of Morocco is assessed under law 09-08, not under European mechanisms. See law 09-08 and the GDPR.

Do you need to redo the filing if you change model?

If the destination, the provider or the data sent changes, the filing must reflect the new situation. Plan for it before you switch.

My employees use a consumer chatbot with customer data: is that a problem?

Yes, it is an unregulated transfer. A written internal rule and an approved tool work better than a ban nobody follows.

Newsletter

Get our upcoming articles straight to your inbox.

Message a Digi4 manager on WhatsApp