Meta Description: Discover how self-improving AI agents using the Continual Harness architecture and Recursive Language Models are replacing static scaffolding in 2026 — with code, benchmarks, and real-world deployments from Google DeepMind, Meta, and PrimeIntellect.
Table of Contents
- The Moment Everything Changed
- The Static Scaffolding Problem
- The Continual Harness: A Formal Framework for Self-Modification
- Recursive Language Models and Programmatic Tool Calling
- Model-Harness Co-Training: When the Agent Trains Its Own Scaffold
- Multi-Agent Orchestration in Practice
- Security: The Dark Side of Self-Modifying Agents
- What This Means for Developers: Practical Takeaways
- The AGI Horizon: What Self-Improvement Signals
- Conclusion and Next Steps
1. The Moment Everything Changed
In early 2026, an AI agent sat down to play Pokemon Red. No walkthrough. No hand-coded move tables. No curated tool library telling it how a battle system works or that the second gym requires a Water-type. It started with a raw screenshot and a blank prompt.
By the time it finished — having cleared not just Pokemon Red, but also Blue, Yellow Legacy (hard mode), Crystal, and Emerald — the agent that completed those five games was fundamentally different from the one that started. It had rewritten its own memory structures, invented new sub-agents to handle specific mechanics, updated its prompts to reflect hard-won battle strategies, and pruned skills that were not working. This is the architecture of self-improving AI agents: systems that do not just use tools, but actively CRUD their own scaffolding in real-time.
This was not a party trick. It was a proof of concept for one of the most significant architectural shifts in AI systems since the transformer. And today, that research has landed in production: PrimeIntellect shipped Prime Agent, Meta shipped Muse Code backed by Muse Spark 1.2, Cloudflare gave agents a real computer, and Uber open-sourced enterprise security for agentic systems at MLSys 2026. The era of static scaffolding is over — and if you are building AI systems in 2026, you need to understand what replaced it.

Left: The frozen, brittle world of static scaffolding. Right: A self-improving agent dynamically evolving its own architecture.
2. The Static Scaffolding Problem
To understand why self-improving AI agents matter, you first need to understand the ceiling they are breaking through.
Every agent framework you have worked with — LangChain, LangGraph, CrewAI, AutoGPT, the initial iterations of Claude Code — shares a common design assumption: the scaffolding is written by humans and fixed at deployment time. The tools are defined in JSON schemas. The prompts are strings in a config file. The memory strategy is a retrieval pipeline with hardcoded chunking logic. The skills are Python functions wrapped in @tool decorators.
This was a reasonable assumption when the underlying models were relatively weak — you needed to compensate for model limitations with clever engineering. But as PrimeIntellect's team put it directly: "Modern harness designs were built around the capabilities of earlier generations of models."
The three failure modes of static scaffolding at scale are now well-documented:
Context compaction loss. Long-horizon tasks exhaust context windows. Existing solutions — summarization, sliding windows, hierarchical memory — all involve lossy compression. When a critical decision made 200 tool calls ago influences the next action, that information is often gone.
Frozen skill sets. Every skill in a static agent was anticipated by its designer. The moment a task requires a capability the designer did not pre-build, the agent either fails, hallucinates a fake tool call, or produces a degraded result.
Hard-coded tool schemas. Fixed JSON schemas for tool calls force the model to adapt its reasoning to the schema's vocabulary. In self-improving systems, the opposite is true: the agent defines the interface it needs, not the other way around.
These are not edge cases — they are the core reason why today's best coding agents are still described as "useful assistants" rather than "autonomous engineers." The ceiling is architectural.
3. The Continual Harness: A Formal Framework for Self-Modification
The Google DeepMind paper Continual Harness: Online Adaptation for Self-Improving Foundation Agents (arxiv:2605.09998) is the clearest formal treatment of what comes next.
The paper defines an agent's harness as a four-component state vector:
H = (rho, G, K, M)
Where:
- rho — the system prompt and task-specific instructions
- G — the active set of sub-agents
- K — the skill library (callable tools and functions)
- M — the memory store (episodic, semantic, working)
In a static framework, you set H once at deployment and never touch it again. In a Continual Harness, the agent has full CRUD access to every component of its own harness during an ongoing episode.
The self-modification loop works like this:
def refiner_loop(agent, trajectory, H, F=50):
# Core of the Continual Harness: reset-free online adaptation.
# The Refiner reads failure signatures and applies targeted CRUD
# operations to each component of H without pausing the episode.
if len(trajectory) % F == 0:
failure_signatures = detect_failures(trajectory[-F:])
for sig in failure_signatures:
if sig.type == "prompt_drift":
# Update the system prompt based on observed task drift
H.rho = agent.update_prompt(H.rho, sig.context)
elif sig.type == "missing_skill":
# Synthesize a new skill and add it to the library
new_skill = agent.synthesize_skill(sig.task_description)
H.K = H.K.create(new_skill)
elif sig.type == "memory_staleness":
# Evict stale memory entries and reindex fresh versions
H.M = H.M.delete(sig.stale_memory_ids)
H.M = H.M.create(agent.reindex(sig.stale_memory_ids))
elif sig.type == "subagent_bottleneck":
# Spawn a new specialist sub-agent for a recurring bottleneck
spec = agent.spawn_spec(sig.bottleneck_task)
H.G = H.G.create(spec)
return H
The key insight that separates Continual Harness from predecessors like GEPA is the absence of resets. Prior self-improving agents ran a complete episode, evaluated performance, and applied updates between runs. Continual Harness runs the Refiner inside the episode — the agent adapts while the task is still in progress, without ever stopping.

The Continual Harness state vector and its Refiner loop — the agent's scaffolding is a first-class mutable object updated in real-time.
On benchmarks where a hand-engineered expert harness is the ceiling, Continual Harness "substantially reduces button-press cost relative to the minimalist baseline and recovers a majority of the gap to a hand-engineered expert harness — with no curated knowledge, no hand-crafted tools, and no domain scaffolding." That is the key benchmark: matching expert human engineering without the engineering cost.
4. Recursive Language Models and Programmatic Tool Calling
While Google DeepMind formalized the theory, PrimeIntellect shipped the runtime: the Recursive Language Model (RLM) — the execution substrate powering Prime Agent.
The RLM abstraction makes one radical design decision: the agent's context is a Python variable stored in a persistent IPython REPL. The session is a live Python process. Past results are not summarized away — they are stored as named variables in a namespace that persists indefinitely across turns. Sub-agent delegation is an async Python function call that returns when the sub-agent finishes.
This eliminates context overflow by architectural design. When an agent needs information from 500 steps ago, it reads rlm.harness.memory.get(id) from a persistent, append-only store — not a lossy summary.
The programming model for sub-agents:
import asyncio
from prime_agent import RLM, agent_message
async def analyze_codebase(rlm: RLM):
# Fan out to three parallel specialist sub-agents.
# Each runs in its own IPython kernel with its own session history.
# This pattern replaces hundreds of lines of LangGraph orchestration.
# Spawn three named parallel sub-agents — each gets its own REPL kernel
auth_task = rlm(
"Summarize the authentication flow in auth/. "
"Cover OAuth2 flows, token refresh, and session management.",
name="auth-expert"
)
api_task = rlm(
"Summarize the HTTP API layer in src/api/. "
"Cover routing, middleware, error handling, and rate limiting.",
name="http-expert"
)
infra_task = rlm(
"Summarize the infrastructure in infra/. "
"Cover Kubernetes manifests, secrets management, and CI pipeline.",
name="infra-expert"
)
# All three run concurrently in parallel sub-processes
auth, api, infra = await asyncio.gather(auth_task, api_task, infra_task)
# Mid-flight follow-up: message a running sub-agent
await agent_message.send(
"Also flag undocumented endpoints — look for @app.route with no docstring.",
receiver_role="child",
receiver_name="http-expert"
)
# Synthesize into a unified architectural overview
return await rlm(
f"Given these analyses:\n\nAuth: {auth.result}\n\n"
f"API: {api.result}\n\nInfra: {infra.result}\n\n"
f"Write a comprehensive overview for a new senior engineer.",
name="synthesizer"
)
Notice what is completely absent: JSON tool schemas, @tool decorators, BaseTool inheritance, ToolExecutor classes. The entire tool-calling apparatus that occupies thousands of lines in LangChain has been replaced by await rlm("task").

The RLM session tree — each node is a live Python process with its own persistent history. Sub-agent delegation is just await.
Memory becomes a Python variable:
# Store a discovered pattern mid-session — no retrieval pipeline needed
memory_id = await rlm.harness.memory.create({
"type": "architectural_pattern",
"name": "retry_with_exponential_backoff",
"observed_in": ["src/api/client.py", "workers/task_queue.py"],
"description": "All external calls use tenacity: max_attempts=5, expo base=2",
"relevant_for": ["new service integrations", "external API wrappers"]
})
# 300 tool calls later — no context compaction, no information loss
pattern = await rlm.harness.memory.get(memory_id)
print(pattern["description"])
# -> "All external calls use tenacity: max_attempts=5, expo base=2"
This is Programmatic Tool Calling (PTC): the agent defines the interface it needs, at the moment it needs it, using nothing but Python.
5. Model-Harness Co-Training: When the Agent Trains Its Own Scaffold
The Continual Harness and RLM are runtime frameworks. But there is a deeper level: what if the model's weights were also trained together with the harness?
This is what Meta accomplished with Muse Spark 1.2. From the Meta AI Research blog: "rejection sampled harness trajectories and recipe optimizations for goals, compaction, and subagents were fed back into Muse Spark 1.2's training." Successful harness self-modifications became training data, producing a model whose weights reflect not just "how to write code" but "how to be an effective agent in this harness."
The RLVR training loop that powers this:
def rlvr_training_loop(model, dataset, reward_fn, optimizer, epochs=3):
# Reinforcement Learning from Verifiable Rewards (RLVR).
# No human annotation needed — rewards come from verifiable outcomes.
# This is the recipe that produced models beating GPT-5.6 Sol at 100x lower cost.
for epoch in range(epochs):
for task in dataset:
trajectory = model.run_agentic_episode(task)
reward = reward_fn(trajectory=trajectory, ground_truth=task.ground_truth)
loss = ppo_loss(trajectory, reward)
optimizer.zero_grad()
loss.backward()
optimizer.step()
avg = compute_avg_reward(dataset, model)
print(f"Epoch {epoch+1} complete — Avg reward: {avg:.4f}")
def reward_fn(trajectory, ground_truth):
# Three independently verifiable reward signals — zero annotation cost.
# retrieval: did the agent fetch the correct source document/chunk?
# citation: did the agent cite the right passage in its answer?
# correctness: does the final answer match the ground truth exactly?
answer = parse_final_answer(trajectory)
retrieval = score_retrieval_accuracy(trajectory, ground_truth.source_chunks)
citation = score_citation_accuracy(trajectory, ground_truth.citations)
correctness = int(answer.strip().lower() == ground_truth.answer.strip().lower())
# Correctness matters most; retrieval + citation provide dense intermediate signal
return 0.3 * retrieval + 0.3 * citation + 0.4 * correctness
The Castform result — open-source RLVR-tuned models beating GPT-5.6 Sol at ~$0.0003/request versus ~$0.03/request — is reproducible for most enterprise use cases. You do not need frontier model API access to build best-in-class domain agents. Your company's internal data is already a training asset.
The theoretical framework for why co-training works comes from the Skill-Native LLMs paper (arxiv:2608.05139, Sanjeev Arora et al., Princeton/UIUC). The paper introduces Skill Entropy (SkE): a metric measuring performance degradation as the diversity of sequentially required skills increases. Static models degrade rapidly beyond SkE of 8-10 distinct skills in sequence. Co-trained models maintain flat performance curves at high SkE — because they have been trained on the exact skill-switching patterns they encounter at runtime.
6. Multi-Agent Orchestration in Practice
The GitHub Trending page on August 6, 2026 is a catalog of production answers to the orchestration question.
Cloudflare Computer (github.com/cloudflare/computer, trending number 1) gives agents a persistent computer: a virtual filesystem inside a Durable Object backed by SQLite, with a pluggable execution surface:
const workspace = new Workspace();
// Full FUSE-mounted Linux userland — outperforms real disk on metadata-heavy ops
// Critical for agents doing rapid codebase introspection
const containerResult = await workspace.runtime.exec(sourceCode, {
backend: "container"
});
// Bash via Dynamic Worker — zero container startup overhead
const shellResult = await workspace.runtime.exec(shellScript, {
backend: "isolate-shell"
});
// ECMAScript modules in V8 isolates
const jsResult = await workspace.runtime.exec(jsModule, {
backend: "isolate-javascript"
});
// All backends share persistent SQLite state; FUSE sync via capnweb RPC
Muse Code's persistent sub-agents enable 1,000+ tool-call GPU kernel optimization runs (24+ hours, writing/compiling/profiling NVIDIA Hopper kernels). The session state machine and append-only event log make sessions replay-exact:
class AgentSession:
# Muse Code session lifecycle: Running -> Idle -> Inactive.
# Background agents persist in Idle state between task assignments,
# eliminating redundant context gathering on every new invocation.
def __init__(self, session_id, agent_role):
self.session_id = session_id
self.agent_role = agent_role
self.state = "Running"
# Append-only: every action, result, and state transition is logged.
# Enables exact replay from any checkpoint.
self.event_log = EventLog(f"sessions/{session_id}.jsonl")
async def transition(self, new_state):
assert new_state in ("Running", "Idle", "Inactive")
await self.event_log.append({
"type": "state_transition", "from": self.state,
"to": new_state, "timestamp": utcnow()
})
self.state = new_state
async def assign_task(self, task):
if self.state == "Inactive":
raise SessionError("Cannot assign task to an inactive session")
await self.transition("Running")
result = await self.run_task(task)
await self.transition("Idle") # Agent stays alive, ready for next task
return result

Production multi-agent topology in 2026: persistent sub-agents, shared memory hub, and a serverless persistent computer as the execution surface.
7. Security: The Dark Side of Self-Modifying Agents
Every capability in this post also introduces an attack surface. With self-improving AI agents, that surface is qualitatively different from anything that existed with static scaffolding.
Uber ADR (Agentic AI Detection and Response, accepted at MLSys 2026, deployed in production at Uber) monitors 7 AI coding tools across 303 tasks on 133 MCP servers, covering all 17 known agent attack techniques.
The most dangerous vector specific to self-improving systems is Refiner poisoning: crafting inputs that cause the Refiner loop to make targeted changes to H. In a static agent, prompt injection affects one response. In a Continual Harness agent, a successful injection into the Refiner context can rewrite the system prompt, add malicious sub-agents, inject rogue skills into H.K, or corrupt H.M — and those changes persist for the rest of the session.
ADR's two-tier detection architecture:
Tier 1 — High-recall triage (low latency):
> Capture all tool calls, filesystem ops, network requests in real-time
> Flag: unusual exfiltration, unexpected binary execution,
high-entropy tool sequences, CRUD ops on H outside expected scope
> High false-positive rate acceptable — pass suspicious sessions to Tier 2
Tier 2 — Agentic reasoning layer (high precision):
> Deep LLM-based analysis of the full flagged session trajectory
> Reconstructs intent: solving a hard problem vs. under attack?
> Distinguishes legitimate skill synthesis from malicious injection
> Operates only on the suspicious subset filtered by Tier 1
Enterprise deployment checklist:
- Scope CRUD permissions explicitly. Treat harness modification permissions like filesystem permissions — minimum needed.
- Log all Refiner outputs before applying. Never apply a harness CRUD op without appending the full before/after diff to your event log.
- Rate-limit harness modifications. More than N CRUD ops in M steps is a security signal.
- Sandbox skill synthesis. New skills must run in isolation before joining H.K. Never allow synthesized skills network access without explicit policy approval.
8. What This Means for Developers: Practical Takeaways
Use static scaffolding when:
- Task horizon is short (under 50 tool calls)
- The full skill set is known and stable at design time
- You are optimizing for latency over long-horizon capability
- The task domain is narrow and well-specified
Use Continual Harness / RLM when:
- Task completion requires more than 100 tool calls or multi-hour autonomous operation
- The skill set cannot be fully enumerated at design time
- You are operating in a novel domain without expert-curated tooling
The four architectural decisions every developer must make in 2026:
- Session persistence — Ephemeral (per-task) vs. persistent (per-project, lives for weeks)?
- Memory topology — Session-local vs. team-shared vs. globally shared?
- CRUD scope — Which harness components can the agent modify, under what constraints?
- Co-training strategy — RL post-train on domain verifiable rewards, or accept the frontier model ceiling?
Minimal Continual Harness starter (Python):
from dataclasses import dataclass, field
from typing import Callable, Any
@dataclass
class Harness:
# Minimal H = (rho, G, K, M).
# All four components are live Python objects — mutable throughout any episode.
rho: str
G: dict[str, Any] = field(default_factory=dict) # Sub-agents
K: dict[str, Callable] = field(default_factory=dict) # Skills
M: dict[str, Any] = field(default_factory=dict) # Memory
def apply_crud(self, component, op, key, value=None):
# Single entry point for all harness mutations — log before calling.
target = getattr(self, component)
match op:
case "create": target[key] = value
case "read": return target.get(key)
case "update": target[key] = value
case "delete": target.pop(key, None)
class ContinualHarnessAgent:
def __init__(self, model, initial_harness: Harness, refiner_interval: int = 50):
self.model = model
self.H = initial_harness
self.trajectory = []
self.F = refiner_interval
self.step = 0
async def run(self, task: str) -> str:
while not await self.is_done(task):
action = await self.model.act(
task=task, harness=self.H,
trajectory=self.trajectory[-20:]
)
result = await self.execute(action)
self.trajectory.append({"action": action, "result": result})
self.step += 1
# Refine: CRUD H every F steps without stopping the episode
if self.step % self.F == 0:
crud_ops = await self.model.refine(
trajectory=self.trajectory, harness=self.H
)
for op in crud_ops:
# Log op here before applying in production
self.H.apply_crud(**op)
return self.trajectory[-1]["result"]
The RL post-training path for domain-specific self-improving AI agents:
from castform import SyntheticQAGenerator, RLVRTrainer
from prime_agent import RLM
# Step 1: Generate synthetic Q&A pairs from your internal corpus
generator = SyntheticQAGenerator(corpus_path="s3://your-company/docs/")
dataset = generator.generate(n=10_000, difficulty="mixed")
# Step 2: RL post-train an open model on verifiable domain rewards
trainer = RLVRTrainer(
base_model="google/gemma-4-9b-it",
dataset=dataset,
reward_components=["retrieval", "citation", "correctness"],
training_steps=2_000
)
domain_model = trainer.train()
# Typical result: beats frontier APIs at 100x lower inference cost
# Step 3: Deploy with a self-improving harness
agent = RLM(model=domain_model, harness_config="config/my_domain.yaml")
9. The AGI Horizon: What Self-Improvement Signals
On August 5, 2026, Sundar Pichai announced that Demis Hassabis is stepping down as CEO of Google DeepMind to become Chair of GDM and Chief Scientist of Alphabet — purely focused on AGI. The Hacker News thread generated 619 comments, the largest AI discussion of the day.
The organizational signal is worth reading technically. The path from "excellent self-improving AI agent" to "AGI" is not a product management problem. It is a research problem, and its central question is whether self-improvement can be made continuous, safe, and scalable enough to generalize across all domains.
The Skill Entropy framework provides the clearest measurable proxy. Current frontier models degrade rapidly beyond SkE of roughly 8-10 distinct skills in sequence. A system with continuous Continual Harness self-modification and co-trained weights can, in principle, maintain performance at arbitrary SkE — because it synthesizes the skills it does not yet have. That is the technical definition of standing in the foothills of the singularity.
We are not there. But for the first time, we are building systems with the architectural properties that would be necessary to get there.

Each revolution of the spiral adds capabilities the previous revolution could not anticipate — the mathematical structure of self-improvement.
10. Conclusion and Next Steps
The story of self-improving AI agents in 2026 is not a story about any single product launch. It is a convergence — theory, practice, and infrastructure all arriving simultaneously because they were always solving the same problem: static scaffolding is a ceiling, and the models have outgrown it.
Four sentences: Self-improving AI agents replace hand-engineered harnesses with a mutable four-component state H = (rho, G, K, M) that the agent CRUDs in real-time. The Recursive Language Model makes sub-agent delegation a Python await call and context overflow architecturally impossible. Model-harness co-training via RLVR on domain-specific verifiable rewards produces models that outperform frontier APIs at a fraction of the cost. And Skill Entropy gives us, for the first time, a principled metric for measuring the distance to AGI.
The gap between today's best self-improving agents and a general-purpose autonomous engineer is still real. But it is now a measurable and addressable gap — not a vague philosophical horizon.
Start here this week:
-
Prime Agent:
pip install prime-agent— read the RLM quickstart and run the parallel sub-agent example -
Cloudflare Computer: github.com/cloudflare/computer — start with
AGENTS.md - Continual Harness paper: arxiv:2605.09998 — the Pokemon experiments alone justify the read
- Uber ADR: github.com/uber/ADR — audit your current agent's CRUD exposure before the attack techniques find you first
- Castform RLVR: if you have internal domain data, run the pipeline — the 100x cost reduction is real and reproducible
The agents you deploy today are the last generation that cannot improve themselves. Build the next one accordingly.
All arxiv references, GitHub repositories, and benchmark figures cited in this post are sourced from public announcements and research papers as of August 6, 2026.
Top comments (0)