Recursive self-improvement is a language problem. We solved it with types.

Scott Wyatt · 2026-11-08

Every lab wants software that improves itself, and every lab bolts the safety on from the outside. Squillo put it inside the language. Here is what that means, mechanically.

Recursive self-improvement, software that rewrites itself to get better, is the most wanted capability in machine learning and its most feared failure mode. Every serious lab is chasing it: the Darwin Gödel Machine, AlphaEvolve, FunSearch, DreamCoder.

All four share one architecture. A language model proposes a change to the source, as text. A sandbox tries to contain it. Humans supervise the loop.

Supervision is the field's answer to the fear, and it caps the very recursion the loop is supposed to unlock. Keep a human in the loop and the loop runs at the speed of the human.

We made a different bet. Self-improvement is not a system built around the code. It is an operation of the language itself: typed, audited, reversible, with a permission surface specified for it.

Four questions a sandbox cannot answer

Picture an agent that improves one of its own tools at three in the morning. It works, mostly. Three weeks later a customer-facing answer is wrong, and someone asks four questions.

What could the change have been? Anything. A diff is text. Nothing about the mechanism constrains what the new program can be, so safety depends on an evaluator catching bad behavior after the fact.

What stood between the change and production? A container and a review queue. Containment is an ops problem, not a property of the artifact. Escape the sandbox and nothing else is there.

Which version produced this one, under what score? Forensics. Lineage is reconstructed, because the improvement loop lives outside the program's own semantics.

How do we undo it? Restore from backup. There is no native undo for a change that has already touched the world.

Every one of these is a property of text. None of them survives a type system.

What a self-modification is when it is not a diff

In N Lang a candidate improvement is not an edit to a file. It is a typed value of the thing it improves. A population of candidates is a typed collection. A candidate that does not type-check does not exist as a runnable thing, so the search space is bounded by the type before the first candidate is generated.

Here is the whole opt-in. A parser declares that it is adaptive, names its fitness, say success rate, and names its trigger, say an error spike above five percent. The compiler emits a dedicated instruction for it. At runtime the engine generates candidate implementations, scores them, ranks them and counts generations. There is no magic keyword, and there is no escape hatch shaped like a diff.

The operators evolution uses are the operators the language already has for composing values: replace, cross, select, merge. Evolution inherits every static guarantee those operators carry, because it is made of them. Gradient descent is not a rival mechanism. It is the special case of directed evolution the same types already cover.

The runtime decides, and it refuses the dangerous case

When a candidate wins, it has to go live, and this is where the field has no rule at all. N Lang has four.

Every change of implementation is classified mechanically by what it does to the interface: nothing, a patch, an addition, or a break. The same change produces the same classification on every machine. No human judgment enters at decision time.

A patch swaps atomically. An addition swaps with every existing consumer safe by construction. A break is halted. The runtime refuses the swap and says why: what broke, and what migration must move the consumers first. An operator can force it through only with a verified identity that passes two separate permission gates, and the override goes on the record.

A swap can never widen what data is exposed. When old and new fold together, visibility takes the minimum of the two. Even an accepted self-modification cannot reopen a hole its predecessor closed.

And the ledger is the sandbox. Every evolution event is appended with the hash of what was and the hash of what is, under a causal clock, so the order is provable without trusting anyone's wall clock. Lineage is recorded when it happens, not reconstructed. Rollback is native: a versioned history, reverted on regression, with peers rolling back in concert. The record evolution learns from and the record an auditor reads are the same record.

Nothing in this section is a rule someone wrote down. Each is a consequence of a decision about the language made years before RSI had a literature.

We did not argue it. We ran it.

Solved is a strong word, so here is what it rests on.

The loop runs end to end through the same admission path it ships through. A program is compiled from source, checked for the capability it claims, swapped into a running system, and written durably to the audit record. Then an error spike. The runtime rolls it back, and both events read back from disk in order.

The refusals run too. A change claiming a sandbox-only capability is refused before it reaches the runtime at all. A change whose body hash lies is refused even when it was re-signed over the lie, and the served program and the ledger are untouched. A change that would widen visibility is clamped; one that narrows is accepted. A breaking change is halted with the diagnostic above while patches and additions to the same program go through, so the gate discriminates rather than blocks. With overrides off, the forced path refuses by default. Across two machines over the gossip wire, a safe change lands on both, a breaking change is skipped, and a change from a foreign build is skipped rather than applied.

Behind the runs sit eight proven propositions, pen and paper plus property tests. A swap never widens exposure. Only admitted bodies ever go live. The whole cycle never regresses its best under a frozen objective. A judgment composed with the gate can tighten it and never loosen it. The interface cannot drift past a patch without the gate seeing it. And the objective itself is proven honest: the unique optimum of the fitness is truthful prediction, so an evolving function cannot out-score the truth.

That is what solved means here. Not a superintelligence running in production. The failure modes removed by construction, and the loop demonstrated through the doors it will ship through.

The constitution is not self-amendable

The last classical fear is the optimizer rewriting its own rules.

The standards here are a human ratification boundary the system cannot cross. Nothing is called proven without the mathematics and the tests. The system selects the best implementation and rolls back on regression within the standards. It does not get to edit them.

It can improve its functions. It cannot improve away its gates.

Why this cannot be bolted on

Static admission needs the type system. Mechanical swap decisions need versioning computed over a typed interface. Non-widening needs visibility to be a lattice in the language. Native rollback and free lineage need the ledger to be the memory. Permissioned evolution needs permissions to live in the read path.

None of that attaches to a scripting language plus a model. Fifteen years of building the language came first, and every gate above is a load-bearing consequence of it.

Recursive self-improvement is a language problem. We built the language. N Lang is here, and the knowledge model this machinery serves is System Zero.