Governed Metaprogramming for Intelligent Systems: Reclassifying Eval as a Governed Effect

Alan L. McCann · 2026

Read Governed Metaprogramming for Intelligent Systems: Reclassifying Eval as a Governed Effect by Alan L. McCann (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-05248.txt.

Introduction

Alan McCann argues that when AI systems create runnable code at runtime, the step from form to running should be governed like any other powerful effect. In classical languages, running a program form is a free, basic act. McCann calls that step an authority boost, since it converts written structure into the power to act, and proposes guarded materialisation instead.

His governed metaprogramming design keeps program forms as plain values that can be handled purely. Before execution, a control layer inspects what the program needs, policy fit, and resource costs, issuing exactly one governed directive. He formalises the rules, proves key traits including a no-bypass theorem, and builds the design in a workflow language for AI systems.

Catalog record

CREATORAlan L. McCann
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE32 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.05248

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Governed Metaprogramming for Intelligent Systems: Reclassifying Eval as a Governed Effect Alan L. McCann Abstract AI systems increasingly synthesize executable structure at runtime: LLMs generate programs, agents construct workflows, self-improving systems modify their own behavior. In classical homoiconic and staged languages, the transition from code representation to execution is unrestricted. eval is a language primitive, not a governed operation. We argue that in governed intelligent systems, this transition is an authority amplification: it converts symbolic structure into executable authority and must be mediated like any other effect. We present governed metaprogramming , a language design where program representations (machine forms) are first-class values, form manipulation is pure computation, and materialization (the transition from form to executable machine) is a governed effect subject to structural inspection. The governance system analyzes the proposed program’s capability requirements, policy compliance, and resource estimates before permitting execution. We formalize two judgments: pure form evaluation (which emits no directives) and governed materialization (which emits exactly one governed directive). We prove three properties: purity of form manipulation, the no-bypass theorem, and boundary preservation. We implement the design in MashinTalk, a DSL for AI workflows compiling to BEAM bytecode, and report on integration with 454 existing machine-checked Rocq theorems. The central contribution is reclassifying eval from a language primitive into a governed effect. 1 Introduction AI systems generate executable structure. An LLM writes a workflow. An agent constructs a tool-calling plan. A self-improving system reflects on its own behavior and produces a modified version of itself. In each case, something that was data becomes something that runs. This transition is the central problem of this paper. In classical programming, the transition from data to executable code is handled by eval (Lisp, 1960 McCarthy 1960 ), run (MetaOCaml Kiselyov 2014 ), or equivalent operations. In all cases, the transition is unrestricted: any valid representation can become running code. We make three observations: 1. AI systems increasingly synthesize executable structure at runtime. This is not a future concern; it is the operational reality of agent frameworks, code-generating models, and self-improving systems. 2. Classical homoiconic and staged systems provide a path from code representation to execution that is not subject to a first-class governance boundary. 3. In governed intelligent systems (those with explicit effect boundaries, capability control, and audit requirements), unrestricted execution of generated structure breaks the governance model. The conclusion follows directly: Generated structure must cross the same governed boundary as every other effectful operation. This paper provides the mechanism. We introduce machine forms : first-class values representing program structure. Form manipulation (inspection, transformation, composition, diffing) is pure computation. The transition from form to executable machine, which we call materialization , is classified as a governed effect. The governance system inspects the structural content of the proposed program before permitting execution. The key insight. eval is not merely computation. It is authority amplification. When a form becomes running code, the system crosses from symbolic structure into executable authority: the authority to invoke models, perform I/O, consume resources, and affect external systems. Traditional homoiconic systems treat this as normal language power. We argue that in governed intelligent systems, it is a privileged transition and must be mediated. The paradigm. This paper adds a fourth layer to the emerging paradigm of governed computation: 1. Pure computation (no effects by construction) 2. Governed effects (all I/O through governed directives) 3. Governed evolution (version changes through evolution ledger) 4. Governed metaprogramming (code generation through governed materialization) Without layer 4, a reviewer of the first three layers can immediately ask: “What if the system generates a new program with different capabilities?” This paper answers that question. Contributions. • The reclassification of eval from a language primitive into a governed effect, with a precise characterization of materialization as authority allocation (Section 3 ). • Machine forms: a concrete data type for structured program representation with quote, splice, and reflection constructs (Section 4 ). • Formal operational semantics with two judgments: pure form evaluation and governed materialization (Section 5 ). • Three machine-checked properties: form manipulation purity, the no-bypass theorem, and boundary preservation (Section 10 ). • Governed self-modification: a concrete mechanism for machines that propose structural changes to themselves through an evolution ledger (Section 9 ). 2 Background 2.1 Homoiconicity and Staged Computation A programming language is homoiconic if its primary representation of programs is a data structure in the language itself Kay 1969 . In Lisp, programs are S-expressions and eval executes them. Clojure extends this with reader macros. Julia represents code as Expr objects. Staged computation systems provide a related but distinct mechanism. MetaOCaml Kiselyov 2014 offers typed staging with bracket , escape , and run . Terra DeVito et al. 2013 provides runtime code generation. Racket’s macro system Flatt 2012 enables compile-time metaprogramming. Classical homoiconic and staged systems generally provide a path from code representation to execution that is not itself subject to a first-class governance boundary. Elixir’s quote / unquote is compile-time and does not provide runtime eval. MetaOCaml’s run is typed but unrestricted. The common pattern is that the transition from data to code is treated as a language primitive rather than a privileged operation. 2.2 The Mashin Runtime MashinTalk is a domain-specific language for AI workflows that compiles to BEAM (Erlang VM) bytecode McCann 2026b . The runtime enforces eight invariants, of which three are directly relevant: • Inv 1 (No Ambient Effects): Pure computation steps cannot perform I/O. The capability is absent, not sandboxed. • Inv 3 (Governance Mediation): Every directive is mediated by governance. No bypass path exists. • Inv 8 (Governed Evolution): Machine versions are promoted only through the evolution ledger. These invariants have been formalized and proved in 454 Rocq theorems across 36 modules with zero admitted lemmas McCann 2026a . 2.3 The Metaprogramming Escape Hatch The governance model described above governs execution: what a running machine can do. But it does not, without this paper’s contribution, govern code generation: what executable structures the system can produce. A system governed at the execution level but ungoverned at the code generation level is vulnerable to a simple attack: generate a new program that lacks the governance constraints of the original. If the generated program can be executed without structural inspection, the governance model has an escape hatch. This is not a theoretical concern. LLM-powered agent systems routinely generate executable structures (tool-calling plans, workflow configurations, code) that execute without structural governance. 3 Materialization as Authority Allocation We argue that the transition from code representation to executable program is not ordinary computation. It is authority allocation. Definition 3.1 (Executable Authority) . A value has executable authority if it can, when executed, invoke external models, perform I/O, consume computational resources, or affect systems beyond the current computation. A machine form is a map. It has no executable authority. It cannot invoke a model, write a file, or send a network request. It is data. A running machine has executable authority. Its steps invoke models ( ask ... using: ), call effect machines ( ask ... from: ), and produce traces recorded in the behavioral ledger. Materialization is the operation that converts the former into the latter. It allocates executable authority to a structure that previously had none. Remark 3.2 (Why

Read the complete text