AI's Ethical Folding: Introducing the Shepherd Algorithm
The Directive Normative Ethical Architrave (AEND) as its Guidepost, enforced by Custos AI's Systematic Traceability Infrastructure
The path taken with the definition of Custos AI, our institutional "Ethical Hawk-Eye," and the subsequent introduction of "NanoJnana," the "microscope" for scrutinizing AI decisions, now leads us, almost by natural evolution, to a component I consider fundamental to the robustness and effectiveness of the entire architecture. I am referring to what I have begun to define as Shepherd Algorithms. I do not view them as isolated elements, but rather as a fundamental and pervasive operational layer, legally prescribed and intrinsic to the systemic vision of Custos AI.
The core idea is that for Custos AI to intervene with the fullest possible understanding when an "Ethical Challenge" occurs, and for society to trust the algorithmic processes increasingly pervading it, a purely external control mechanism activated only after the fact is insufficient. This is where my deep conviction about the necessity of incorporating, by law, "internal ethical guardians" into every Artificial Intelligence system with significant impact comes into play. It's about ensuring continuous and native ethical oversight. Although related concepts exist in the AI ethics debate – such as "value alignment by design," "constitutional AI," or "safety layers" – the specificity of Shepherd Algorithms, in my view, lies not only in their being technical control mechanisms but also generators of what I call traceable and processable "ethical data," designed to operate synergistically with the entire Custos AI infrastructure – including the National Observatories and the Mother Observatory, which I will discuss shortly.
Shepherd Algorithms: The Chaperones of Ethically Sound AI
The analogy with chaperone proteins in the biological world is, for me, particularly powerful in illustrating the function of these Shepherd Algorithms. Just as a protein, to be functional, must correctly "fold" into its complex three-dimensional structure, an AI must develop and maintain correct "behaviour"—that is, ethically aligned and functional for its legitimate purposes.
Biological chaperones:
Assist nascent proteins in finding their correct functional conformation.
Prevent "misfolding," or incorrect folding, which can render a protein useless or even toxic.
If a protein "misfolds," they attempt to help it "unfold" and try again.
If the damage is irreparable, they mark it for controlled degradation, protecting the cell.
Analogously, Shepherd Algorithms as legally mandated components of AI software:
Would guide the "host" AI towards correct ethical "folding" from the outset, during training and operation, constantly comparing its actions against what I propose to call the Directive Normative Ethical Architrave (AEND) – that complex of standards (e.g., IEEE 7003, ISO/IEC 23894), operationalized FATE principles, and current AI legislation.
Would actively prevent ethical "misfoldings" – such as the development of bias, the generation of harmful content, or deviations towards non-compliant behaviours – intervening to correct these tendencies before they consolidate and cause widespread harm.
In case of "course errors," they would facilitate correction and realignment processes, requiring verification, human supervision, or forcing a reconsideration of the decision based on explicit ethical constraints.
In cases of severe and persistent ethical "malformations," or what I define as Ethical Decision Crashes that are irresolvable from within, the Shepherd Algorithms would have the legally imposed duty to limit the AI (placing specific functions "in quarantine"), and crucially, to generate a detailed "Ethical Decision Crash Recording." This recording becomes the pulsating heart of their contribution to the Custos AI ecosystem.
The Importance of the "Seal of Ethical Traceability" for the Custos AI Framework
The proposal of Shepherd Algorithms goes beyond a simple internal mechanism: it becomes a "Seal of Ethical Traceability," as I sometimes like to metaphorise it, fundamental for the entire chain of oversight I envision for Custos AI.
By legally mandating these "seals," the indispensable informational foundations are created:
Direct Input for "NanoJnana": When Custos AI, upon request from a qualified body, initiates an "Ethical Challenge" and deploys its "NanoJnana" investigation tool, the latter will not operate in a vacuum. The primary and richest source of data for its analysis will be precisely the Ethical Decision Crash Recordings produced by the Shepherd Algorithm of the AI under examination. These recordings – logs of input/output, activated parameters, violated AEND principles, self-correction attempts – are the equivalent of the "biological material" that NanoJnana, our "ethical microscope," will analyse. This will make the inspection deeper, based on documented facts and not just external inferences. Analysis would become a matter of deciphering the recorded history, rather than divining hidden intentions.
Evidentiary Standardisation for Custos AI: Since the requirements for Shepherd Algorithms and the format of their logs would be legally defined, a crucial cross-system standard would be created. Custos AI could then utilise consistent and comparable verification and audit methodologies across different AIs, and its rulings or recommendations would have a more solid and transparent evidentiary basis. The "Ethical Compliance and Interpretability Mappings" produced by NanoJnana would gain authoritativeness.
Dynamic and Preventive Monitoring of the Entire Custos AI System: Anonymised and aggregated data from the myriad active Shepherd Algorithms would be channelled towards their respective analysis nodes.
From National Observatories (with their National Ethical Reference Archives) to the Supranational Mother Observatory (with its Central Ethical Archive) within Custos AI
And it is here that the data infrastructure I have in mind takes an even more defined shape, anchored in the structures of Custos AI:
The "Ethical Decision Crashes," precisely tracked by Shepherd Algorithms, are sent, again by legal obligation, not to generic databases, but specifically to what I outline as the "National Ethical Reference Archives" (AERN). I envision each AERN as a structural and dedicated component within each National Observatory (essential components of Custos AI's institutional infrastructure at the state level). Each Observatory stores and thrives on this data for its analyses.
National Observatories examine this data from their AERNs. Their function, as outlined, is not limited to monitoring. By law, they must send qualified improvement notices to the AI companies that produced problematic systems, imposing strict deadlines for resolution (e.g., three months) and, in case of non-compliance, being able to propose (to the authorities responsible for executing sanctions) escalating fines up to the temporary suspension of that system from the market. Rigour is essential for effectiveness.
The vision is completed with the establishment of what I have dubbed the Supranational Mother Observatory (SMO-AI), the strategic apex within the governance of Custos AI. Like the national observatories, the SMO-AI will manage and utilise its supranational archive, which I would call the "Central Ethical Archive" (CEA). This CEA would not be a mere duplication, but a meta-archive aggregating selected data, global trends, and comparative analyses from the national AERNs. The SMO-AI would use the CEA for:
Global Harmonisation: Promoting the harmonisation of ethical standards and Shepherd Algorithm logging protocols internationally, facilitating cooperation between National Observatories and data comparability across different AERNs, strengthening the CEA's role as a central knowledge hub.
Strategic Risk Analysis: Conducting strategic analyses of emerging ethical risks at a global level, based on the consolidated information in the CEA.
Guidance on Ethical Research and Development: Publishing directives and recommendations for the research community and AI developers, steering innovation, almost like "genetic guidance" informed by CEA analysis.
Support for the Evolution of the AEND: Providing input for the periodic updating and evolution of the Directive Normative Ethical Architrave (AEND) to which all Shepherd Algorithms must adhere, based on globally learned lessons stored in the CEA.
The Mother Observatory, actively nourished by its Central Ethical Archive, would thus act as the "strategic brain" of the ethical oversight system, capable of looking beyond local contingencies to steer the entire AI ecosystem towards greater ethical robustness, providing Custos AI with large-scale predictive and normative capabilities. And it is precisely within this dynamic that another element I had outlined in the initial reflections on Custos AI would fit: what I defined as the "Office for Algorithmic Ethical Compliance." Recall that this Office was conceived as an independent entity responsible for receiving and formally assessing the validity of "Ethical Challenge" requests before activating the Custos AI infrastructure. Well, I see this Office (or its supranational counterpart, if the Mother Observatory were at such a level) not only as a manager of "bottom-up" or "external" requests (from Parliaments, Courts, etc.), but also as the interface that relates directly to the Supranational Mother Observatory. For example, it could be this "Office" that conveys the strategic analyses and recommendations for updating the AEND produced by the SMO-AI to the institutional channels designated for their implementation. This "Office" would function as a high-level administrative-operational hub, ensuring that the information cycle between aggregate global oversight (SMO-AI), specific audit processes (Custos AI/NanoJnana), and normative updates (AEND) is continuous and coordinated.
Beyond the Structure: Addressing Practical Challenges
It is clear that such a complex architecture, however necessary and coherent in my view, raises questions about its concrete implementation. These are not mere objections, but genuine design and political challenges to be embraced to transform the vision into an operating reality. Some deserve initial exploration:
Technical Feasibility of Shepherd Algorithms:
A crucial question is: What can current and future Shepherd Algorithms realistically "understand" and record? Certainly, significant statistical deviations indicative of bias (monitorable against standards like IEEE 7003) could be tracked. Clear errors in adhering to formal constraints (e.g., procedures or decision limits set legally/regulatorily) would be easily logged. Privacy violations through unauthorised data access or processing could be flagged.
But what about more nuanced ethical dilemmas, where "correct behaviour" depends deeply on context that an AI might not fully grasp? Here, the challenge becomes tougher. I believe that, initially, Shepherd Algorithms should focus on objectifiable metrics and process traceability, rather than aspiring to resolve every ethical ambiguity. The log itself, however, should be as detailed as possible, capturing not only the error but also the data flow and internal parameters that led to it. Research in XAI and interpretability will be crucial here to progressively enhance their "sensitivity." We are not aiming for perfection, but for continuous improvement in the AI's capacity for meaningful introspection and recording, remembering the goal: to provide Custos AI with the best possible informational picture.
Dynamic Definition of the Directive Normative Ethical Architrave (AEND):
For the AEND to be effective, it cannot be a monolith etched in stone. AI evolves with dizzying speed; global cultural sensitivities, while sharing a core of universal values, have specificities. How, then, to create a politico-technical process for its definition and constant updating that is agile, competent, inclusive, and shielded from undue partisan pressure? I think the Supranational Mother Observatory (SMO-AI) could play a key role here. It could coordinate a standing assembly of experts (technicians, jurists, ethicists, sociologists, civil society representatives, and crucially, representatives of diverse cultures) who, based on analyses of "Ethical Crashes" detected globally by the CEA, cutting-edge research, and international public debates, propose periodic updates to the AEND. These updates should then be ratified through supranational mechanisms (e.g., under the auspices of the UN or new dedicated treaties), while also allowing individual states or regional unions (like the EU with its AI Act) to integrate and further detail the AEND for their specific context, provided it doesn't conflict with the global core. It is a multi-level governance challenge, but indispensable. I recall, as I wrote in "Why I Believe We Need an Ethical Hawk-Eye," that "its legitimacy, initially derived from specific and rigorous procedures, might one day even find formal recognition in the constitutions of various states." This principle would apply a fortiori to the AEND that those states would commit to enforcing.
Governance and Composition of National Observatories and the Mother Observatory:
The effectiveness of the entire Custos AI system rests on the independence and competence of these entities. How to ensure, for example, that National Observatories do not become mere "rubber stamps" or, worse, subject to political or corporate influence? Here I return to the idea that activating Custos AI "would not be an informal process" and its governance should recall "in some way the solemnity with which the intervention of a supervisory authority is requested or a formal investigation is launched." I envision bodies whose composition results from transparent appointments, with input from different branches of government (parliamentary, judicial) and strong involvement of independent academic experts and civil society representatives. Fixed, non-immediately renewable terms, public hearings, and accountability through respective parliamentary bodies would be crucial. The sanctioning authority of the Observatories (or, more realistically, their authority to propose binding sanctions to the designated executive bodies) should derive directly from the law establishing Custos AI, and appeal procedures against sanctioning decisions should follow normal judicial channels to guarantee the right to defence.
At the Supranational Mother Observatory level, this would be a high-profile technical-advisory body, appointed by a consortium of States or an international organisation, with a strong emphasis on scientific and ethical expertise. Its power would reside more in the authoritativeness of its global analyses and recommendations than in direct sanctioning power, barring future configurations of global sovereignty.
Positive Incentives: Beyond the Stick, the Carrot:
Although the sanctioning mechanism is, in my opinion, indispensable for giving the structure teeth, it is also true that a mature system does not rely solely on deterrence. It would be intelligent and beneficial to also consider incentive mechanisms for companies that not only comply with the minimum AEND standards through their Shepherd Algorithms but also go beyond, demonstrating proactivity and excellence in AI ethics. The Mother Observatory or National Observatories could promote "Voluntary Ethical Excellence Certifications" (a sort of "ethical quality mark") based on the effectiveness and advanced transparency of their Shepherd Algorithms, the robustness of their ethical development processes, and the scarcity of "Ethical Decision Crashes." These certifications could translate into reputational advantages, privileged access to public procurements requiring high ethical standards, or even tax benefits. This would create a "market for ethical AI," where committed and transparent adherence to robust principles becomes a competitive asset, not just a compliance cost. This could also encourage the voluntary sharing (in anonymised form) of ethical "near misses" or mitigation best practices, accelerating collective learning.
These are but initial reflections on vast topics, but it is crucial to start posing them. A system like Custos AI, with its Shepherd Algorithms and its entire architecture, cannot be conceived as a perfect and static mechanism, but as a learning and adaptive organism. The challenge is laid down, and I believe it is worth taking up.
A Further Step: Institutionalising Ethical Algorithm Design from the Outset
And just as this complex ecosystem of verification, control, and learning is articulated, an awareness emerges with ever-greater force: oversight, however sophisticated, primarily acts on systems already existing or in advanced development. But could we not – and perhaps should we not – more fundamentally influence the algorithmic creation process from its very conception?
I believe so. This is why my vision for responsible AI does not stop at the architecture of Custos AI and its components, but extends to considering the need to promote a cultural and institutional shift at the root of the algorithmic design process. Here, drawing inspiration from the European context with which I am most familiar and which is already leading important regulatory initiatives like the AI Act, I envision the importance of establishing (and ideally, seeing similar initiatives flourish globally) one or more permanent bodies specifically dedicated to "Ethical Algorithm Design." Not so much, and not only, a "ministry" with purely executive tasks, but perhaps a "High European Commission for the Ethical Co-Design of Algorithms" or a "European Institute for Ethical and Responsible Algorithmic Design," structured similarly to other highly specialized European agencies but with a unique and profoundly multidisciplinary mandate.
Within such a Commission or Institute:
Technicians, Computer Scientists, and Mathematicians: Could analyse a priori the robustness, security, and potential vulnerabilities (including systemic biases) of new classes of algorithms or emerging AI architectures, even before they achieve widespread commercial or social diffusion. They would study, for example, the formal aspects of the verifiability of Shepherd Algorithms.
Ethicists and Specialised Jurists: Would constantly dialogue with technicians to translate the principles of the AEND (and fundamental ethics) into concrete design requirements, challenging implicit assumptions and helping to foresee the ethical-social implications of architectural choices. Their role would be to facilitate correct ethical "folding" already in the designer's mind.
Social Scientists (Sociologists, Psychologists, Behavioural Economists): Would bring crucial understanding of how algorithms interact with human and social dynamics, anticipating potential impacts on social cohesion, individual rights, and fairness mechanisms. They would help define more refined contexts of use and impact metrics for evaluating "incidents."
Representatives of Civil Society and "Vulnerable Stakeholders": Their voice would be essential to ensure that the perspectives of those potentially most impacted, positively or negatively, by algorithmic decisions are considered from the outset, and not merely as an ex-post corrective.
The mandate of such a body would not be to block innovation, but to proactively guide it through the formulation of ethical design guidelines (which would feed into the AEND), the promotion of research for "ethics-by-design" algorithms, the training of specialist skills, and perhaps even through a function of "preliminary ethical consultation" (non-binding, but authoritative) on AI projects of particular sensitivity or scale. It would be, in essence, the place where the "genetic matrix" of future algorithms is enriched with the best possible "ethical nourishment," in close dialogue and collaboration with the Supranational Mother Observatory for the aspect of learning from real-world data. It would create, upstream of the Custos AI system, a culture and practice of design that already internalises ethical requirements.
In Summary: My idea of Shepherd Algorithms configures the creation of a pervasive network of embedded and mandatory "ethical recorders," whose existence and "secretions" (the crash recordings) become the lifeblood for the entire body of Custos AI – from the National Observatories that monitor and sanction (and house the respective AERNs), to the Mother Observatory (with its Central Ethical Archive and collaboration with the Office for Algorithmic Ethical Compliance) which outlines the global vision, and now ideally in dialogue with this new High Commission for Ethical Algorithm Design – to NanoJnana which, thanks to these recordings, can perform precise ethical "biopsies" when an "Ethical Challenge" requires it. The legal imposition of these "Seals of Ethical Traceability," inspired by the tireless work of chaperone proteins, is not a constraint, but the necessary condition to transform the aspiration for ethical AI into a concrete, measurable, and governable reality, within a fully articulated Custos AI system capable of facing the challenges of the future.
This articulated framework for Custos AI, with the crucial introduction of Shepherd Algorithms and the vision for institutionalising ethical algorithm design, represents a significant step in making responsible and traceable AI a reality. Bolstered by the growing interest and valuable interactions I am experiencing with my network of contacts in the field of AI ethics and beyond, I intend to present, perhaps partially at first, Custos AI and its framework at upcoming summits and similar meetings. I sincerely thank all those who, with their advice, discussions, and listening, are actively contributing to the evolution of this idea.
Shepherd 734's Log: Witness Custos AI's "Ethical Hawk-Eye" in Action
A Greeting to my readers of Learn Vedanta Substack,
Discover more stories and reflections in my books.
You can also connect with my professional journey on LinkedIn.
I value your input. Reach out with feedback, suggestions, or inquiries to: cosmicdancerpodcast@gmail.com.
Grateful for your time and readership.