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

📅 2026-05-04
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the lack of effective control over privilege escalation in existing intelligent systems during dynamic code generation and execution. We propose a "controlled metaprogramming" paradigm that treats program representations as first-class values, decoupling code generation from execution through purely syntactic manipulation and structural inspection mechanisms. Specifically, we reconceptualize eval—not as a language primitive—but as a controlled effect subject to validation against policies, capabilities, and resource constraints. Leveraging formal methods, we define pure syntactic evaluation and controlled materialization judgments, implementing them in MashinTalk, a domain-specific language compiled to BEAM bytecode. Our theoretical guarantees—encompassing purity of syntactic operations, non-bypassability, and boundary preservation—are formally verified within a suite of 454 machine-checked theorems in Rocq.
📝 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 coderepresentation to execution is unrestricted. eval is a language primitive, not a governed operation. We argue that ingovernedintelligent systems, this transition is an authority amplification: it converts symbolic structure into executableauthority andmust be mediated like any other effect. We present governed metaprogramming, a language design where programrepresentations(machine forms) are first-class values, form manipulation is pure computation, and materialization (the transition fromform toexecutable machine) is a governed effect subject to structural inspection. The governance system analyzes the proposedprogram'scapability requirements, policy compliance, and resource estimates before permitting execution. We formalize twojudgments: pureform evaluation (which emits no directives) and governed materialization (which emits exactly one governed directive). Weprovethree properties: purity of form manipulation, the no-bypass theorem, and boundary preservation. We implement the designinMashinTalk, a DSL for AI workflows compiling to BEAM bytecode, and report on integration with 454 existingmachine-checked Rocqtheorems. The central contribution is reclassifying eval from a language primitive into a governed effect.
Problem

Research questions and friction points this paper is trying to address.

governed metaprogramming
eval
intelligent systems
authority amplification
code execution governance
Innovation

Methods, ideas, or system contributions that make the work stand out.

governed metaprogramming
eval as effect
program representation
capability governance
formal verification
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
A
Alan L. McCann
Mashin, Inc.