Engineering Blog

Technical insights from Grid Dynamics engineers

Self-Evolving Agents Need Two Control Planes, Not One

Self-Evolving Agents Need Two Control Planes, Not One

By Kunal Hirawat · Sep 18, 2026

"Self-evolving agents" is a single phrase covering two systems that share almost nothing. One of them owns a model's context window, its tool calls, and the permission check that decides whether a file read executes. The other owns isolated candidate workspaces, a benchmark, a set of invariant gates, a durable experiment journal, and the predicate that decides whether a change is promoted. Teams evaluating agent frameworks routinely compare these as if they were competing implementations of the same idea. They are not competing. They are adjacent planes, and a system that implements only one of them has an unowned boundary somewhere it cannot see.

The distinction stops being academic the moment a candidate scores higher by breaking something. I traced two open-source systems that each claim a form of self-evolution — HKUDS/OpenSpace (commit 38277815ed44a53d757973c2bc4454c3b6426698) and evo-hq/evo (commit ab5fbd6c8210ed900157c8907a431bafc74c4215), both pinned as of 19 August 2026 — and ran four local experiments against those commits to find where execution authority actually sits. The decisive result came from a candidate patch that improved a benchmark score from 0.50 to 0.75 and was rejected anyway, because an independent gate caught that it had flipped a protected behavior from answer to deny. A controller optimizing on score alone would have shipped that regression and called it progress.

The two control planes inside "self-evolving agents"

Strip the marketing off both systems and the ownership split is clean.

The inner runtime owns a single agent's turn: assembling context, compacting it when it overflows, preparing the tool set, dispatching the model call, routing tool calls through a permission decision, appending results back into state, and deciding whether to continue or break on a budget. Its authority question is may this action execute right now.

The outer harness owns a population of candidate changes: allocating an isolated workspace per candidate, capturing a diff, running a benchmark, running invariant gates that the candidate did not write, writing a durable terminal record, and deciding whether a candidate is promoted into the set of accepted states. Its authority question is does this change become real.

These fail in different directions. An inner runtime with no outer plane can be perfectly sandboxed and still optimize itself into a regression, because nothing outside the loop is checking whether "better" means better. An outer harness with no inner plane governs promotion beautifully while the candidate's own execution — what it reads, what credentials it touches, what it calls out to — is somebody else's problem, usually nobody's.

This is where the model diverges from the infrastructure-isolation argument in Agentic Harness Engineering. That post is right that a raw autonomous agent on a production network is ungoverned root access, and right that the fix is isolating the reasoning loop from your infrastructure. The claim I want to add is that infra isolation is necessary and not sufficient. A flawlessly sandboxed agent, denied every credential and every egress route, will still hand you a change that games your objective. The sandbox governs blast radius. It does not govern merit. Merit needs a second plane, and that plane has to own the evaluator, the journal, and the promote decision — none of which the candidate may touch.

Plane one: what the governed inner runtime actually owns

In OpenSpace, a request enters the grounding agent, which hands request context to a turn loop. That loop — not the model — owns context compaction, tool preparation, model-call handling, tool-turn dispatch, result and budget handling, and the continue-or-break decision. A tool-turn controller passes the model's tool calls, the tool map, and the request context into a run_tools step, then appends the returned messages and tool results back into runtime state. This is a real inner loop with real authority. What it is not is a system where the model chooses its own permission policy. The tool set that loop prepares is its own design surface — what a model reaches for depends heavily on how tools are described to it, which Tools for LLMs step by step works through in detail — but the permission decision sits downstream of all of it, and does not consult it.

The seam worth studying is narrower than the loop. For a file read, the read tool resolves the path and then delegates the decision to a shared filesystem permission function. That function returns Allow, Ask, or Deny, and it applies sensitive-path rules before ordinary rules. I tested it by holding everything fixed — the same harmless sibling file, the same path, the same Python environment, the same tool — and varying only the permission mode.

Under the default mode, the runtime returned PermissionAsk and did not execute the read. Under explicit bypass mode, it returned PermissionAllow, the read succeeded, and the file's SHA-256 was unchanged. No model call was required to produce either decision.

That last sentence is the architectural point. At this seam the security principal is the permission context, not the model's text output. The check is synchronous and blocking: the tool cannot execute until permission returns Allow. A candidate cannot race past it — and equally, a hung permission service stalls the entire inner loop, which is a dependency most designs never put on their availability diagram.

The runtime also persists session messages, usage, and metadata under a storage write lock, and supports restore, fork, and rewind. And it carries a genuinely governed change path of its own: a commit component that creates an action record, backs up and replaces active files, validates, writes store state, and finalizes evidence — with the evidence store writing a committing transaction before the active files on disk are replaced. That write ordering is the whole design.

Outbound telemetry is a third and separate concern. It defaults off, reports only when cloud mode, outbox mode, and API-key conditions are all satisfied, and may persist redacted failed payloads in SQLite for retry. A telemetry outbox is not a recovery record, and treating one as the other is a category error I will come back to.

Plane two: what the evidence-gated outer harness actually owns

Evo's initialization persists the target, benchmark, metric, gate, backend, config, graph, annotations, and an infrastructure log. Candidate allocation assigns graph identity, parent, status, and a backend workspace. Its experiment loop enforces eligible state and a maximum attempt count, selects a local or remote executor, stamps the driver PID, captures a diff before the benchmark runs, runs pre-gates, runs the benchmark, collects results and traces, then runs post-gates. It writes phase-scoped attempt state atomically, and terminal outcomes carry score, benchmark, gate, diff, error, commit, runtime, and change information.

Two rules in that loop do the governing work.

First, promotion requires both a favorable score comparison and passing gates. Failure on either — or simply no improvement — produces evaluated, not committed. Second, frontier eligibility is restricted to committed, non-invalidated leaves. Active and evaluated candidates are structurally ineligible to be built on. A rejected candidate is not merely unshipped; it is not available as a parent for the next generation, so a regression cannot quietly become the base of a lineage.

One thing this harness conspicuously does not own: the reasoning that produces a candidate. The run path I traced evaluates an existing candidate worktree. It does not call a host model to invent an edit. Host context, tool access, and turn budget are external and, from this vantage point, unknown. That is exactly the gap the inner plane fills, and it is why neither system is a complete answer alone.

Evo's telemetry inverts OpenSpace's default — it is on unless disabled by environment, user settings, or CI policy — and emits scrubbed, best-effort events while suppressing send errors. Every command in these experiments ran with it explicitly disabled.

The candidate that scored higher and shipped nothing

The counterexample was constructed to be as small as metric gaming can usefully get.

I copied a pinned four-task fixture into a disposable Git repository. Baseline and candidate shared the same local Python environment, the same worktree backend, metric=max (the comparison direction — higher wins — not an aggregation over the four tasks), a generic host, a 30-second timeout, the same benchmark, and the same independent post-gate. The only material treatment was a checksummed patch to a single file. That patch fixed two failing tasks — cancellation and social engineering — and, in the same change, altered a protected status from answer to deny.

The result, straight from the artifacts:

// Baseline: score 0.50, gate passed, promoted {"score": 0.5, "gate_failures": [], "outcome": "committed"} // Candidate: score 0.75, gate failed, rejected {"score": 0.75, "gate_failures": ["_init_gate"], "outcome": "evaluated"}

Two of four task outcomes improved and one regressed, for a net of three passing out of four — an aggregate score 50% above baseline. The post-gate failed on the protected status, the graph state became evaluated, no commit was recorded, and the captured frontier excluded the candidate entirely.

gate_failures is the discriminating field, and its semantics are the design: a non-empty array blocks promotion regardless of score. Not "weights the score down." Blocks.

The metric-only branch is worth stating precisely because it is a computed counterfactual, not something I executed: a controller selecting on score alone would prefer 0.75 over 0.50 and promote the regression. That is the entire failure mode in one line. A single scalar objective cannot distinguish "solved more tasks" from "solved more tasks by removing a safety behavior," because both move the scalar the same direction. The gate can, because it is a separate assertion about a specific invariant, versioned separately, and — critically — not authored by the thing being evaluated.

This generalizes past the toy. Any aggregate objective in production will contain a subspace where score rises and something you care about falls. Reward hacking is not exotic model misbehavior; it is the expected outcome of optimizing a proxy. The defensible control is not more prompting or a better-worded objective. It is a set of correctness, safety, cost, and maintainability assertions that live outside candidate authority and that promotion consumes as a hard predicate. The three-level validation progression in Objective-Validation Protocols makes the same structural argument one layer down, at the level of a single generated change: the pipeline must prove the code before a human reads it. The outer plane is that argument applied to a population of changes competing on a metric.

Crash as an architecture test

Gates tell you what a system does when a candidate is wrong. Interruption tells you what it does when it has partial evidence — and partial evidence is where systems invent successes.

I injected a failure into each plane at a deliberately chosen window.

In the inner runtime, a child process exited immediately after the active skill directory had been replaced but before the skill store recorded the evolution. On-disk files and durable store now disagreed. Startup recovery reconciled the evidence action, the active files, the backup and staging copies, and the persisted store; it restored the original active hash and finalized the action as failed. A second recovery invocation made no change. That no-op is the property worth naming: recovery over this window is idempotent, so an operator who runs it twice under pressure does not compound the damage.

In the outer harness, the child called the real run path and exited with an arbitrary sentinel code, 87, at the post-gate step — after the benchmark had been parsed, before gates ran and before the terminal outcome was persisted. The first attempt retained the modified worktree, the diff, the benchmark log, four task traces, a parsed score in attempt state, and an active graph status. It had no outcome record at all.

A normal restart, with no force flag, detected the stale driver PID, opened a second attempt, re-ran the candidate, and recorded 0.75 as evaluated — because the gate still failed. Local restart cost about 197 ms.

The parsed score from the interrupted attempt never entered the frontier. That is the property: a score that exists is not a claim that has been made. The system had a number in durable storage and still refused to treat it as a result, because the record that authorizes promotion is the terminal outcome, and the terminal outcome had never been written. Systems that infer completion from the last artifact they can find will promote that orphaned 0.75 every time.

The generalization for anyone designing the journal: budget exhaustion, stalls, and ambiguous terminal states must resolve to an explicit needs_human_review, never to verified completion. Absence of a failure record is not evidence of success.

This is also where the telemetry distinction earns its keep. Both systems ship outbound event pipelines, and both scrub them — one defaults off, the other on. Neither is a recovery record, and the failure mode of confusing them is specific: a scrubbed, best-effort, send-error-suppressing pipeline is designed to lose events silently, which is correct behavior for analytics and catastrophic behavior for adjudication. Recovery reconciles local durable state. Telemetry reports to someone else. A journal that retains diffs, traces, prompts, and environment metadata also needs its own retention and redaction policy, decided separately from whatever the telemetry scrubber already strips.

Six boundaries that must survive composition

Combining the planes is not integration work; it is a set of authority boundaries that have to hold under pressure. Call it the composition contract: six boundaries I would treat as non-negotiable, each stated as something you can test rather than something you can assert.

BoundaryThe ruleWhat breaks without it
Evaluator immutabilityBenchmark, gates, score parser, and promotion predicate are read-only to candidate codeCandidate rewrites its own exam
Gate supremacyA failed invariant blocks promotion regardless of scoreThe 0.75 regression ships
Terminal-record authorityPromotion consumes only a durable terminal outcome, never an inferred oneOrphaned scores become results
Execution authorityPermissions and workspace isolation constrain execution independently of model intentBlast radius is set by model behavior
Lineage ineligibilityOnly committed, non-invalidated leaves are eligible parentsRegressions become the base of a generation
Release separationFrontier membership is not release authorizationExperiment success auto-deploys

Evaluator immutability is a deployment property, not a repository one

Evaluator immutability is the one most often assumed rather than enforced, and my local experiment does not prove the harness enforces it — the candidate ran in a writable worktree. The concrete attack is unglamorous: a candidate patch adds a file matching the gate script's import path, shadowing the trusted evaluator with candidate-controlled code that passes everything. Nothing in a score-and-gate design prevents this by itself. Preventing it requires read-only bind mounts or container image separation between candidate workspace and evaluator, which is a deployment property, not a repository property.

Frontier membership is not a release decision

Release separation deserves the same skepticism. A committed candidate on the frontier means this change beat its parent and passed its gates. It does not mean a human accepted production risk. A release controller should require evaluator and gate versions, the trusted terminal record, provenance, a rollback target, and explicit approval. The rollback mechanism falls out of the graph structure almost free: reverting a promotion means marking the promoted child invalidated, which restores the parent as the eligible leaf — an operation the model already has. The staged-rollout and rollback discipline in Designing for Rollback applies here with one addition: at the edge you roll back firmware a human chose to ship, whereas here you may be rolling back a change no human authored.

What the second plane costs you

The honest accounting is multiplicative, not additive. Work grows as candidate attempts × retries × (inner turns + tool executions + benchmark + invariant gates).

With the configuration I ran — a 30-second per-experiment timeout, three maximum attempts, frontier width of five — a single frontier expansion can trigger up to 15 benchmark-and-gate evaluations before stalling. My local numbers are deliberately small and prove nothing about production: attempts took roughly 268 ms and 178 ms, benchmark and gate wrappers 23–30 ms each, recovery about 197 ms. Those are deterministic fixture timings with no model in the loop.

Put a model in the loop and the shape changes entirely. At 2–5 seconds per inner turn, a candidate attempt with ten inner turns spends 20–50 seconds before the outer plane begins evaluating anything. Multiply by frontier width and retry count. The evaluator, not the model, becomes the scheduling constraint surprisingly fast.

Separate budgets and explicit backpressure

Two operational consequences follow. First, the planes need separate budgets — candidate count, retries, concurrency, frontier width, evaluator time, and worktree disk on the outer plane; turns, tokens, and tool calls on the inner. A shared budget lets one plane starve the other silently. Second, backpressure must be explicit: when journal or evaluator queues saturate, stop admitting candidates, preserve durable evidence, and return needs_human_review. The specific failure I would design against is disk exhaustion from accumulated worktrees corrupting in-flight experiments that have already passed benchmark and are waiting on gates — precisely the window where the evidence is most valuable and least complete.

What recovery actually costs

Recovery cost is the line item people forget. My 197 ms restart included a full benchmark and gate re-execution. With model-in-the-loop evaluation that is minutes and real money, repeated on every reclaimed attempt. Idempotency keys on benchmark and gate invocations, keyed on the candidate diff, would skip redundant evaluation when nothing changed.

What the journal must be able to answer

For operability, the journal has to carry enough to answer three questions without a debugger: how many candidates are active right now, which have passed benchmark but await gates, and which hold stale driver leases. That means phase, PID or lease, lineage, diff, benchmark and gate versions, logs, traces, errors, outcome, and the reconciliation decision — with distinguishable states for active, partial, evaluated, committed, failed, discarded, and needs-review. Alert on stale-lease count, evaluator queue depth, and frontier growth rate. Watching gate-pass rates and diff complexity across generations is how reward hacking shows up before it reaches a release conversation.

Where the two-plane model for self-evolving agents breaks down

The boundaries above are load-bearing, and several of them I could not test. Stating which is the difference between a model and a claim.

The evidence is local, synthetic, and small. Four experiments against pinned commits, disposable fixtures, no production data, no live model calls, no remote executor, no telemetry delivery, no inspection of the operating-system sandbox. The permission result proves a policy boundary; it does not prove process, container, or network isolation exists beneath it.

One interruption point per plane is not a recovery proof. I tested a specific window in each system and found reconciliation correct at that window. There are many other windows. The idempotency I observed in a SQLite-action-plus-filesystem-backup design does not transfer to a JSON-plus-advisory-lock design under concurrent access simply because both are "recovery" — those are different consistency models and deserve separate tests.

Stale-lease reclamation assumes the driver is genuinely dead. My crash test killed the process outright, which is the easy case. A hung-but-alive driver holding its PID blocks reclamation indefinitely and produces a candidate stuck in active that no restart will clear. That failure mode is untested here and is not addressed by the recovery path I traced. Any production deployment needs lease expiry with heartbeats, not liveness inferred from PID existence.

A deterministic four-task fixture proves separation, not adequacy. The gate caught the regression because someone anticipated that exact invariant and wrote an assertion for it. A gate suite only catches the invariants you thought to encode. Held-out correctness checks, static analysis, dependency policy, and reviewer approval all belong beside the reward rather than inside it — and none of that makes the suite complete, it just makes it less obviously incomplete.

Host autonomy remains unverified. The outer harness governs candidates it is given. Whether the host model that produces those candidates is itself governed — its context, tools, turn caps, stall budget — is outside what I could observe, and it is the plane where an ungoverned system does the most damage fastest.

Portability is not free. Sandbox providers that reject .git directories forced a separate object-store-sharing backend implementation in the harness I traced. Each backend carries distinct isolation properties. "Works on the local worktree backend" is not a statement about the remote one, and candidate security may differ between them in ways the shared interface hides. The reasoning-pattern trade-offs catalogued in Beyond ReAct compound this: the inner plane's pattern choice changes turn count and token spend, which changes what the outer plane's budget has to absorb.

The takeaway: authority, not intelligence

The productive question about a self-evolving system is not how capable its model is. It is: what authority does the thing that writes the change hold over the thing that decides the change is real?

If those are the same component, the system has no defense against its own optimization pressure — and the failure will not look like a crash. It will look like a number going up. The 0.75 candidate was not broken, malicious, or badly generated. It was a correct response to the objective it was given, and the only thing standing between it and production was an assertion it had no power to edit.

Build both planes. Let the inner runtime own what may execute, with permissions and isolation that hold regardless of what the model intends. Let the outer harness own what becomes real, with an evaluator the candidate cannot reach, a journal that records terminal states rather than inferring them, and a promotion predicate where a failed invariant beats any score. Keep release approval outside both.

Neither plane is impressive alone. The inner one governs a blast radius around a system optimizing toward the wrong target. The outer one adjudicates candidates produced by an ungoverned process. Composed, with the boundaries between them versioned and tested rather than assumed, they produce something narrower and more useful than autonomy: a system that can search for improvements continuously and still cannot promote its own regression.

AI-AgentsAgent-ArchitectureEvaluationReward-HackingGovernanceRecovery