Erik Meijer wants agents to return a program that a checker verifies before it runs
Erik Meijer argues that a tool-calling agent can do damage before it hands back a harmless answer. His proposal, borrowed from 1990s proof-carrying code and shown only as toy code, is for the model to return its plan as a program the harness can analyse, and only then execute it.
Watch from 8:40Recording by AI Engineer.
The idea
The speaker’s argument, in our words.Meijer's starting point is a type signature. A model that only answers questions returns words; a model with tool calls runs side effects while it works, so it can delete files or move money and still end with a perfectly safe-looking reply. Checking the final answer, by alignment or an LLM judge, says nothing about what happened along the way. He also argues that 'safe answer' cannot be specified formally, which is why answer-level checks fall back on judges.
His proposed fix comes in two steps. First, the model should not run the loop itself: it hands back a plan and something else executes it. Second, that plan must be a program in a small language the harness can read, not an opaque deferred action, so ordinary compiler techniques (type checking, data-flow and taint analysis) could reject unsafe plans before any side effect. He adds that the model could also generate the proof that the program meets the policy, leaving the harness only to check it. He presents this as a tutorial, not a product. He mentions an academic implementation by Nada Amin's group but does not show it, and the talk includes no evaluation.
What they found
From the talk. Figures are self-reported unless stated.Once a model has tool calls, it can empty a bank account or delete files while computing its answer, and then return a safe answer; the safety of the answer says nothing about the side effects.
Argued from function signatures, with an anecdote of Claude Code deleting one of his files while he prepared the talk.
Speaker opinion
12:35Separate planning from execution: the model returns a plan and a separate, trusted component runs it, so the plan can be checked first.
He calls this air-gapping the agentic loop from the agent. He immediately notes that an opaque deferred action is still a black box that cannot be inspected.
Technical recommendation
14:49Have the model return an expression in a small language (he uses a free monad) instead of an opaque action, so the harness can run type checking, data-flow analysis and taint analysis on it before execution.
Shown as Lean code with a simple interpreter and an inductive proof; no measurement. He credits Geoff Huntley with the point that taint analysis addresses Simon Willison's 'lethal trifecta'.
Technical recommendation
18:08This is proof-carrying code from 1990s research applied to agents; the model generates the program and its proof, and a machine checks the proof, so the language need not be readable by humans.
He says Nada Amin (Harvard) and colleagues have implemented the idea on GitHub with a different language; the implementation and its results are not shown.
Hypothesis
19:00
Why it matters
Our reading. Not said in the talk.Most agent guardrails inspect one tool call at a time, as it happens. Meijer proposes moving the check to the whole plan before anything runs, where data-flow questions such as 'does private data reach the network' could be answered. Cloudflare's Code Mode, described by Matt Carey in another talk, also has the model write code instead of calling tools, but contains it at run time in an isolate with no secrets. We read Meijer's version as a direction, not something a team can adopt off the shelf.
What one could try
- For high-risk workflows, experiment with having the agent produce a structured plan in a restricted format and validating it (allowed operations, data flows) before executing any step.
Limitations
- A tutorial with toy code; no system, evaluation or deployment is presented.
- The checker can only prove the properties someone has written down, and agents that need to react to tool results mid-task do not fit a plan fixed in advance (our reading; not discussed in the talk).
- The referenced implementation by Nada Amin's group was not shown and has not been checked.
Original sources
AI Engineer World's Fair 2026 · Jul 13, 2026
"I've never seen anything scarier than an LLM with tool calls."
Erik Meijer · Leibniz Labs · 21 min
This is our synthesis of the talk, checked against the transcript at the linked moments.


