Artificial Intelligence Applied to Contracts: Panacea or Poison?

: The use of artificial intelligence (AI) in contract writing has led to the emergence of new and innovative contractual practices, including in drafting, execution and dispute resolution. This article presents the different aspects of the use of AI in the design and management of the different contracts of working life, focusing on the key vigilance points for contracting AI and the key clauses that need to be included in contracts to ensure legal compliance and stakeholder protection. A proactive, enlightened and adaptive approach is essential to ensure that the benefits of AI are maximized while minimizing risks and preserving the fundamental principles enshrined in international treaties and the Moroccan constitution. In addition, it also raises questions about the future of the legal profession and the need for lawyers to develop new skills to work with AI.

Today, artificial intelligence plays a massive role in several sectors of human activity: education and training, medicine, banking and finance, industry, agriculture, transport, communication and the list is expanding day by day to other fields and applications. The Kingdom of Morocco has demonstrated a considerable awareness of the crucial importance of the digital transition in recent years, thus demonstrating its willingness to adapt to contemporary technological challenges. Recently, the Economic, Social, and Environmental Council emphasized the need to prioritize AI and put in place a dedicated policy to accelerate the country's digital transformation. This initiative is considered essential to meet the diverse needs of citizens and to contribute to the country's strategic and economic plans. However, the indisputable progress of AI and its high effectiveness have also raised a very large number of questions about the risks and liability issues associated with it. The development of artificial intelligence in the area of contracts has led to the emergence of new and innovative contractual practices, including in drafting, execution and dispute resolution. However, the use of AI in contracts also raises important legal and ethical concerns. Indeed, AI can create risks for data security, the confidentiality of information and the protection of the rights of the contracting parties. The central question is therefore whether the use of AI in contracts is a positive step for contract law or whether it entails legal or ethical risks for contractors. The question is also: what is the role of the human factor in decision-making? In case of error, accident or failure, who will be responsible? The machine, the designer of the algorithm or the principal?
The theoretical interest in this topic is the influence that the application of artificial intelligence can have on the future of contract law. Indeed, as information technology continues to develop at a rapid pace, the use of artificial intelligence in the drafting, negotiation and execution of contracts is increasingly widespread. However, such use raises complex legal issues, in particular as regards liability for error or damage, confidentiality and data protection, as well as the ethical and social implications of the increasing automation of the contract process. Therefore, an in-depth study of the impact of artificial intelligence on contracts is essential to understand the legal and ethical challenges we face and to ensure that contract law remains relevant and effective in an ever-changing world. As regards the practical relevance of the topic, the use of AI in the legal field will have a considerable impact on the role and responsibilities of lawyers. With the automation of certain legal tasks, lawyers will be able to focus more on tasks with higher added value, such as analyzing the results provided by algorithms and making ethical decisions. This could also lead to higher productivity and lower costs for law firms and businesses. However, it also raises questions about the future of the legal profession and the need for lawyers to develop new skills to work with AI. This article presents the different aspects of the use of artificial intelligence in the design and management of the different contracts of working life. We shall begin by mentioning the interventions of artificial intelligence in this very sensitive economic and social field. We will then try to answer the various questions about the risks and liability issues associated with these practices. Some AI tools are developed for contract review and management, both for internal practitioners and non-lawyers. These tools use natural language processing to read contracts, summarize them, and suggest possible changes. For lawyers, the use of these tools saves approximately 80% of the time normally invested in processing contracts 6 . For non-lawyers, these tools can be an alternative to hiring a lawyer to manage contracts, providing them with assistance in reviewing and managing contracts, without requiring legal expertise. It is also important to examine in detail how artificial intelligence contributes to minimizing human error and increasing the coherence of contracts. Indeed, one of the key benefits of artificial intelligence in the contract domain is its ability to minimize human error, often due to fatigue, distraction, or inattention. AI, by contrast, can operate consistently and rigorously, reducing errors in contract drafting and analysis. For example, AI systems use natural language processing (NLP) to identify 7 , extract, and analyze information contained in contract documents. These systems can detect errors such as missing clauses, contradictory clauses, reference errors or section numbering errors. In addition, AI can improve contract consistency by using machine learning techniques to recognize patterns and recurring structures in contract 8 documents. This allows AI to suggest standardized clauses and wordings, ensuring that contracts follow best practices and legal standards. For example, an AI system could be trained to recognize typical termination, indemnification or confidentiality clauses and to suggest appropriate wording depending on the specific context of the contract being drafted. In addition, AI can be used to create automated verification and validation systems that compare contracts being drafted with reference documents and legal databases. These systems can identify gaps between contracts and applicable regulations, as well as detect potential errors or compliance issues before they become problematic. Although artificial intelligence offers many advantages in the area of contracts, it is essential to take into account the challenges and concerns that may arise when integrating it. In this sub-section, we will address the vigilance points necessary for the contractualization of AI, thus emphasizing that the use of this technology must be approached with caution and discernment.

Vigilance points for AI contracting
It is essential to ensure that automated contracts generated by artificial intelligence comply with applicable laws and regulations. This requires the integration of monitoring and validation mechanisms into the AI systems used for contract drafting to ensure their compliance with applicable legal and regulatory standards.
A key challenge is the legal framework for AI, which needs to be adapted to the specificities of automated contracts. In particular, it should be ensured that contracts generated by AI respect the fundamental principles of contract law, such as the ability of the parties to contract, informed consent, the lawful object and the cause of the contract. In addition, compliance with regulations specific to certain areas, such as consumer or labor law, must be taken into account. To ensure compliance, it is recommended to use AI systems with an up-to-date legal database, which automatically integrate relevant legal and regulatory provisions when drafting contracts. Furthermore, the supervision of a legal professional, such as a lawyer or a lawyer, remains essential to validate the conformity of automated contracts and to correct any gaps or inconsistencies. We will address an important and crucial aspect of the vigilance points for contracting AI: the legal certainty of the party selling the AI. Indeed, as mentioned in the introduction, one wonders in the event of an error, accident or failure who will be responsible? The machine, the designer of the algorithm or the principal? In this perspective, we will examine the specific challenges related to the contracting of AI and focus on the key clauses that need to be included in contracts to ensure adequate protection. First, it is essential to identify precisely the stakeholders (designer, user, distributor, manufacturer, programmer, trader/consumer, etc.) and the chain of responsibilities in the context of AI. A crucial aspect to be considered is the obligation to inform contractors, which makes the validity of a contract conditional on the informed consent of the co-contractor. In the context of an AI contract, that obligation acquires fundamental importance. The obligation to provide information, whether of a general nature, a warning or an information requirement, is a singular innovation introduced by the legislator, which emphasizes its importance in the ongoing relations between the various legal actors. Only the study of the extent of this obligation sends us on the embryonic foundations of a supplemental rule, since we see that there are no mechanisms capable of moving this rule towards an overriding taxation. The obligation to provide pre-contractual information, which is a matter of public policy 9 , under Moroccan law is based on Article 3 of Law 31-08, which imposes it on the supplier. It describes it as follows: "any supplier must, by any appropriate means, enable the consumer to know the essential characteristics of the product of the good or service, the origin of the product or of the good and the expiry date, if any, and provide him with information which may enable him to make a rational choice having regard to his needs and means". The legislator provides for a fine of between Dhs 2000 and Dhs 5000 as a criminal consequence for failure to comply with this obligation (art. 173). But the main question on this point is the absence of a civil penalty for that failure. On the surface, Law No. 31-08 does not provide an explicit answer to this question. It is Article 34 which sheds light on the contracting party which bears the burden of proof, stating that "in the event of a dispute between the supplier and the consumer, the burden of proof shall lie with the supplier, in particular as regards the prior communication of the information provided for in Article 29, its confirmation and compliance with time limits, and the consumer"s consent". However, no details are provided as to the fate of the contract or the civil liability of the supplier. In view of this omission, and in order to examine in greater depth the relevance and consequences of the obligation to provide information in the context of the contracting of AI, it would be appropriate to explore the legal regime of this obligation in France. In France, the obligation to provide pre-contractual information is based on article 112-1 of the Civil Code, which provides that the party who has knowledge of information "the importance of which is decisive for the consent of the other must inform him thereof". Specifically, it is only the relevant information, that is to say, information relating to the subject matter, the cause of the obligations arising under the contract, or the status of the contracting parties. The information must enable the undertaking to be given in full knowledge of the facts and the other party to the contract to assess its scope.
When applied to AI, this obligation has a crucial dimension. Because of its complexity, its technicality and the opacity surrounding the algorithms, the case-law is particularly rigorous on this point. It adjusts the intensity of this obligation according to the degree of complexity of the system 10 , but in the field of AI, there is little doubt that judges consider complexity to be intrinsic to this technology. Moreover, despite the general principle of good faith in article 1104 of the Civil Code, the CNIL actively advocates for the loyalty of algorithms 11 . In short, the algorithm must "say what it does and do what it says" 12 . More specifically, the information obligation requires the seller to fully inform the customer about the characteristics of AI, according to the expectations and needs expressed by the customer. The seller must therefore ensure that the customer is well understood and it is essential to accompany the contract with documents containing all the information mentioned above. In the French legal context, the legislator establishes from the outset precise directives concerning the consequences linked to the failure of the trader to comply with the obligation to provide pre-contractual information. While these guidelines are generally applicable, they may also be of particular importance in the context of the contracting of artificial intelligence, a complex and constantly evolving field. Article 1112-1, paragraph 6, of the French Civil Code states that failure to comply with the duty to provide information may lead to termination of the contract in accordance with articles 1130 et seq. 13 . This provision raises two important observations: on the one hand, the legislator has linked the obligation to provide information to explicit civil consequences, namely the liability of the trader and the termination of the contract. On the other hand, these consequences are not necessarily cumulative. The liability of the trader appears to be systematic, as it results directly from his failure to fulfill a legal obligation. This is a liability of a tortious nature, which the consumer can invoke if the trader does not comply with his duty to provide information. The consumer will be able to obtain compensation without having to prove any fault other than that linked to the trader's failure to comply with the obligation to provide information. However, the second consequence, the termination of the contract, depends on certain conditions. Doctrine explains that it is in fact based on whether or not there is a defect in consent. The contract shall be declared null and void only if the breach of the obligation to provide information results in a defect in consent. Even if the contract does not contain all the information relating to its subject matter, the absence of that information does not automatically render it invalid. For nullity to be recognized automatically, the legislature should have provided for it as a condition for the validity of the contract. For this reason, the judge is dependent on the presence of a defect in consent in order to cancel the contract. If the breach of the obligation to provide information leads to a defect in consent, the court is then in a position to declare the contract null and void. By way of reminder, it is clear that the Moroccan legislature did not provide for an explicit legal effect to the breach of the obligation to provide information by the supplier. Failure to do so appears to be accompanied only by a criminal penalty and is not in any way connected with a civil penalty. In addition to the obligation to provide information, it would be appropriate to include in the contract provisions to identify the owner of the training datasets, in the context of the AI contract. Indeed, the development of AI inevitably requires the use of a dataset, which is crucial for the performance of AI. However, such data collection often involves the involvement of various actors, hence the importance of clarifying the ownership of such data in the contract. The contract must also specify the intellectual rights granted, paying particular attention to the licenses granted to the user. It is then necessary to determine the arrangements for the re-use of the data and the associated charges. The contractual nature of intellectual rights must be the essence of the contract, given the central role of software and data in • Email: editor@ijfmr.com

IJFMR23033245
Volume 5, Issue 3, May-June 2023 7 AI. It is also necessary to provide for clauses to determine the owner of the results obtained by AI, given that the lack of legal personality of AI makes the question of the ownership of the rights to its results complex. This is illustrated by the Dabus case 14 . In this context, contracting appears to be an optimal solution in the absence of an appropriate legal solution.
In conclusion, the contractualization of AI raises several key vigilance points to ensure legal compliance and stakeholder protection. The obligation to provide pre-contractual information is of particular importance, particularly in the context of AI, due to its complexity and opacity. Professionals must ensure that they provide all relevant information and that they understand the customer. In addition, the contract must include clear provisions regarding the ownership of the training data and the results obtained by AI, as well as the intellectual rights granted. Finally, it is recommended that monitoring and validation mechanisms be established to ensure that automated contracts comply with applicable legal and regulatory standards, while retaining the supervision of a legal professional. In short, a careful and rigorous approach to contracting AI is essential to prevent the legal and ethical risks associated with this evolving technology.
Having considered the benefits and challenges of using AI in contracts, as well as the vigilance points for contracting AI, it is essential to continue our analysis. In the second part of our discussion, we will address the ethical and legal dilemmas that arise from the application of artificial intelligence in contracts. This will allow us to have a more complete view of the challenges and opportunities associated with the legal framework for AI.

2-Artificial Legal Intelligence: The ethical and legal dilemmas created by the use of Artificial Intelligence in contracts
The man often lacks foresight to face the challenges posed by future innovations, which forces him to regulate them a posteriori, once the problems they have generated have become insoluble by existing legal solutions. However, it is absolutely essential to reflect beforehand on the nature of these problems that the use of artificial intelligence can cause and on the possible solutions to be provided by the legislator.
It is essential to ensure that thinking about artificial intelligence, particularly with regard to responsibility and ethics, is not influenced by exaggerated 9 fanciful ideas or catastrophic futuristic scenarios that lack scientific rigor. It is not possible to conduct a proper legal reflection solely on the basis of speculation. It is therefore essential to focus on the reality of artificial intelligence as it currently exists, as well as on its foreseeable capabilities in the medium term. In some areas, it is no longer a question of anticipating, but rather of reacting to the difficulties posed by AI through the decisions it takes and the actions it implements. Despite the perfection of its algorithm, AI can cause damage of all kinds: personal injury through the use of autonomous cars causing a road 10 accident. AI can also cause economic damage by engaging in risky financial transactions, which can even lead to stock-market crises like the "flash crash" of May 2010 11 . Finally, AI can cause moral IJFMR23033245 Volume 5, Issue 3, May-June 2023 8 damage by disseminating false and discriminatory information. In this section, we will confine ourselves to the contractual liability related to the use of artificial intelligence (AI) and the analysis of liability regimes under positive law in dealing with the requirement of reparation where the object causing the damage is an AI. First, we look for the answer among the existing contractual liability regimes in comparative law and Moroccan law (A), before taking stock of the possible infringements of personal data through the use of AI (B).

Enforcement of contractual liability arising from the use of artificial intelligence
Contractual liability may arise where the damage may be connected with contractual 12 obligations. At least three situations can be envisaged where contractual liability may be affected by the use of AI. In the first case, AI which may have been harmful to its user who acquired the artificial intelligence system by contract. For example, can designers of an artificial intelligence system for decision support in a medical context be held responsible, directly or indirectly, for medical error resulting from incorrect information or suggestions provided by that system? The user will be able to invoke the presence of a hidden defect although the main difficulty will be to demonstrate that the defect of AI did exist on the day of the error and did not arise during the autonomous subsequent learning of AI. Thus, for providers of artificial intelligence products, an important issue is the liability they incur in the event of a malfunctioning of their products. In a second scenario, it will be the use of AI for the performance of a contractual obligation. For example: the use of tools used by lawyers to manage litigation, predictive justice and asset management tools that can mislead them. Customers could then incur the contractual liability of those traders arising from the improper performance of the contract as a result of a software 13 error. In both cases, contractual liability, which is always a human responsibility and cannot be the result of AI. Finally, the third point, which has a certain particularity, concerns the appearance of smart contracts, which makes it possible to create autonomous programs that carry out the terms of a contract, without the need for human intervention once triggered 14 .
When one looks at the changes in legal practices in the digital age, the Anglicism "smart contracts" is increasingly mentioned. Although the concept has existed for twenty years in the United States, it is still not well known in Morocco. Smart contracts work through blockchains 15 , decentralized, distributed, and unmediated databases, stored on computers around the world. This technology makes it possible, in particular, to automate a transaction, to identify it and to time-stamp it while guaranteeing its immutability and inviolability. Blockchain could represent a technological revolution in value transfer, just as the Internet has been in information exchange. However, the use of blockchains has called into question some aspects of the law, including the role of the state as a trusted third party, which blockchains tend to replace 16 . Where a traditional contract is subject to litigation, judges generally refer to the terms stipulated in the contract. However, in an intelligent contract, these clauses are expressed in the form of numerical data. Therefore, when a judge takes a decision on a dispute involving an intelligent contract, he must consider both the purely technological aspects of the contract and determine the legal principles applicable to the situation. For judges, one of the major challenges is to determine liability for disputes involving blockchain or smart contracts. Indeed, their decentralized nature, without intermediaries or governance, raises questions as to who is responsible in the event of a conflict.

Infringements of personal data in the application of artificial intelligence to contracts
When the artificial intelligence system is used in applications targeting users, the issues of confidentiality of the data used by the artificial intelligence system and the protection of the privacy of those individuals should not be overlooked. The integration of artificial intelligence must be done while limiting its possible infringements of fundamental rights and freedoms and the protection of personal data. In the area of fundamental rights and freedoms, this means, inter alia, the establishment of an effective remedy to enable individuals to assert their rights. Article 24 of the new Constitution emphasizes this fundamental right: "Everyone has the right to the protection of his or her privacy. The home is inviolable. Searches may be carried out only under the conditions and in the manner prescribed by law. Private communications, in whatever form, are secret. Only the courts may authorize, under the conditions and in the manner prescribed by law, access to their contents, their total or partial disclosure or their invocation by any person. Freedom of movement, establishment, exit and return to the national territory is guaranteed for all, in accordance with the law." When the Constitution affirms the principle of the right to privacy, it seeks to protect the rights of individuals with regard to their personal information. Moreover, by enshrining the primacy of ratified international conventions, the Constitution requires domestic compliance with the provisions of the International Covenant on Civil and Political Rights, article 17 of which recalls the provisions of the Universal Declaration of Human Rights relating to the protection of the law against arbitrary interference with the privacy of individuals and attacks on their honor their reputation. Over the past ten years, the Moroccan legislator has put in place a legal regime protecting personal data by adopting the following laws: Morocco has developed a substantial legal arsenal for the protection of personal data. Act No. 09-08 on the protection of individuals with regard to the processing of personal data was adopted in 2009 and supplemented by Decree No. 2-17-682 of 2018, which lays down the rules for the implementation and application of the Act. These texts lay down, in particular, the rights of data subjects, the obligations of data controllers and processors, the conditions for the lawfulness of processing, the security rules to be observed and the penalties in the event of infringement of the legislation. These are all issues that need to be addressed contractually before problems arise.

Conclusion
The impact of artificial intelligence (AI) on contracts and the contractual liability regime is a broad and complex subject, with potential implications for many aspects of law, economics and society. AI has already begun to transform the way contracts are drafted, negotiated, and executed. AI systems can automate and streamline contract processes, reducing costs and time, and enabling increased customization. However, the use of AI in contract writing may also raise questions about the clarity, accuracy and fairness of terms, as well as the validity and applicability of automated contracts. AI also raises questions about contractual liability, including the ability of the parties to contract, the definition of contractual obligations and the determination of liability in the event of non-compliance. Liability issues may arise when AI systems act autonomously or semi-autonomously, which may lead to situations where it is difficult to determine who is liable in the event of a breach of contract.
In order to address the challenges posed by AI to contracts and contractual liability, it is essential to develop a clear and coherent legal framework that takes into account the specificities of AI. This may include changes to existing laws and regulations, as well as the development of new AI-specific standards and principles.
In conclusion, AI has a significant impact on contracts and the contractual liability regime, posing many challenges and opportunities for legislators, practitioners and contractual parties. A proactive, enlightened and adaptive approach is essential to ensure that the benefits of AI are maximized while minimizing risks and preserving the fundamental principles enshrined in international treaties and the Moroccan constitution.
Annex 1: The offenses and penalties provided for by Act No. 09-08: Table 1: Criminal offenses and penalties where the perpetrators are natural persons

Infringements Sanctions
The fact of: Implementing a personal data file without the declaration or authorization required by article 12 of Act No. 09-08; continue processing personal data despite the withdrawal of the receipt of the declaration or authorization. not regularize their situation in accordance with the provisions of Law No 09-08, within a period of 2 years starting from the date on which the National Commission was established by the publication in A fine of 10,000 to 100,000 DH, without prejudice to civil liability for persons who have suffered damage as a result of the offense. The fine shall be incurred by any person.
the Official Gazette of an administrative act to that effect, for natural or legal persons whose main and ancillary activity consisted, before the publication of Law No 09-08 in the Official Gazette, in processing data corresponding to Article 1 of Law No 09-08.
Refusal by any data controller of the rights of access, rectification or opposition provided for in Articles 7, 8 and 9 of Law No 09-08 A fine of 20,000 to 200,000 DH for each offense. The fine shall be incurred by any controller.
The act by any person of acting in violation of article 3 (a), (b) and (c) of Act No. 09-08: the collection of personal data by fraudulent, unfair or unlawful means, processing for purposes other than those declared or authorized, subjecting the data to further processing incompatible with the stated or authorized purposes.
Imprisonment of three months to one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
Anyone who: retain personal data beyond the period provided for by the legislation in force or that provided for in the declaration or authorization; to store the data in violation of the provisions of article 3, paragraph (e), of Act No. 09-08; processing for purposes other than historical, statistical or scientific purposes personal data retained beyond the period specified by the legislation in force or that provided for in the declaration or authorization.
Imprisonment of three months to one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
Any person who carries out the processing of personal data in violation of the provisions of article 4 of Act No. 09-08.
Imprisonment of three months to one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
Any person who: without the express consent of the persons concerned, the processing of personal data which, directly or indirectly, reveal the racial or ethnic origin, political, philosophical or religious opinions, trade union membership or which are related to the health of the persons concerned. the processing of personal data relating to offenses, convictions or security measures. Imprisonment of six months to two years and a fine of 50,000 to 300,000 DH or both. These penalties are incurred by anyone.
Any person who carries out or causes to be carried out the processing Imprisonment of three months to of personal data without implementing the measures to safeguard the security of the data provided for in Articles 23 and 24 of Law No 09-08.
one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
The act by anyone of processing personal data concerning a natural person despite the opposition of that person, when such opposition is based on legitimate grounds or when such processing is for the purposes of prospecting, in particular for commercial purposes, as mentioned in article 9 of Law No. 09-08 or by electronic means as provided for in article 10 of the aforementioned Law.
Imprisonment of three months to one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
The act by anyone of transferring personal data to a foreign State, in violation of the provisions of articles 43 and 44 of Law No. 09-08.
Imprisonment of three months to one year and a fine of 20,000 to 200,000 DH or both. These penalties are incurred by anyone.
Any controller, processor or person who, by reason of his or her duties, processes personal data, causes or facilitates, even negligently, the misuse or fraudulent use of the data processed or received, or communicates them to unauthorized third parties.
Imprisonment of six months to one year and a fine of 20,000 to 300,000 DH or both. Such penalties shall be incurred by any controller, processor or person who, by reason of his or her duties, is responsible for processing personal data. The court may also order the seizure of the material used to commit the offense and the erasure of all or part of the personal data subject to the processing which gave rise to the offense.
Anyone who: -hinder the exercise of the supervisory tasks of the National Commission; -refuse to receive the auditors and to allow them to fulfill their duties; -refuse to send the requested documents or information; -refuse to transmit the documents provided for by law. Imprisonment of three to six months and a fine of 10,000 to 50,000 DH or both. These penalties are incurred by anyone.
Any official refusing to implement the decisions of the National Commission.
Imprisonment of three months to one year and a fine of 10,000 to 100,000 DH or both. Volume 5, Issue 3, May-June 2023 13 Such penalties shall be incurred by any person responsible.

Very important:
• In the event of a repeat offense, the penalties provided for above shall be doubled.
• A recidivism is constituted when a person who has been convicted by a court decision which has become irrevocable for one of the offenses provided for by Law No. 09-08 commits an offense of the same nature within one year of the pronouncement of such a decision.

Infringements Sanctions
The commission of one of the offenses listed in the table of offenses committed by natural persons Without prejudice to the penalties that may be imposed on directors who commit any of the offenses set out in the table above, the fines are doubled. In addition, the legal person may be punished by one of the following penalties: -partial confiscation of his property; -confiscation as provided for in Article 89 of the Criminal Code; -the closure of the establishment(s) of the legal person where the offense was committed.

Very important:
• In the event of a repeat offense, the penalties provided for above shall be doubled.