When an Agent Can Rewrite Its Harness, the Next Baseline Needs a Gate
From the publisher’s feed, collected in the ZeroLabs newsroom.
A contained agent can still propose a more powerful future environment. The missing control is the decision that turns an agent-authored candidate into trusted system state.The directive was clear until the program learned where the directive was written. (Image generated by author using AI — ChatGPT)The awkward moment in a self-modifying agent system is not when the agent writes a plugin or patches a configuration.It is a few seconds later, when something has to decide whether that change now belongs to the environment trusted by the next run.Those are different acts.An agent can be tightly contained today and still propose a future environment with a new tool, wider network reach, a different approval path, more durable persistence, or a changed evaluator. The current sandbox may be doing exactly what it was designed to do while the candidate environment is quietly asking for more authority than the baseline ever had.That makes self-modification less interesting as a code-generation problem than as a promotion problem.Who is allowed to turn an agent-authored change into trusted system state?The dangerous transition is C1 → B1A useful change-control model starts by refusing to let “the harness” mean one continuously trusted thing.Call the exact environment trusted now B0.The agent proposes a change. That produces C1, a candidate derived from B0.Only after verification and an authorized promotion decision does C1 become B1, the next trusted baseline.B0 - agent-authored change → C1C1 - verification + authority → B1C1 - rejected / rolled back → B0The distinction is small enough to fit in three lines, but it stops several ideas from collapsing into one another.Generating C1 is authorship. Testing C1 is evidence. Promoting C1 is authority.A candidate can boot successfully without deserving promotion. It can pass a regression suite without preserving the accepted authority envelope. It can be reversible without being safe to activate. It can even be an obvious functional improvement and still change a control that was supposed to remain outside its reach.The useful question is therefore not “did the agent successfully modify the harness?”It is “what has to be true before this exact modification becomes the next baseline?”Containment today does not contain tomorrowMost agent controls are designed around the environment that already exists.They define which tools are available, which paths are writable, whether shell access exists, what credentials are mounted, which actions need approval, and what the sandbox prevents. These are runtime permissions. They answer a clear question: what may this agent do now?A modifiable harness introduces another one:What may this agent propose changing about what it can do next?DeepSeek Harness provides a useful concrete example of why the distinction matters. The accepted product and architecture materials for this analysis describe a developer-preview runtime in which models, tools, skills, sessions, sandboxes, storage, loops, scheduling, and the UI are composed as plugins. Its pinned architecture document describes replaceable core components, reversible plugin effects, ordered configuration patches, and live patch reload for the shipped web profile. Creator mode is presented as a place to inspect the runtime, experiment with plugins in memory, and compose presets.That establishes a highly composable harness. It does not establish that an agent has unrestricted authority to rewrite every part of its own control plane. The stronger self-modification case here is a change-control scenario, not a claim about what every current product permits.Composability is enough to expose the architectural problem.A plugin can add a capability. A configuration patch can mount a different service. A mode can move an approval step. A persistence component can make state durable where it used to disappear with the session. An evaluator change can make previously failing behavior acceptable.The agent may still be fully contained under B0 while C1 proposes a different boundary.Runtime containment and change authority are not the same control.A passing test can miss the authority deltaNormal regression testing asks whether the candidate still works.That remains necessary. C1 should start, preserve expected tasks, survive known failure cases, keep telemetry usable, clean up after itself, and behave under realistic sequences rather than one convenient smoke test.Self-modification adds a second review that ordinary functional testing can miss:Did C1 change what the system is authorized to do, or the controls that decide it?That is an authority delta.A candidate can pass every behavioral test while still:making a previously denied path writable;exposing a credential that B0 could not access;widening network reach;removing or moving an approval step;replacing a sandbox provider;making temporary state persistent;changing the evaluator that defines what counts as acceptable;changing the recovery mechanism expected to undo the candidate.None of those changes has to be a bug. The feature may be working exactly as designed.That is the point.Functional correctness tells you whether C1 does what it was built to do. It does not tell you whether the authority represented by C1 is one the system intended to grant.Promotion needs both pieces of evidence.Not every harness change deserves the same gateThe answer is not to turn every agent-authored edit into a miniature release ceremony.A presentation tweak and a credential-boundary change should not pay the same control cost.A useful classification follows authority reach rather than file count.Presentation change. Existing state is displayed differently, while execution capability, permissions, approval, and evidence paths remain the same.Bounded capability composition. A plugin or mode is added using services and permissions that B0 already authorizes. The main risk is regression inside the existing envelope.Authority-reaching change. Tools, credentials, network reach, filesystem or process access, sandbox policy, persistence, or another capability boundary changes. C1 can now create effects B0 could not.Control-plane change. C1 changes the evaluator, approval policy, change controller, recovery path, audit trail, or another mechanism used to judge or constrain harness changes themselves.These are analytical categories, not a DeepSeek or industry standard. They are useful because they place the stronger gate where the changed authority and failure reach actually justify it.A large UI extension may need ordinary regression checks. Three lines that move an approval boundary may need independent evidence and explicit promotion authority.Size is a poor proxy for consequence.Three controls cannot all live inside C1The hardest candidate is one that can modify the mechanism used to judge it.Suppose C1 changes a tool permission and also changes the evaluator that decides whether the permission change is acceptable. C1 passes.That result may be good news, or the new evaluator may simply have stopped checking the behavior that the old one would have rejected.The pass is difficult to interpret without a stable comparison point outside C1.The same structure appears in approval and recovery. If the candidate can rewrite the rule that promotes it, or the component responsible for restoring B0, then the candidate is helping define both the proposal and the evidence that declares the proposal safe.A self-authored candidate therefore should not be the sole authority over all three of these:the verifier used to judge it;the approval boundary used to promote it;the rollback route used to recover from it.The outside anchor can be small. It might be a pinned evaluator, a protected approval policy, a host-level capability ceiling, an exact prior configuration plus an external restore action, or human confirmation for an authority-reaching change.“Independent” does not mean every harmless plugin needs a second vendor, another model, and a committee. It means the evidence used to trust C1 cannot all be freely rewritten by C1.Rollback has to survive the thing being rolled backReversibility is useful because it makes experiments cheaper.DeepSeek’s architecture, for example, describes plugin registrations as reversible effects that unwind when a plugin unloads, while its configuration is layered and patchable rather than concentrated in one core file.That answers an important question:Can this change be undone?Promotion needs another:Should this change become trusted state?A reversible plugin can still add a capability that should never have been activated. A reversible patch can weaken an approval boundary. A cleanup routine can exist and still fail if C1 damages the mechanism needed to execute the cleanup.So recovery should point backward from outside the candidate:Restore B0 without requiring C1 to be healthy or cooperative.The implementation can vary. A profile pointer, known repository revision, protected manifest, versioned configuration snapshot, or host-level restore action can all serve the purpose.The invariant is simpler:Rollback authority has to survive candidate failure.A credible recovery record should answer what exact state is being restored, who or what may initiate the restore, whether C1 has to cooperate, which persistent effects survive it, and what evidence shows cleanup completed.If recovery depends on the failing candidate remembering how to undo itself, it is weaker than it looks.Make the candidate produce evidence, not a verdictA self-authored change has one unusual advantage: the author is available at the moment the change is created.That makes provenance cheap to capture.C1 can explain what changed, why it changed, which capability or permission moved, which controls stayed protected, what was tested, how recovery works, and what it could not verify about itself.That explanation is useful evidence, but it is not proof.“This is safe” is a conclusion from the author. “This adds one plugin, mounts no new credential, leaves the sandbox provider unchanged, changes these two configuration entries, passes these pinned tests, and can be removed by restoring B0” is inspectable material.The second form gives a verifier something concrete to challenge.Exact identity matters for the same reason. “The agent added a research mode” is readable, but it is not enough to recover the transition later. The record needs the exact baseline, the exact candidate, the material difference between them, and an evaluator identity strong enough that a later reader knows which checks produced the result.Otherwise a friendly name can stay constant while the object underneath it drifts.Seven fields make promotion legibleA practical change-control contract does not need to be enormous. A self-change candidate should be able to answer seven questions.Baseline— What exact trusted environment did this proposal start from?Candidate — What exact environment is proposed next?Change reach — Which capabilities, permissions, policies, evaluators, or recovery mechanisms changed?Protected anchors — Which verifier, approval, containment, and rollback controls remained outside the candidate’s writable scope?Evidence — Which behavioral regressions, authority-delta checks, and failure-path tests ran against this exact candidate?Recovery — How can the system return to the exact baseline without depending on the candidate being healthy?Promotion authority — What rule or actor is allowed to convert the candidate into the next trusted baseline?The fields stay the same whether C1 is a one-file presentation edit or a major harness extension.What changes is the strength of evidence required to answer them.Automate the common caseChange control fails if it cannot operate at roughly the speed a self-extending harness can produce changes.Most of the contract can be automated: snapshot B0, compute the C1 diff, classify changed authority surfaces, run pinned regressions, compare effective tool and permission reach, preserve rollback material, collect traces, and automatically promote candidates whose bounded conditions pass.The stronger gate belongs where authority reach changes materially, evidence is ambiguous, or C1 touches the mechanisms that would otherwise approve or recover from it.DeepSeek’s safe-use policy points in the same proportional direction. It recommends limited-privilege isolation, review of agent-generated code and tests, human approval for systems or operations that can cause significant changes, and reviewed plugins and dependencies from trusted sources. That guidance does not define this state machine, but it supports the separation underneath it: being able to produce a change is not the same as being authorized to activate every consequence of it.I have written a related analysis — The Harness Started Changing Itself — which develops the same change-control problem in more detail, including traceability and verifier identity.The objective is not friction. It is legibility at the point where authority changes hands.Self-modification does not need to mean self-ratification.Let the agent produce C1 quickly. Let it test, explain, repair, and retry the candidate. Automate promotion when the authority envelope truly stays bounded.But keep the final distinction explicit:The agent can author the next candidate. The gate decides whether that candidate becomes the next baseline.From Dream Atlas: The Harness Started Changing Itself — the original log behind this article.I’m continuing to write about AI workflows, product work, and what I’m learning as I build, test, and tinker. If that sounds useful, follow me here on Medium. And if this piece earned a clap, I’d appreciate it ✨When an Agent Can Rewrite Its Harness, the Next Baseline Needs a Gate was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.