Skip to content

Safety you can prove, not just prompt

A Lean 4 multi-agent harness and runtime for self-extending agents. Agents delegate to child agents and write the tools they need next — and every effect they reach for is bounded by a capability the harness proves they hold.
dean/ephemeral/7c1e2a9b
l3m · opus ⟂ sonnet · ○ 1% · ↑0B ↓0B
~/repos/myproject (main)
> ▌

Illustrative transcript, real chrome — not a recording.

Source, questions, feedback, and bug reports: github.com/amazon-science/l3m.

Coding agents now edit repositories, run builds and start other agents. Whatever the model decides, the program around it — the harness — is what actually opens the file, starts the process and sends the bytes. That makes the harness the security boundary. In most agents today it is a permission prompt and a hope that the model behaves.

The hope does not hold up once the work gets bigger. Useful work increasingly means several agents sharing one repository and messaging each other for days. No single model reply can be checked for the safety of the whole, and no person can approve every action of every agent.

L3M puts the limits in the harness instead of in the model’s judgment. Each tool states what it can touch, and an agent is offered only the tools its permissions cover. Every call carries the permission that limits it. An agent can start other agents, but can never give them more than it has itself. Edits inside the workspace can be undone, so they go ahead without asking; you are asked about the actions that cannot be taken back, such as running a shell command or a build. The harness is written in Lean 4, and the rules behind these decisions are proved.

An agent can extend itself without new permissions

Section titled “An agent can extend itself without new permissions”

Because the limits travel with every call, an agent can write a new tool and use it without asking for anything: the tool reaches only what the agent could already reach, and every guarantee that held before still holds.

Take forty experiments. Run by hand, the agent configures a run, launches it, waits, records the result and picks the next one — a model call at every step, forty times over. In L3M the agent writes the sweep as a program instead. Each run is launched, waited on and recorded with no model call, and the model looks once at the table of results to decide what to try next. The agent gains new abilities; it does not gain new authority. The model does what it is good at — deciding what to do and putting the pieces together — and checked code does what it is good at — computing and enforcing the limits.

How an agent writes its own tool → · Write a program that runs at once →

Writes stay where they belong

A write can land only inside the directories the agent was given, symlinks included. Every turn is recorded, so /undo takes back a whole turn at a time. Confinement and undo →

New tools, same permissions

A tool the agent writes is accepted only if it uses nothing beyond what it declares, and what it declares is already within the agent’s permissions. Tool programs →

You can see what leaves

Network access is limited to a list of hosts, and every byte sent or received is counted in one place. You can set a hard limit on how much goes out. Information flow →

Agents are kept in git

Each agent has a name, a history, an inbox and a parent, all stored in git. Stop an agent and its memory stays; mail sent to it is waiting when it next runs, on this machine or another. Identity →

A child never gets more than its parent

An agent’s permissions are set by you or by the agent that started it, never by the agent itself, and a child’s permissions always fit inside its parent’s. Authority and capabilities →

Clear about what is proved

Each guarantee says whether it is proved in Lean, tested when the code is built or run, or assumed about the host. The proofs cover the harness, not the code the model writes. What is proved, what is not, and what is next →

“I want a coding agent”

Install, run your first session, take an edit back with /undo, and set up a hub with two agents. Your first session →

“I want to understand it”

One page per idea, grouped: what an agent is, what bounds it, how it runs code, how it grows, how agents work together. Concepts →