Civil Law And Uae Algorithmic Codification Of Civil Law Rules .

Civil Law and UAE Algorithmic Codification of Civil Law Rules

1. Introduction

Algorithmic codification of civil-law rules refers to the process of converting legal rules, principles, precedents, exceptions and interpretive standards into a structured computational form that can be processed by an algorithm or AI system.

In the UAE context, this could involve converting civil-law rules concerning:

  • contracts;
  • obligations;
  • damages;
  • good faith;
  • abuse of rights;
  • agency;
  • evidence;
  • property;
  • limitation;
  • guarantees;
  • interpretation of contracts

into machine-readable legal rules, decision trees, expert systems, AI models or automated legal-reasoning systems.

The important legal question is:

Can a UAE civil-law rule be converted into an algorithm without changing the meaning, flexibility or judicial character of the rule?

The answer is only partially. Some rules are relatively easy to codify, while principles such as good faith, reasonableness, equity, proportionality, custom and abuse of rights require contextual human interpretation.

The UAE's new Federal Decree-Law No. 25 of 2025 on the Civil Transactions Law, effective from 1 June 2026, makes this issue especially important because the new Code modernises the civil-law framework while retaining principles requiring interpretation and judicial evaluation.

2. Meaning of Algorithmic Codification

Traditional codification looks like:

Legal rule → statutory article → judicial interpretation → application to facts

Algorithmic codification attempts to create:

Legal rule → structured variables → logical conditions → algorithmic output

For example, a simplified contractual rule could be represented conceptually as:

If Contract A is valid + obligation is due + party B fails to perform + legal conditions for termination exist → remedy may become available.

But actual UAE civil law is rarely this simple.

A legal provision may require consideration of:

  • intention;
  • custom;
  • good faith;
  • proportionality;
  • circumstances;
  • conduct of the parties;
  • public order;
  • nature of the transaction.

Therefore, algorithmic codification should generally be understood as decision support, rather than automatic replacement of judicial reasoning.

3. UAE Civil-Law Environment

The UAE has a predominantly codified civil-law tradition in its onshore legal system.

The Civil Transactions Law provides rules concerning:

  • obligations;
  • contracts;
  • tortious liability;
  • property;
  • security rights;
  • compensation;
  • agency;
  • unjust enrichment;
  • performance and termination.

The new 2025 Civil Transactions Law came into force on 1 June 2026, replacing the former 1985 Civil Transactions Law.

This is important for algorithmic codification because an AI legal system must be capable of distinguishing:

  1. the applicable law;
  2. the date on which the relevant event occurred;
  3. transitional provisions;
  4. the old Civil Transactions Law;
  5. the new Civil Transactions Law;
  6. federal versus local rules;
  7. onshore UAE law versus DIFC or ADGM law.

A poorly designed legal algorithm could produce a legally incorrect result simply by applying an old article to a transaction governed by the new Code.

4. Why Algorithmic Codification Is Difficult

Legal rules are not all of the same type.

Type 1 — Mechanical rules

These are relatively easy to encode.

Example:

If a statutory deadline has expired, a limitation issue may arise.

Type 2 — Conditional rules

These require several factual variables.

Example:

If A breaches a contract, B may obtain a particular remedy subject to specified conditions.

Type 3 — Standards

These are difficult to encode.

Examples include:

  • good faith;
  • reasonable conduct;
  • fairness;
  • proportionality;
  • customary practice.

Type 4 — Judicial discretion

Some matters require a judge to evaluate evidence and circumstances.

Examples include:

  • assessment of damages;
  • credibility;
  • seriousness of breach;
  • appropriate compensation;
  • whether conduct constitutes abuse of rights.

Type 5 — Open-textured principles

These deliberately permit legal development.

Examples:

  • public order;
  • morals;
  • custom;
  • good faith;
  • justice.

These should not be reduced to rigid computer rules without preserving their legal flexibility.

5. Algorithmic Representation of a UAE Civil Rule

A legal algorithm might represent a rule as:

IF

  • valid contract exists;
  • obligation is due;
  • defendant failed to perform;
  • failure is legally attributable;
  • no valid defence applies;

THEN

  • identify available remedies.

But a proper legal system must then ask:

  • What does “valid contract” mean?
  • Was consent defective?
  • Was there mistake?
  • Was there fraud?
  • What was the parties' intention?
  • Does custom affect interpretation?
  • Was performance prevented?
  • Was there force majeure?
  • Was the claimant itself in breach?
  • Would enforcement violate mandatory law?

Thus, legal codification must preserve legal exceptions and interpretive hierarchy.

6. Hierarchy of Legal Rules

A UAE algorithmic legal system should not treat every legal text as having equal authority.

A properly designed system should distinguish:

  1. Constitution;
  2. federal legislation;
  3. applicable emirate legislation;
  4. implementing regulations;
  5. mandatory regulatory rules;
  6. applicable judicial precedents/interpretive decisions;
  7. recognised customs;
  8. contractual provisions;
  9. scholarly/legal commentary.

The system must also determine whether a particular court decision is:

  • binding;
  • persuasive;
  • fact-specific;
  • historical;
  • superseded;
  • distinguishable.

This is essential because an algorithm can easily produce an apparently logical answer from legally irrelevant authority.

7. Codification of Contract Rules

Contracts provide one of the easiest areas for algorithmic codification.

A system could analyse:

Formation

  • offer;
  • acceptance;
  • capacity;
  • authority;
  • lawful subject matter;
  • consideration/contractual exchange where relevant;
  • formal requirements.

Performance

  • contractual obligations;
  • timing;
  • place of performance;
  • good faith;
  • customary obligations.

Breach

  • non-performance;
  • defective performance;
  • delay;
  • anticipatory conduct where legally relevant.

Remedies

  • performance;
  • termination;
  • compensation;
  • other appropriate relief.

However, contract interpretation cannot safely be reduced to literal keyword matching.

The UAE civil-law approach recognises intention, meaning, context, custom and good faith.

8. Contract Interpretation and Algorithms

The former Civil Transactions Law contained Articles 257–266 dealing with contractual interpretation.

The framework included principles such as:

  • consent of the contracting parties;
  • intention and meaning;
  • ordinary meaning of words;
  • giving effect to contractual language;
  • interpretation where ambiguity exists;
  • mutual intention;
  • nature of the transaction;
  • trust and custom.

The new Civil Transactions Law modernises the contractual framework.

This creates an important algorithmic distinction:

Rule-based interpretation

“If the contract says X, output X.”

Legal interpretation

“If the language is clear, give it effect; if ambiguity exists, examine intention, transaction context, good faith, custom and other legally relevant circumstances.”

The second model is much closer to civil-law adjudication.

9. Good Faith and Algorithmic Codification

Good faith is one of the hardest civil-law principles to encode.

An algorithm can identify:

  • contractual obligations;
  • deadlines;
  • notices;
  • communications;
  • conduct.

But good faith may require evaluating whether a party:

  • deliberately concealed material information;
  • exploited another party's mistake;
  • obstructed performance;
  • exercised a contractual right opportunistically;
  • acted contrary to established commercial practice.

These are contextual questions.

The new Civil Transactions Law also strengthens the role of good faith in contractual relationships and pre-contractual dealings.

Therefore, an algorithm should treat good faith as a legal standard requiring contextual evaluation, not merely as a Boolean variable:

Good faith = TRUE/FALSE.

10. Abuse of Rights

Abuse of rights presents another major difficulty.

Under the former UAE Civil Transactions Law, Article 106 identified circumstances in which the exercise of a right could become unlawful, including:

  • intentional infringement;
  • pursuing an unlawful interest;
  • disproportion between desired benefit and harm;
  • exceeding customary limits.

An algorithm could identify these factors.

But determining whether conduct is actually abusive requires weighing them.

For example:

Benefit to claimant = AED 100,000

Harm to defendant = AED 1 million

This does not automatically prove abuse.

A judge may need to consider:

  • why the right was exercised;
  • whether the claimant had a legitimate interest;
  • commercial circumstances;
  • custom;
  • contractual history;
  • alternative means available.

Thus, algorithms should structure the analysis without mechanically deciding the result.

11. Algorithmic Codification of Damages

Damages are particularly suitable for partial automation.

An algorithm can calculate:

  • principal loss;
  • contractual amounts;
  • documented expenses;
  • interest where legally available;
  • dates;
  • quantities;
  • mathematical components.

But it is more difficult to quantify:

  • pain;
  • suffering;
  • dignity;
  • reputation;
  • emotional injury;
  • loss of enjoyment;
  • moral damage.

The UAE civil-law system gives courts significant responsibility in assessing compensation.

Therefore:

Calculation ≠ adjudication.

An AI can calculate components of a claim, but the final legal assessment may require judicial discretion.

12. Algorithmic Codification of Agency

Agency rules can also be structured.

A system can ask:

  1. Did the principal have authority to appoint an agent?
  2. Was the agent authorised?
  3. Was the authority general or special?
  4. What acts were covered?
  5. Did the agent exceed authority?
  6. Did apparent authority arise?
  7. Did the third party act in good faith?

The difficulty is the final questions.

For example, apparent authority often depends upon the conduct of the principal and the reasonable belief of the third party.

That makes it unsuitable for simplistic automation.

13. Algorithmic Codification of Evidence

Evidence is more amenable to structured systems.

An AI system can classify:

  • electronic documents;
  • contracts;
  • emails;
  • admissions;
  • expert reports;
  • transaction records;
  • metadata;
  • system logs.

It can also create chronological timelines.

However, the final question of:

“What weight should the court give this evidence?”

usually remains a judicial question.

The system should therefore distinguish:

evidence identification

from

evidence evaluation.

14. Algorithmic Codification and Judicial Discretion

A major danger is automation of discretion.

Suppose an AI system predicts that:

“90% of similar cases resulted in compensation of AED X.”

That does not mean a judge must award AED X.

The current case may have:

  • different injuries;
  • different evidence;
  • different conduct;
  • different contractual terms;
  • different causation;
  • different applicable legislation.

Precedent and statistical patterns can assist legal reasoning, but cannot necessarily replace the legal reasoning required for the individual case.

15. Case Law

Because UAE reported cases specifically deciding the legality of algorithmically codified Civil Transactions Law rules are still extremely limited, the following authorities are best understood as foundational or analogous authorities for the legal principles that an algorithm would need to encode.

Case 1 — Access Group DWC LLC & Proex Partners Ltd v BLS International FZE

[2023] DIFC CFI 091

This is a particularly useful authority for algorithmic codification of UAE contract law.

The DIFC Court considered contracts governed by onshore UAE law and discussed the former Civil Code provisions concerning:

  • abuse of rights;
  • good faith;
  • contractual interpretation;
  • termination;
  • contractual consent;
  • intention.

The judgment expressly considered Articles 246, 257, 258, 265 and other provisions of the former Civil Code.

Algorithmic significance

A legal algorithm should not simply search contractual words. It must also identify:

  • governing law;
  • clarity or ambiguity;
  • contractual context;
  • intention;
  • good faith;
  • applicable statutory provisions.

This case therefore demonstrates why UAE civil-law codification cannot be reduced to keyword matching.

16. Case 2 — Ashok Kumar Goel v Credit Suisse (Switzerland) Ltd

[2021] DIFC CA 002

The DIFC Court of Appeal considered contractual interpretation under UAE law.

The case is important for the principle that contractual interpretation must operate within the statutory framework governing intention, wording and interpretation.

Algorithmic significance

An AI system should distinguish between:

  • literal interpretation;
  • contextual interpretation;
  • intention;
  • contractual purpose.

It should not automatically select the most frequently occurring meaning of a contractual term.

17. Case 3 — Credit Suisse (Switzerland) Ltd v Goel

[2020] DIFC CFI 066

The Court considered the UAE Civil Code's approach to contractual interpretation, including the importance of mutual intention and the nature of the transaction.

Algorithmic significance

This is important because a legal algorithm must be able to move from:

text

to:

context

when the statutory conditions for interpretive analysis are satisfied.

A system that always applies literal meaning would fail to reproduce the structure of UAE civil-law interpretation.

18. Case 4 — MAG Financial Services LLC v Theron Entertainment LLC

[2017] DIFC CA 006

The DIFC Court of Appeal considered contractual interpretation under UAE-law principles.

The decision demonstrates the importance of reading contractual language within the applicable statutory interpretive framework.

Algorithmic significance

An AI system should therefore encode:

  • express terms;
  • implied terms;
  • statutory interpretation;
  • contractual context;
  • ambiguity;
  • applicable legal standards.

It should not treat an isolated contractual sentence as legally determinative.

19. Case 5 — Dubai Court of Cassation, Judgment No. 288/2025

This authority has been relied upon in the UAE-law contractual context concerning the duty of good faith in contractual performance.

The principle is particularly relevant to algorithmic codification because good faith involves more than mechanical compliance with contractual wording.

Algorithmic significance

An AI system should be capable of flagging conduct that potentially raises a good-faith issue, but should not automatically conclude:

“Good faith = violated.”

The final determination may depend upon facts and judicial assessment.

20. Case 6 — Dubai Court of Cassation, Civil Cassation Nos. 158/2006 and 179/2006

These decisions addressed the UAE abuse-of-rights doctrine.

The Court considered when the exercise of a formally existing right may nevertheless become unlawful.

Algorithmic significance

This authority demonstrates the difference between:

formal legality

and

substantive legality.

An algorithm could determine that:

“Party possesses a contractual right.”

But that does not necessarily end the inquiry.

The next question may be:

“Was that right exercised abusively?”

That second stage requires contextual legal reasoning.

21. Case 7 — Dubai Court of Cassation, Commercial Cassation No. 1070/2022

The Court considered the legitimate right to complain, report wrongdoing and resort to legal processes, while recognising that such rights may be abused in circumstances involving bad faith or improper purpose.

Algorithmic significance

This illustrates another difficult civil-law concept:

a lawful action can become unlawful because of the manner or purpose of its exercise.

Algorithmic systems must therefore distinguish between:

  • existence of a right;
  • exercise of the right;
  • manner of exercise;
  • consequences of exercise.

22. Case 8 — International Electro-Mechanical Services Co LLC v Emirates Speciality Hospital FZ-LLC

[2020] DIFC CFI 114

The Court considered actual, implied and apparent authority.

Algorithmic significance

A contract-analysis algorithm could identify express authority easily.

It is much more difficult to determine implied or apparent authority because those concepts depend on:

  • conduct;
  • circumstances;
  • representations;
  • reasonable reliance;
  • relationship between the parties.

This illustrates the limits of purely rule-based codification.

23. Case 9 — Currency Matters Middle East v Michael Page International Ltd

[2018] DIFC CFI 039

The case concerned apparent authority arising from conduct and communications.

Algorithmic significance

An AI legal system must analyse not merely documents but also:

  • communications;
  • conduct;
  • representations;
  • surrounding circumstances.

This supports a fact-sensitive legal knowledge graph rather than a simple statutory-rule engine.

24. Case 10 — Arabyads Holding Ltd v Gulrez Alam Marghoob Alam

[2025] ADGMCFI 0032

This is particularly important for the technological side of the subject.

The ADGM Court dealt with legal work that contained numerous erroneous or non-existent authorities and considered the use of AI-assisted legal research.

The fundamental lesson was that human professional responsibility remains despite the use of AI.

Algorithmic codification significance

The same principle applies when civil-law rules are encoded into an AI system:

An algorithmic representation of law does not become the law itself.

If the system incorrectly encodes:

  • an article;
  • an exception;
  • a precedent;
  • a transitional provision;

the responsible human or institution cannot automatically avoid responsibility by blaming the algorithm.

25. Direct and Analogical Authority

AuthorityRelationship to algorithmic codification
Arabyads [2025]Direct AI responsibility principle
Access Group [2023]Contract-law rules must be applied contextually
Ashok Kumar Goel [2021]Interpretation under UAE law
Credit Suisse v Goel [2020]Mutual intention and context
MAG Financial [2017]Contractual interpretation
Dubai Cassation 288/2025Good-faith performance
Dubai Cassation 158/2006 & 179/2006Abuse of rights
Dubai Cassation 1070/2022Abuse of lawful procedural rights
International Electro-Mechanical [2020]Actual/implied/apparent authority
Currency Matters [2018]Apparent authority

26. Machine-Readable Civil Law

A sophisticated UAE legal AI system should ideally represent each rule using several layers.

Layer 1 — Legal source

Example:

Federal Decree-Law No. 25 of 2025

Layer 2 — Article

The specific statutory provision.

Layer 3 — Legal concept

Example:

good faith

Layer 4 — Conditions

The factual conditions required for application.

Layer 5 — Exceptions

Situations where the rule does not apply.

Layer 6 — Case law

Relevant judicial interpretations.

Layer 7 — Temporal validity

Whether the rule was:

  • current;
  • repealed;
  • amended;
  • transitional.

Layer 8 — Jurisdiction

Whether it applies to:

  • UAE federal courts;
  • Dubai courts;
  • Abu Dhabi courts;
  • another emirate;
  • DIFC;
  • ADGM.

This last layer is crucial in the UAE.

27. Temporal Codification

One of the biggest risks is legal-version error.

Suppose an AI system contains:

Article X — Old Civil Transactions Law.

If the transaction occurred after 1 June 2026, the system may incorrectly apply the repealed 1985 framework.

A competent legal algorithm should therefore ask:

When did the legal event occur?

Then:

Which version of the law was applicable on that date?

Then:

Are there transitional provisions?

This is similar to version control in software engineering.

28. Jurisdictional Codification

The UAE requires another level of sophistication.

The algorithm should first determine:

Which legal system applies?

Possible systems include:

  • UAE federal/onshore law;
  • Dubai law;
  • Abu Dhabi law;
  • DIFC law;
  • ADGM law;
  • other free-zone legislation.

For example, DIFC and ADGM have legal systems substantially influenced by common-law principles and should not simply be treated as interchangeable with onshore UAE civil law.

Therefore:

Jurisdiction classification must precede rule application.

29. Algorithmic Codification and Judicial Precedent

A civil-law jurisdiction does not necessarily operate through precedent in exactly the same manner as a common-law system.

Therefore, an algorithm should not assume:

“Most recent case = binding rule.”

Instead it should identify:

  • court;
  • level;
  • jurisdiction;
  • date;
  • statutory provision;
  • factual context;
  • legal proposition;
  • whether later decisions modified the reasoning.

This is particularly important when combining:

Federal Supreme Court decisions

with:

Dubai Court of Cassation decisions

and:

DIFC/ADGM judgments.

They do not automatically have identical precedential force.

30. Algorithmic Codification of Custom

Custom is another difficult issue.

Civil-law systems can give legal significance to established commercial practice.

An algorithm might search:

  • industry practices;
  • previous transactions;
  • contractual patterns;
  • commercial documentation.

But frequency does not necessarily equal legally recognised custom.

The legal test may require:

  • consistency;
  • duration;
  • acceptance;
  • relevance to the transaction;
  • compatibility with mandatory law.

Thus:

data frequency ≠ legal custom.

31. Algorithmic Codification and Equity/Fairness

AI systems often use numerical optimisation.

Civil law does not necessarily operate that way.

For example:

“Option A produces the greatest economic efficiency.”

That does not automatically mean Option A is legally correct.

The law may require:

  • fairness;
  • good faith;
  • proportionality;
  • protection of legitimate rights;
  • public order;
  • mandatory statutory provisions.

Therefore, an algorithm should not substitute economic optimisation for legal reasoning.

32. Explainability Requirement

A civil-law AI system should be able to explain:

  1. which legal rule it used;
  2. which version of the law it used;
  3. which facts it considered;
  4. which facts it rejected;
  5. which exceptions it considered;
  6. which cases influenced the analysis;
  7. what uncertainty exists;
  8. whether human review is required.

For example:

Conclusion: Compensation may be available.

Legal basis: Civil Transactions Law provisions concerning civil liability.

Relevant facts: X, Y and Z.

Potential defence: Force majeure.

Uncertainty: Causation requires judicial assessment.

This is far safer than:

AI Result: Claimant wins.

33. Hallucination Risk

AI legal systems can hallucinate:

  • nonexistent statutes;
  • incorrect article numbers;
  • imaginary judgments;
  • outdated legislation;
  • wrong jurisdictions;
  • incorrect holdings.

The Arabyads case demonstrates why this is a serious professional problem.

Therefore, algorithmic codification should use:

  • authoritative legal databases;
  • version control;
  • source verification;
  • citation validation;
  • human legal review;
  • audit logs.

34. Algorithmic Codification of Civil Liability

A civil-liability engine might structure the analysis as:

Step 1

Was there an act or omission?

Step 2

Was it legally wrongful?

Step 3

Was there damage?

Step 4

Was the damage legally attributable?

Step 5

Was there a defence?

Step 6

What type of damage occurred?

Step 7

What compensation rules apply?

Step 8

What judicial discretion remains?

This is useful because the algorithm organises legal reasoning without pretending that every issue has a predetermined numerical answer.

35. Benefits of Algorithmic Codification

1. Consistency

Similar legal questions can be analysed through the same framework.

2. Speed

Large legal datasets can be processed rapidly.

3. Accessibility

Citizens and lawyers can obtain preliminary legal information more easily.

4. Error detection

Algorithms can identify missing:

  • documents;
  • statutory provisions;
  • deadlines;
  • contractual clauses.

5. Legal research

AI can locate potentially relevant cases and provisions.

6. Government efficiency

Administrative bodies can standardise routine processes.

7. Judicial assistance

Judges may use AI for:

  • document organisation;
  • legal research;
  • chronology;
  • precedent retrieval.

36. Risks

1. Over-automation

The machine may make a decision that requires human judgment.

2. Outdated law

The system may apply repealed legislation.

3. Jurisdictional error

The algorithm may apply DIFC law instead of onshore UAE law.

4. Hallucination

The system may invent legal authorities.

5. Hidden bias

Training data may influence outputs.

6. Loss of legal nuance

Open-ended concepts may be converted into overly rigid rules.

7. Lack of accountability

It may become unclear who is responsible for the output.

8. Automation bias

Judges, lawyers or officials may trust the system excessively.

37. Recommended UAE Model

The strongest approach would be:

Human-led algorithmic codification

rather than:

Algorithm-led adjudication

The system should perform:

Law retrieval → classification → rule mapping → factual matching → precedent retrieval → conflict detection → recommendation

while the authorised legal decision-maker performs:

interpretation → evaluation → discretion → final decision.

38. Five Levels of Algorithmic Legal Authority

A useful model is:

Level 1 — Retrieval

Find the relevant legislation.

Level 2 — Classification

Determine which legal category applies.

Level 3 — Application

Match facts to statutory conditions.

Level 4 — Recommendation

Suggest possible legal conclusions.

Level 5 — Decision

An authorised judge or legal decision-maker makes the final determination.

For UAE civil law, Levels 1–4 are highly suitable for technological assistance, while Level 5 should remain subject to the applicable legal allocation of decision-making authority.

39. Key Legal Principle

The central principle can be expressed as:

Codifying a civil-law rule computationally does not transform the algorithm into the legal rule itself.

The statute remains authoritative.

The algorithm is merely an implementation of the legal text.

If the algorithm conflicts with the law:

the law prevails.

If the algorithm misinterprets the law:

the algorithm is wrong.

If the algorithm applies an outdated version:

the result may be legally defective.

40. Conclusion

UAE algorithmic codification of civil-law rules represents an important intersection between traditional codified private law and artificial intelligence.

The UAE's new Civil Transactions Law provides an especially important foundation for this development. However, the process cannot simply consist of converting every statutory article into an automated yes/no rule.

The strongest model is a hybrid legal architecture:

Civil Code

Machine-readable legal rules

Case-law database

Fact and evidence analysis

Contextual interpretation

Human legal judgment

The principal difficulty lies with concepts such as good faith, abuse of rights, intention, custom, proportionality, reasonableness and judicial discretion. These concepts are deliberately flexible and cannot reliably be reduced to rigid mathematical formulas.

The UAE cases discussed above demonstrate the foundation for this approach. Access Group, Ashok Kumar Goel, Credit Suisse v Goel and MAG Financial illustrate the contextual nature of contractual interpretation; the Dubai Court of Cassation authorities illustrate good faith and abuse-of-rights principles; International Electro-Mechanical Services and Currency Matters demonstrate the importance of contextual authority; and Arabyads provides an important modern warning that the use of AI does not transfer legal responsibility away from human professionals.

Accordingly, the appropriate UAE model is not “law replaced by algorithms”, but rather:

“Civil law structured and assisted by algorithms, while statutory supremacy, judicial interpretation, human responsibility and legal accountability remain intact.”

LEAVE A COMMENT