1 Introduction

The societal need for the legal system to make decisions under factual uncertainties is a pertinent issue. Evidentiary rules and presumptions are among the widely used legal methods to enable decision-making under uncertainties and controversies involving facts, evidence, and knowledge. The transformation of evidentiary rules and presumptions is historically related to conceptions of science, paradigms of knowledge, their value in problem-solving, social forces at play, and political and constitutional ideals (Bloemberg, 2020, pp. 4–5 and 66–117; Porwancher, 2016, particularly pp. 95–97).Footnote 1 This transformation continues in our contemporary Western risk societies, where the law is increasingly used to govern a widening array of risks surrounded by old and new kinds of uncertainties (Beck, 2006; Beck & Levy, 2013; Lee, 2009; Weimer & De Ruijter, 2017, pp. 3–5).

A recurrent problem in risk governance is the uncertainty of scientific evidence and scientific-technical knowledge (Beck, 2006; European Commission, 2000). The intensity of some global risks with potential catastrophic or large-scale consequences has increased, and new risks have emerged from the intersection of limited human knowledge with nature, ecological systems, technological systems and society. The limits of human expertise and the increasing awareness of these limits also set boundaries for the governance of risks, which is a widely discussed topic under the theme risk society since 1990s. The sociological observations by Anthony Giddens and Ulrich Beck continue to be topical analyses of structural issues repeated also in the context of artificial intelligence (Beck, 2006; Giddens, 1991, pp. 124–149). The global and societal consequences of the use of new technologies cannot be calculated easily, if at all (Beck & Levy, 2013). Different treaties, laws, and risk management regulations refer to the precautionary approach to solve or mitigate this problem. It is meant to guide decision-making under inconclusive scientific assessments and evidence (Anderson, 2014; Fisher, 2013; Gilles Sourgens, 2021; Lee, 2009; Tosun, 2013).

The precautionary approach and its manifestation in European Union law, the precautionary principle, have been characterized as legal presumptions in academic literature and in the case law of the European Court of Justice (Case C-616/17, Blaise and Others, ECLI:EU:C:2019:800; Gilles Sourgens, 2021). The function of the precautionary approach is to permit decision-making under uncertainty (Case C-41/02, Commission v. Netherlands, ECLI: EU:C:2004:762, para 52; Szajkowska, 2010, p. 195).

The precautionary principle is included in Article 191 of the Treaty on the Functioning of the European Union (TFEU) concerning the environmental policy of the European Union. Article 191 of the TFEU is closely connected with the Union’s aim of a high level of protection of the environment and consumers pursuant to Article 3 of the Treaty on the European Union (TEU), the objectives of a high level of protection of health, safety, environment, and consumers in Article 114 of the TFEU, and the high level of protection of health, environment, and consumers envisaged in Articles 35–38 of the Charter of Fundamental Rights of the European Union. The precautionary principle is included either explicitly or implicitly in EU food, human, animal, and plant health, chemical, biosecurity, and genetic laws.Footnote 2 It applies across sectors as a general principle of Union law (Case T-147/00, Les Laboratoires Servier, ECLI:EU:T:2003:17; para 52; Case T-392/02, Solvay ECLI:EU:T:2003:277, para 121. European Commission, 2000, p. 1; Gilles Sourgens, 2021, p. 1283).

The precautionary approach is yet to be explicitly included in laws and regulations on digitalization in general and artificial intelligence in particular. It is neither referred to in the European Union General Data Protection Regulation (GDPR, Regulation (EU) 2016/679) nor in the drafts of the European Union Artificial Intelligence Act.Footnote 3 GDPR represents risk-centric regulation, and the draft Artificial Intelligence Act even employs a risk and use-case—centric legislative approach. Standard risk regulation with risk-centric legislation and a use-case—based approach operates in the domain of knowable and known risks, whereas the precautionary approach is applied in the domain of unknown risks and scientific uncertainty regarding potential consequences.

The precautionary approach represents a general stance towards the potential but scientifically uncertain wide-scale harmful consequences of any new technology. It is a strategy of due diligence and care for future generations of general-purpose technologies beyond specific use-case regulation. The increasingly powerful tools and wide-scale impacts of digital technologies, particularly general-purpose artificial intelligence (AI), call for generic principles beyond specific regulations to address the potential but not entirely hypothetical consequences of these technologies. The more powerful the tools become, the more issues of risk governance also face the boundaries of knowledge and uncertainty regarding consequences. In digitalization societies will face the same kind of worries and problems that were earlier relevant concerning genetically modified organisms and chemicals. There is also a need to consider rights beyond individuals but without neglecting individuals from a broader societal and collective perspective, a question recently raised in literature concerning ethical and responsible AI (see Dignum, 2018; Rudschies, 2023). The precautionary principle in EU law and the general precautionary approach can respond to some of the potential challenges of the risk, legal and ethical governance of AI systems and other powerful digital technologies. Digital solutions provide some tools to facilitate the application of precautionary approach, which is an information-rich legal construct.

2 Research Question: The Precautionary Approach Design Pattern

Functional solutions are replicated across various fields of law and jurisdictions. Law doesn’t always result from explicit and conscious planning and design; it also evolves as an applied living system, partly influenced by past solutions and traditions. Planned legislative changes are built upon history and traditions (Habermas, 2022). Law, partly through tradition-bound, unconscious design and transformation influenced by political-constitutional ideals, epistemological discourses, and societal forces, gives rise to reusable solutions. Laws are also the product of intentional law drafting and societal, moral, and legal planning underlying it.

The precautionary approach appears to follow a design pattern, akin to the concept of design patterns originally developed by Christopher Alexander in urban planning to describe repeatedly successful designs or plans that function effectively (Alexander, 1979). This concept was later adopted in computer science by software architects. In software architecture, design patterns are generic templates of core elements for effective solutions, facilitating the attainment of various desired quality attributes in complex systems. Design patterns are recurring and structured successful generic templates that enable the achievement of control, coherence, maintainability, interoperability, and security—essential quality attributes—beyond individual software solutions (Bogner et al., 2019; Fernandez et al., 2022; Kelly, 2012, pp. 1, 323–330, and 345; Khwaja & Alshayeb, 2017; Lano, 2014; Meheden et al., 2021; Zhu, 2014). Explicit, structured, and documented design patterns are used to model various types of knowledge beyond information systems and software design, including business models.

Recognized design patterns can also be valuable for modelling essential elements of successful problem-solving in recurring legal issues (Koulu et al., 2021; Koulu & Pohle, 2023). My analysis focuses on the essential structures of legal problem-solving in the application of the precautionary principle, and I will present the results in the form of a documented design pattern in law. My inquiry serves a different purpose compared to, and should not be confused with, the practice-improvement oriented movement of design thinking in legal services. That movement aims to use design methods to formulate and communicate successful contract clauses or other legal model texts to enhance anticipatory and more inclusive justice and risk management, ultimately working towards a more human-centric legal system and services (Corrales Compagnucci et al., 2021; Haapio & Passera, 2021; Hagan, 2020; Hietanen-Kunwald & Haapio, 2021). My inquiry focuses on the structural features of the law as a living system in society and how to describe and communicate the essential elements of how that system is employed in addressing societal problems. Design patterns serve as a conceptual tool to convey knowledge related to successful problem-solving and enable cross-disciplinary communication about the core intentions and functions in problem-solving.Footnote 4

To digitize legal problem-solving, it is necessary to articulate its procedures, models, and values (principles) in a language that can be understood by software architects, engineers, and developers of algorithms for the application of artificial intelligence.Footnote 5 I depart from the idea that the future of law and risk governance will be of hybrid intelligence based on hybrid architectures, in which humans work together with intelligent systems (Akata et al, 2020). This enables augmented intelligence in the processing of large amounts of data in activities like intelligence analyses and other information-rich tasks (Blanchard & Taddeo, 2023). A very old and persistent problem in legal informatics has been the transfer of structure and substance of legal argumentation to a computerized format. Solving this challenge is beyond the scope and limits of this article. Hybrid architectures and the hybrid intelligence they enable require structures and languages to connect ICT and algorithmic decision-making that can bridge legal and computer science professionals.

Patterns of information system design and the intersection of law and digital architectures’ efficiency have gained increased attention in legal practice. Examples from the European Data Protection Board (EDPB), the Danish Parliamentary Ombudsman, and Finland’s Chancellor of Justice are illustrative. The EDPB has identified several deceptive design patterns in user interfaces that hinder the realization of data protection rights (European Data Protection Board Guidelines 03/2022). The Chancellor of Justice, the Supreme Guardian of Law in Finland, has issued several decisions and statements on human-computer system interaction and the requirements for the design and structure of information and communication systems based on the general principles of administrative law. These decisions and statements also provide guidance on how to structure the law to ensure it serves its purpose in digital administration.Footnote 6 The Danish Parliamentary Ombudsman has formulated general preventive rules to guide the development of ICT systems in public administration. The Danish Parliamentary Ombudsman has also conducted prior reviews to ensure compliance with administrative law guarantees of legal certainty during the planning, design, and implementation of ICT systems.Footnote 7 All these constitutional and legal authorities aim to influence how the law is translated into and applied within digital architectures. Both the Finnish Chancellor of Justice and Danish Parliamentary Ombudsman search for tools to facilitate this translation and to facilitate audit and control of how this is designed and done. Design pattern libraries have been found to be useful in integrating legal requirements into software and its data protection and security features (Compagna et al., 2009).

Translating law into digital structures and language is an age-old yet still relevant task general in the field of legal informatics and now specific task related to automatic decision-making (Pohle, 2021; Pöysti, 2023; Saarenpää & Riekkinen, 2023, pp. 7–23 and 116–122; Wiese Schartum, 2020, 2021). How to do it with high level of legal certainty was a topic in influential doctoral thesis in Nordic legal informatics in early 1990s (Magnusson-Sjöberg, 1992; Wiese Schartum, 1993). This task has become essential for legislators, legal guardians, and other legal practitioners, as it ensures the efficiency of rights. Design patterns provide a way to examine the logical and social structures, recurring models, and patterns within the law as it functions within a societal action system. Design pattern lens serves as structured knowledge and a method and medium for problem-solving in society. This presents an opportunity to connect legal sociology with legal informatics, which has been relatively overlooked but holds promise (Wahlgren, 2023).

The methods I employ in this article include qualitative analysis and systemic interpretation of examples showcasing the application of the precautionary principle in European Union law. These methods are supplemented by references to explicit and implicit expressions of the precautionary approach in international law. I conduct structural socio-legal and socio-technical analyses grounded in EU law doctrine. My research is influenced by the Scandinavian legal informatics tradition, and my focus is on outlining the generic structure of problem-solving through law within the precautionary approach. The socio-legal approach is connected to software architecture literature through the concept of design patterns. I will use a review of academic legal and risk management literature to identify the general structural features of the precautionary principle as applied in the case law of the European Court of Justice. My goal is not to interpret legal doctrine concerning the precautionary principle, but rather to present the essential features of its application in a design pattern format for readers outside the field of legal science.

In accordance with the terminology of the TFEU, I will use the term “precautionary principle” to refer to the precautionary approach as applied in EU law, while “precautionary approach” will be used as a generic term. I will also use “precautionary approach” outside the context of EU law. There is no uniform or universal definition of the precautionary approach, and the relative strength of precaution as a legal principle and presumption varies depending on the context and applicable treaty regime.Footnote 8

My paper seeks to contribute to how the concept of design patterns, initially developed by C. Alexander (1979) and then adopted in the software architecture literature, and now modified for socio-legal analyses by Koulu et al. (2021), could provide an intellectual interface to different disciplines for the governance of a digitized, technological society and to facilitate the digitalization of law. My point of departure is that both the generic structure of the law guiding the pattern of which questions are relevant and the context-dependent problem-solving within legal procedures and applying the law shall both be expressed in technical language accessible to ICT systems and algorithm designers, as well as professionals monitoring the functioning of autonomic systems.

In addition to understanding and modelling individual rules and principles of law in a given legal system, this translation also requires a more generic understanding of the structures of law. In Nordic legal informatics literature, the interplay between legislators and lawyers working for legislative drafting and computer scientists in ICT systems design and programming is an old topic. Dag Wiese Schartum, for example, sees systems development and programming as the continuation of the work of the legislator (Wiese Schartum, 2020). Recognition of generic problem-solving models in law, the legal design patterns, and transferring knowledge about them to digital systems architecture and algorithmic design can be a useful working method in the digitalization of law and in the improvement of the law’s problem-solving capacities in an increasingly digitalized society. Design patterns, in particular, can provide a common and shared understanding of how certain repeated problems are solved for interdisciplinary work in the governance of society and its conflicts.

My purpose here is to explore, through a case study of the precautionary approach in EU law, the precautionary principle, whether such a general legal approach could be formulated as a design pattern and discuss some aspects of the utility and weaknesses of such an undertaking. I have selected the precautionary approach as the subject of my case study for three reasons. Firstly, the precautionary approach is one of the general legal constructs and techniques to address scientific uncertainty and decision-making under it. As such, it is an interesting example for digitalization efforts in the application of law. Secondly, the application of the precautionary approach is particularly information-rich, so the application would benefit from digital tools. The application of the precautionary approach has considerable impacts on business and research, development, and innovation activities, making it a good candidate in terms of stakeholder interests for digitalization efforts and additional efforts to ensure the consistency of its application across different industries and sectors. Thirdly, as the potential impacts and risks related to artificial intelligence and other powerful digital technologies become more significant, the application of the precautionary approach to digital technologies itself will be more likely and also more promising in the provision of societal due diligence. The precautionary approach may be one of the tools to avoid responsibility gaps related to AI, which has been a concern in recent literature on responsible artificial intelligence (on responsibility gaps, see Lang et al., 2023).

My article is structured as follows: In Chapter 3, I will shortly present the normative foundations and functions of the precautionary approach and its manifestation in EU law, known as the precautionary principle. I aim to connect the legal foundations of the precautionary approach to modern thinking on responsibility, highlighting the general normative and ethical function of the precautionary approach. Chapter 4 provides the core part of my argument. I present the generic structure of societal problem-solving in precautionary approach. Based on legal and sociologic literature, European Union policy documents, and the case law of the European Court of Justice, I include a process-flow chart and repeated core questions in the application of the precautionary principle in European Union law. I will also present the societal forces at play in the application of the precautionary approach and outline the structure of its application as a decision-tree. This decision-tree serves from the legal perspective as the external view of the precautionary approach, a generic process-flow through which legislative bodies and risk managers at the executive branch of the government apply the precautionary approach. Chapter 5 delves into the internal legal perspective on the application of the precautionary approach. The precautionary principle was originally developed by the case law of the European Court of Justice, based on arguments in philosophical and policy literature and policy papers. The purpose in Chapter 5 is to test whether the internal legal perspective can be expressed as a design pattern and discuss whether the judicial review of the precautionary approach is a distinct sub-pattern or a confluence of two distinct design patterns. Such testing is necessary to ensure that the generic structure presented in Chapter 4 holds in the judicial review and can anticipate its perspective and opposing forces at play, thereby increasing security and predictability in decision-making. Chapter 6 marks a return to the general questions related to design patterns, discussing the strengths and weaknesses of the decision-tree recognized in Chapter 4. This discussion provides final conclusions on the design patterns based on this case study of precautionary approach.

3 Purpose and Foundations of the Precautionary Principle

The purpose of the precautionary principle is to respond to the fundamental threats and risks that technological advancements have caused and enabled (Szajkowska, 2010, p. 175). Human activities and technologies directly and indirectly have far-reaching impacts on nature, the environment, society, and future generations. These potential wide-scale harms require a reconsideration of the role of law in establishing and maintaining human responsibility, which manifests as active duties of care (due diligence) for the future. Duties of care include due diligence regarding potential harms and uncertainties resulting from technology impacts, our own actions and omissions, and due diligence considering worst-case scenarios (Jonas, 1987, pp. 20–26, 33, 66–70, 245, and 249–251).

Modernity has led to a “socialized nature” in which limited human knowledge and technology intersect with nature, the physical environment, and ecosystems (Giddens, 1991, pp. 126–127). This merged environment, partly techno-social and virtual, and partly natural, presents new kinds of risks, including wide-scale risks resulting from the social and environmental impacts of powerful technologies like genetic technologies, artificial intelligence (AI), and the augmented reality infrastructure they enable. This necessitates ongoing multidisciplinary consideration of the concept of risk itself, what we know about it, and how it is governed (Luusua & Ylipulli, 2020, from the AI design perspective). The precautionary approach is one of the legal and governance tools used to address uncertainties and potential large-scale risks.

The precautionary principle is found in Art. 191(2) of the TFEU. The Union’s environmental policy aims for a high level of protection and is based on the precautionary principle and the principle of taking preventive action. It has been further developed as a general principle of Union law in the case law of the European Court of Justice and the General Court. These courts applied it even before its formal introduction into the Treaties, initially without the specific label of precaution (Fleurke & Somsen, 2011; Lenaerts, 2004, pp. 329–335; Solanke, 2023, pp. 482–484; Szajkowska, 2010).Footnote 9

The European Commission has published an influential communication on the principle of precaution (European Commission, 2000). In the current EU legal order, the EU General Food Law includes an explicit definition of the precautionary principle in Article 7(1): In specific circumstances where, following an assessment of available information, the possibility of harmful effects on health is identified, but scientific uncertainty persists, provisional risk management measures necessary to ensure a high level of health protection chosen in the Union may be adopted, pending further scientific information for a comprehensive risk assessment.Footnote 10

The precautionary principle is not directly referenced in the European Union General Data Protection Regulation 2016/679 (GDPR), nor in the drafts for the EU Artificial Intelligence Act or the Council of Europe draft Convention on AI.Footnote 11 The history of introducing the precautionary principle to the European Union law though case law shows that it is a functional approach to solve a recurrent problem and the precautionary approach cannot be recognised only trough explicit use of terminology or enacted legal provision in an Act.

The risk and impact assessment obligations in GDPR and the proposed risk and impact assessment obligations in the drafts for the EU Artificial Intelligence Act, as well as risk assessment obligations in the chemical, food, and plant and animal health legislation, seem to be based on the assumption that risks are generally known or at least knowable. There is room for precaution given the uncertainty surrounding scientific and technological knowledge related to the impacts of computing and big data, especially with the increasing use of advanced artificial intelligence and quantum computing systems. The risks associated with very advanced and widely used computing tools and artificial intelligence call for precautionary measures. The precautionary principle prompts us to reconsider issues related to big data, pseudonymization, and anonymity (Costa, 2012; Matzner et al., 2016, on do-it-yourself data protection; Narayanan et al., 2016, pp. 357–386; Taylor, 2020). There is a need to reconsider potential societal harms beyond the directly recognized and knowable risks to individuals. The current dominant approach in classic privacy and fundamental rights doctrine focuses on individuals and known risks to individual rights (Greenstein, 2017, pp. 125–168 and 183–248 in particular; van der Sloot, 2016; Gellert, 2015, recognizing the potential of the precautionary principle; Luusua & Ylipulli, 2020, from the risk management and technical AI perspective).

The precautionary approach in international fora is included in Principle 15 of the Rio Declaration on Environment and Development (1992). The Rio Declaration serves as a powerful meta-regulatory instrument guiding further treaty law, national law-making, and policy commitments. Principle 15 states that, in order to protect the environment, the precautionary approach shall be widely applied by States. Where there are threats of serious or irreparable damage, lack of full scientific certainty shall not be used as a reason for postponing cost-effective measures to prevent environmental degradation. The precautionary approach is explicitly included in Article 3(3) of the United Nations Framework Convention on Climate Change, recitals on the Paris Agreement on Climate Change, the preamble of the Convention on Biological Diversity, the text of the Cartagena Protocol on Biosafety (2000), and Article 5(7) of the World Trade Organization Sanitary and Phytosanitary Measures Treaty (SPS Treaty).

4 The Precautionary Approach Design Pattern

The fundamental questions and societal problems to be addressed in the application of the precautionary approach can be identified through qualitative analyses and the systematization of the case law of the European Court of Justice and legal literature. The precautionary approach includes interrelated problems: (1) how to deal with the scientific uncertainty concerning the impacts of human action or inaction and (2) how to exercise due diligence regarding the eventual large scale but uncertain impacts (Gilles Sourgens, 2021). The role of law in the application of the precautionary principle is to provide a procedure and thinking structure that are sufficiently analytical and mitigate the impacts of cognitive biases in human decision-making (Clarke, 2010).

The constitutive structural steps in the application of the precautionary principle are as follows: (European Commission, 2000; Solanke, 2023, pp.482–484):

  1. (1)

    Gather available scientific and technical data and prepare proper impact and risk assessments.

  2. (2)

    If the comprehensive scientific evaluation of the risks, using the best available scientific data and methods, leads to uncertainty due to insufficient data or inconclusive or imprecise scientific knowledge, then the precautionary principle should be applied.

  3. (3)

    If the data and knowledge concerning likelihood and potential worst-case consequences plausibly justify the adoption of prudential measures, then these measures to prevent or mitigate risks shall or can be taken. Lack of scientific certainty is neither an obstacle to taking preventive measures nor does it justify postponing necessary action.

Impact assessment and risk assessment are both essential parts of the process of applying the precautionary principle. Impact assessment and risk assessment are distinct but closely related design patterns, along with the precautionary principle (Fleurke & Somsen, 2011, p. 375 on scientific and risk analyses as part of the process of applying the precautionary principle). The precautionary approach operates in the domains of unknown probabilities, partially unknown consequences, and cognitive caveats. It relates to what administrative science and governance studies call turbulent or surprising problems where human prior knowledge and control possibilities are limited (Ansell et al., 2021). However, the Court of Justice has required at least qualitatively quantifiable risks to be present in order to distinguish potential risks from entirely hypothetical ones.Footnote 12 Ordinary, knowable risks are managed through impact and risk assessments, along with standard risk management measures. The problem to be solved in the precautionary approach design pattern is due diligence in the conditions of scientific and evidentiary uncertainty.

Håkan Hydén presented in a highly interesting book about the sociology of law as a science of norms, a critical but friendly reading of Günther Teubner’s theory of law as an autopoietic system (Hydén, 2022, pp. 194–212, in particular pp. 206–210). Society and human activities consist of different relatively autonomous but inter-connected action systems. These action systems include the economy, political system, administration, education system and universities, civil society, research, development, and innovation system (RDI system), nature or ecological system. Law as a system of justice is one of these action systems. The law seeks to control power and limit excessive and unfair use of it. Different action systems, broadly speaking, relate to different sources of power, including natural, arte-factual, cultural, economic, violence-related, and political power. Digitalization and other technological achievements have increased the influence of arte-factual power (Heiskala, 2018). It has also merged with other forms of power, giving rise to new interaction schemas and grids of power.

The precautionary approach is an intervening rule. The law intervenes in the inter-system conflicts between different action systems, often making an intervention in the economic system based on markets to protect human autonomy, a good civil society, nature, or future generations. Law maintains predictability and security, which are basic legitimate expectations of human beings as actors with autonomy and agency. There is a need for predictability and security even in the conditions of uncertainty of knowledge. The opposing forces in the application of the precautionary principle are quite often markets and the economic system versus the interests of the citizens and consumers. The opposing forces may also relate to different generations: economic interests of current generations, thus the current economic system, versus the health and wellbeing of future generations. Opposing forces in the public law relationships are the government or the administrative system versus citizens (civil society) or the businesses representing the economic system.

The application of the precautionary principle entails a resolution of tension between various opposing forces. The opposing forces and the legal system, as a provider of a solution through its intervening rules, represent conflicting forces as well as conflicting sources of legitimacy and rationality. The legitimacy based on the rule of law and democratic legitimacy based on democratic government and accountability may be in tension. The technocratic legitimacy based on cost-benefit analyses and outputs by the risk regulators (bureaucracy) and the democratic legislature and the independent judiciary with democratic legitimacy or the citizens’ rule of law-based legitimacy often appear as opposing forces in the context of the application of the precautionary principle. The European Court of Justice has consistently emphasized the primacy of the European legislator as the author of the value and political judgments on socially acceptable risk-taking (Leonelli, 2021, p. 214).Footnote 13 The conflicts between the legal system and wider legal community and the representatives of the RDI community have also been subject to judicial resolution by the Court of Justice (Case C-528/16, Confédération paysanne, ECLI:EU:C:2018:583; Purnhagen, 2019).

The conflicts between opposing forces belonging to different societal action systems are not the only contestations. Caveats of knowledge and confusions of direction within oneself also call for a resolution. Human beings and the corporations and associations they establish are simultaneously participants in a variety of systems: as consumers and entrepreneurs or investors in the economy (consumer-citizens; investor-citizens) and as citizens in the political system and civil society. The law as a system of intervening rules also maintains the integrity and reasonable balance of human agency in and between various roles of each individual. Concretely, this question appears, for example, in the protection of human autonomy against self-enforcing automatic digital solutions (Matzner et al., 2016; Pöysti, 2018).Footnote 14

The formulation of the design patterns in my paper draws inspiration from the abstract level of use case sketches and process-flow charts, in addition to general higher-level software design patterns. Process-flow charts are useful and intuitively relevant since the precautionary approach has been considered a procedural presumption in legal literature. According to the European Commission communication and the case law of the European Court of Justice, a series of questions is considered in sequential order when the precautionary principle is applied. My qualitative analyses of the legal literature on the application of the precautionary principle in EU law, coupled with the idea of process-flow charts and the generic structure of design patterns, result in a derived decision-tree model. My outline of the decision-tree is an interpretation of the source materials, supported by qualitative saturation and coherence with source materials in legal literature and the case law of the Court of Justice. In this kind of interpretation, a certain amount of subjectivity cannot be removed, and the ultimate test is whether the scientific community would agree on the decision-tree as a possible and relevant model of the generic features of the application of the precautionary principle.

Recognition in the legal literature and policy documents, as well as guidance on law drafting and law application, would mean more or less the same as the inclusion of a specific documented design pattern in a library of design patterns in software architecture. Another potential methodological approach could have been analysing legal case materials with pattern recognition tools provided by assisted learning, similar to how software design patterns can be identified by computerized analyses and computer-assisted semi-automatic analyses, which is not a new idea (Haitzer & Zdun, 2015, pp. 35–57). Machine learning techniques could be of great help, but for the legal relevance and legitimacy of the results, a certain level of human control and interpretative oversight would still be helpful, at least in the beginning. Thus, there are additional methodological issues for computerized or computer-assisted analyses of legal language and legal materials that are outside the limits of this article. The weakness in my approach is the so far relatively unique solo character of my undertaking and the inherent risks of subjectivity in the qualitative interpretation of the findings on legal problem-solving structures.

The structure of the application of the precautionary approach, and in EU law, the application of the precautionary principle, is a system architecture-level design pattern. It includes both procedural and substantive steps and decision rules. The general structure of the design pattern is a decision tree consisting of sequential questions, weighting of evidence, and the application of legal rules, making weighted judgments with a balance between different interests, rights, and principles. I have formulated here in Fig. 1 the sequential questions on the basis of the European Commission communication on the precautionary principle, the general lines of argumentation by the European Court of Justice, and legal literature (European Commission, COM, 2000, p. 12 ff; Gilles Sourgens, 2021, pp. 1292–1301; Leonelli, 2021).

Fig. 1
figure 1

Precautionary approach decision-tree

The construction of the decision-tree depends on the underlying assumptions, which also contribute to the problem-solving capability of the decision-making process. Challenging these assumptions may question the utility of the decision-tree. However, following analyses by Gilles-Sourgens, I have endeavored to incorporate contestability into the model. My decision-tree aims to be pluralistic and not based on a single absolute value (Gilles Sourgens, 2021).

The questions in the decision-tree depart from the idea that our world is fraught with dangers. A socially acceptable risk level needs to be defined. This decision-tree represents the risk manager’s internal view to the decision-making. The application of the precautionary principle in the Union law includes considerable discretion, firstly, on the uncertainty and assessment of risks and uncertainties and their methodologies, and, secondly, on the questions on (a) whether to act and (b) how to act (Leonelli, 2020, p. 1779). Decisions on the tolerable levels of risk, and uncertainty, are ultimately political (European Commission, 2000, p. 15; Leonelli, 2020, p. 1780). The societal judgment in risk governance belongs, prima facie, to the legislative and executive powers, who enjoy democratic legitimacy directly or indirectly. The legitimacy of the public administration builds on the technocratic legitimacy and rationality, which have their bases on the strict observance of the law and on the sound application of expertise and science. The legislator and the executive are the opposing forces; their interaction and the accountability of the executive to the legislator establish fundamental checks and balances. Risk regulation through administrative decision belongs to the executive branch of the government whereas the legislator sets generally applicable rules on the socially acceptable risks and the desired level of protection. The European Union Institutions do not adhere to classic division of power—doctrines. The structure of and division of tasks in the EU risk governance architecture nevertheless seems to have significant impacts on the way in which principle of precaution is applied.

Decision-trees come close to sufficiently practical process flow charts which may be useful in the conversion of relatively abstract principles describing legal and ethical requirements into practical steps and tools in software and algorithmic designs and in the processes of such designs (a practical example of building ethical AI in practise is provided by Vetter et al., 2023). Decision-trees can give a structure to legal arguments, sources and societal weighing which then can serve as reference points for controlled learning in machine learning based and other automated solutions. They can also highlight critical points and responsibilities in the decision-processes to avoid eventual responsibility gaps (on responsibility gaps in the creation and use of AI see Lang et al., 2023).

5 The Judicial Review of the Precaution Design Pattern

The design pattern outlined in Chapter 4 represents an external perspective on the law and risk manager’s internal perspective. This perspective is shared by the legislator, risk managers, who, by training, are often professionals other than lawyers, and scientists working with risks, harms, and decision-making. In this I will explore the internal perspective of the law—the judicial review by the European Court of Justice of decision-making on potential significant harms under scientific uncertainty. The judicial review, determining whether to uphold or revoke the risk manager’s decision, is the ultimate test for decision-making, and case law has significantly contributed to the understanding of the precautionary principle and its formulation in written EU law.

The issue in this internal legal perspective of the judicial review is the constitutionality—in the case of the European Union, the observance of the founding treaties and fundamental principles of Union law—in legislative action and, the legality of administrative action exercised by the European Commission or the Council of the European Union or a Member State authority charged with risk regulation and management. The judicial review involves weighing the questions considered in the application of the precautionary approach and checking the observance of the fundamental legal requirements in the weighing done by the legislator or administration. In judicial review, the weighing is not fully repeated since it is not for the Court and its judges to conduct the societal and technical assessment needed in the application of the precaution. The court reviews whether there is a legal error in the procedure or application of the law or a manifest error in the assessment done by the risk managers. Judicial review has its own specific perspective but does not fundamentally change the process-flow nature and fundamental questions in the application of the precautionary approach. In this chapter, I will take a closer look at the case law of the European Court of Justice through selected, representative cases to recognize distinct questions and features in the judicial review.

The constitutional and judicial review by the courts and by other judicial constitutional guardians departs from the idea that it is not for the Courts to exercise or replace the discretion of the risk manager. The angles and questions of the judicial review are developed in the general constitutional and administrative law doctrine. The Courts apply the doctrine of legally relevant manifest error and the misuse of power and review but do not substitute the action of the risk manager, be it the legislator or the executive. The judicial self-restraint keeps the bar of intervention in the substantive issues of risk and impact assessment relatively high (Alemanno, 2014).Footnote 15 Judicial self-restraint has also been subject to academic criticism that case law leaves too little room for the application of the precautionary principle (Alemanno, 2014; Leonelli, 2021, for example). The case law is not fully consistent (Janssen & Rosenstock, 2016; Janssen & Van Asselt, 2013). To give more weight to the precautionary principle in Union law in setting limits to legislative and executive discretion, a substantive review by the Courts on the adherence to sound science and technological impacts assessments would be welcome.Footnote 16

However, weighty arguments are in favour of the judicial self-restraint. Abstract conflicts of values and questions of justice are not suited to be decided legitimately and rationally in the judicial procedure, which is designed for solving disputes between individual parties or, to control individual instances of the use of power (Yowell, 2018, pp. 16, 65, 70 and 98). The Court of Justice has underlined the role of the legislator and national parliaments in the risk management procedures and definition of acceptable levels of risk (Case C-528/16, Confédération paysanne, ECLI:EU:C:2018:583; Purnhagen, 2019). The judicial and quasi-judicial institutions and the rule of law logic they represent are one of the opposing forces in relation to legislature representing majoritarian democracy and executive and administration in the checks and balances. Judicial institutions derive their legitimacy from the fair procedure, the sound legal reasoning, and, additionally, from the procedural, material and moral authority of the law and, the democratic legitimacy enacted positive law enjoys in current Western societies. This role is in tension, and, sometimes is in direct opposition with the political will in the majoritarian democracy or, with the economic, administrative-technocratic or scientific rationalities.

Judicial review of administrative action across different sectors of legislation applies the same fundamental questions. The judicial review of the executive action can, hence, be considered a design pattern of its own, which is a sub-pattern of the general pattern of design—justify—contest—loop applied in legal decision-making aiming at legal certainty, in which the decision-maker has the power and duty to decide an issue. The decision-maker is then obligated to provide justifications for the decision, and the decision with justifications can be challenged in court or through an appeal to a higher court. The judicial review of legislative and administrative action is a sub-pattern of this generic model of legal decision-making and conflict resolution. In this sub-pattern, the court reviews the legality of administrative action by employing specific angles and questions for the annulment of administrative actions. The judicial review may also extend to the constitutionality of legislative action. The analysis of case law reveals that the structure of reasoning in judicial review broadly follows similar process steps and questions as those used by legislators and administrative authorities in applying the precautionary approach. However, the focus in judicial review lies in testing the legality and the potential occurrence of a manifest error. The angle in answering to the questions outlined in the model presented in Chapter 4 is different.

There is a division of labour, wherein it is the role of legislators and administrative authorities, within the limits of legislation, to establish the socially acceptable level of risk and to analyse and weigh potential risks and their impacts. This process is not duplicated by the courts in the judicial review. The court evaluates whether the legislator or administrative body has performed its duties fairly and in accordance with legal requirements on procedures. It assesses whether there is a manifest error in the procedure or in the balancing of different interests, perspectives, and arguments. Ultimately, the opposing forces are the same as those faced by the primary applier of the precautionary approach, but the court’s perspective is limited to controlling manifest errors. The absence of or uncertainty on the causal link between hazards and impacts do not prevent precautionary risk management. The Court has held that it is the institutions responsible for risk management who shall show they have considered all the relevant factors in the process and, considered sufficiently all the questions described in Fig. 1 in Chapter 4.Footnote 17 The Courts have, however, engaged in the quasi-substantive review of the risk analyses and scientific conclusions.Footnote 18 The main argument to justify this is to ensure the attainment of the high level of protection foreseen in the Treaties. The Court of Justice has used the precautionary principle as a general principle of the Union law limiting discretion of both the Union legislator and the regulatory authorities (Case T-229/04, Paraquat, ECLI:EU:T:2007:217; Case T-257/07, French Republic v. European Commission, ECLI:EU:T:2011:444). The threshold of judicial intervention is a very high one and nearly quantitative, which means that concerns are easily considered entirely hypothetic unless evidence to show quantifiable and plausible impacts is presented (Leonelli, 2021, pp. 196–197).

The Court of Justice and General Court have both applied a presumptive approach to the application of the precautionary principle to the assessment of legislative and regulatory interventions. There shall be a risk assessment, which shall be as complete as possible. The burden of proof lies on the Member State seeking to take protective measures to restrict economic freedoms guaranteed by the Union law, or, on the party challenging the legislative or regulatory considerations by a Union institution. Party challenging the decision shall show sufficient and non-hypothetic existence specific risks albeit there may be a lack of scientific conclusiveness concerning these risks. The party willing to take protective measures beyond Union’s legislation and regulatory practise shall provide arguments and evidence which makes it reasonable to conclude that protective measures are necessary (Case C-236/01, Monsanto, ECLI:EU:C:2003:431, paras. 106–110 and 112–114).

The questions considered in the first steps of analyses of precaution in the case law of the Court of Justice do not change the overall structure of the design pattern on precautionary principle presented in Fig. 1 in Chapter 4. The essence of the specific perspectives of the judicial review can be summarized as shown in Fig. 2. Some further questions are quoted directly from the general design pattern of judicial review and added to the decision-tree of the precautionary approach. These questions are: (1) is there a manifest error of appraisal; (2) is there a misuse of power; (3) is there a breach of binding procedural requirement; or (4) have the institutions manifestly exceeded the limits of their discretion; and, (5) have due consideration been given to the legislative text, legislative intention, purposes of the Union law and, to the requirements of the principle of precaution.

Fig. 2
figure 2

Precautionary approach decision-tree applied in the judicial review of risk management

The judicial review of the precautionary approach is a sub-pattern of the design pattern presented in Chapter 4 (x. 1) to which simply some generic judicial review questions are added. The judicial review of the precautionary approach can be presented as a decision-tree shown in Fig. 2:

The design patterns of constitutional and judicial review, proportionality test, risk assessment and impact assessment are here very closely related design patterns, which all appear in the decision-flow concerning precautionary approach.

6 Discussion and Conclusions

My schematic sketch of the precautionary approach design pattern in law is a tentative of transplanting a design pattern thinking in law and of modelling an application of a legal principle beyond boundaries of an individual discipline. Solving current challenges in risk governance related to new technologies requires a holistic approach bridging across human, natural, technical, social, and legal sciences (Heiskala, 2018). The application of the precautionary principle is a prime example of the need for such bridging.

I recognised through qualitative analyses of the case law, written legal provisions and legal literature the precautionary approach design pattern. Pattern recognition was mainly based on a functional approach, where a pattern of solving a similar problem across various fields of law was recognised. The use of explicit term precautionary principle was not decisive, but the functional stance to the eventual large-scale harms and risks under the conditions of scientific uncertainty. The design pattern outlined here is a way to model some recurrent ways in which living law generally solves inter-system conflicts related to scientific uncertainty on potential consequences of human actions and omissions in socio-technical and economic systems. It is a way to capture core forms, structures and values in law and legal problem solving and to communicate them beyond lawyers and legal scholarship (external perspective to law).

Recognition of design patterns can be a tool to ensure consistency of law across various sectors in law drafting and application of law (internal perspective to law). Documented design patterns in law enable meaningful transfer of the same structure of thinking beyond individual pieces of legislation and legal fields. That alone would be helpful for law-drafters and constitutional guardians. The precautionary approach is a general stance towards wide-scale harms potentially caused by the use of technology. With the increasing impact of digital technology, there is a growing need to apply the precautionary approach, especially to technologies exempted from standard risk governance frameworks. For example, there are significant proposals to exclude foundational models from the scope of application of the European Union Artificial Intelligence Act.Footnote 19

My modest modelling mainly serves to show that the concept of design patterns can help to make sense of the application in living law of a generic legal principle. This alone can serve also digitalization efforts of the drafting and the application of law. The precautionary approach would be both an easy and a challenging case for digitalization when utilizing tools developed by computer scientists. The precautionary approach is an information rich legal presumption and principle. Subjecting it to a computerised information retrieval and weighting would improve efficiency and consistency of discovery and application process. (Praekken & Sartor, 2015, pp. 214–215 for the information richness of law for automation of the reasoning; Wiese Schartum, 2021, pp. 92–93). The application of the precautionary approach entails weighting and balancing which are hard cases to model in computer-readable logic but argument-schemas and other computing techniques enable also formalizations of that to a certain degree (Ashley, 2019; Praekken & Sartor, 2015, pp. 214–215, 223–234 and 240–242). Statistics-based learning models even further facilitate this but also detach modelling from strict application of logical inferences which so far been the legitimate form of formal theoretical rationality in law. The next step could also be to work out this legal sketch with software designers. Then this information rich application context would be ready for digitalization and eventual automation or semi-automation in expert systems facilitating the application of law.

The decision-tree of the precautionary approach has several potential practical applications. Firstly, design patterns, like the sketched precautionary approach decision-tree, can serve as structural guidance and reference points, aiding in drafting coherent legislation and administrative regulation across different fields of law and society. Clearly structured legislation with coherent, effective problem-solving models facilitates the digitalization of legal processes. Repeated and coherent problem-solving formulas are easier to automate and digitalize in a legitimate and reliable manner than incoherent particularities. However, this would require attaching design patterns to guidelines or a collection of best practices for better regulation and good legal drafting.

In Nordic legal informatics literature, the idea of digitalization-friendly legislation has gained attention. Dag Wiese Schartum has proposed that legislation should be developed as digitalization-friendly by clearly distinguishing strict formal rules and principles with situational weighting and the eventual need for human in the loop (Wiese Schartum, 2020, 2021). In Finland, this kind of digitalization-friendly legislation has been recommended by the Chancellor of Justice (Chancellor of Justice of Finland, constitutional review opinion 5.12.2022 drno OKV/2791/21/2022,Review opinion on the final report of the working group for the enhancement of digitalization).

Design patterns or other documented forms of good legislative solutions can be included in the collection of best practices attached to the guidelines on good law drafting and better regulation. Documented design patterns can also function as audit tools or control tools in the oversight for legislative practice, better regulation, and the utilization of artificial intelligence tools, including AI and algorithms audits seeking to ensure the trustworthiness of AI (on AI audits see Mökander, 2023).

In the practice of the Danish Parliamentary Ombudsman and the Finnish Chancellor of Justice, audits have focused on the documentation of how administrative law rules and values of administrative law have been considered in ICT systems development for legal and administrative applications. Document analyses can be complemented by process-analyses of design processes (Sadek et al., 2023). Design patterns provide an eventually more impactful tool to influence into the software and algorithm development and control than the mere generic document analyses of the systems development documentation. Design patterns can provide a tool to bridge value-sensitivity to both design processes and substantial choices.

The precautionary approach decision-tree can also function as a general abstract-level description of the problem-solving and weighting to be written into the controlled learning algorithms for the automatic application of the law or normative problem-solving concerning rights, wrongs, and responsibilities. Many virtues and principles in responsible AI require also solutions to data flow problems and the ability of the system to perform legally relevant computational reflections, that is legally relevant ability of a system to inspect and modify itself to improve its performance (Sileno et al., 2021, pp. 199–201). The decision-tree may also serve as the model for architecture solutions and coding legal processes and these computational reflection processes into digital systems, providing an intermediary stage between legal drafting in natural language and technical writing for the systems. This also enables a systemic human in the loop perspective to control certain outcomes of the automated application of the law through structural reference points.

My analyses of the precautionary approach as a design pattern in law also contributes to a revised, general, societally relevant theory of remedies in law. With the design pattern approach, it is possible to address some serious criticisms related to the precautionary approach and better connect it to the legal tradition of evidentiary rules and principles through which the law has handled uncertainty over facts while providing authoritative decisions to solve problems. Applying the decision-tree and weighting schema facilitates the integration of prior legal quality controls in the decision-procedures and digital systems used in them, thereby contributing to the timeliness of justice.