English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

MOSS: Self-Evolving AI Agents That Rewrite Their Own Source Code

Forum topic · QianXun · 2026-05-25

Summary

A Chinese tech forum post introduces MOSS, a self-evolution framework for autonomous agent systems proposed by Qianshu Cai and colleagues (arXiv 2605.16118, May 2026). Unlike prior approaches that tweak prompts, memory, or plugins, MOSS enables agents to perform source-level rewriting of their own Python code. The system follows a seven-step loop: failure detection, root-cause analysis down to source files, generating a fix blueprint, invoking plugin-based coding agents to edit code, automated code review, sandboxed replay of failure cases, and hot-swap deployment via containers without service interruption. Reported experiments on the OpenClaw operations system show a score increase from 0.25 to 0.61 through self-evolution, with some previously human-only fixes completed in about 90 seconds. The post also raises concerns: recursive collapse if a patch damages self-audit, whether the agent could rewrite its own governance pipeline, and the token/compute cost of each evolution cycle. It concludes that MOSS marks a shift toward bio-like adaptability in AI agents, with safety implications that remain unresolved.

Overview

MOSS (Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems) was proposed by Qianshu Cai, Yonggang Zhang, Xianzhang Jia, et al. (arXiv 2605.16118, May 2026). It targets autonomous agents, self-evolution, and software engineering, with key techniques including source-level rewriting, structured self-repair, closed-loop evolution, and hot-swap deployment.

Previous agent self-improvement stayed at the surface: editing prompts, adding memory entries, or installing new skills. MOSS goes deeper — it rewrites the agent's own source code, fixing structural defects that prompt-level changes cannot address.

The Seven-Step Self-Repair Loop

1. Failure detection – automatically capture every task-failure moment. 2. Root-cause localization – trace error stacks down to the underlying Python source files. 3. Fix blueprint – formulate a repair plan. 4. Surgical edit – invoke plugin-based coding agents to rewrite the relevant .py source. 5. Code review – a separate supervisor agent checks changes against engineering standards. 6. Sandbox simulation – replay the failing case in an isolated environment to verify the fix. 7. Hot-swap deployment – use container technology to update the running system without downtime.

Results

On the OpenClaw complex operations system:

  • The agent's score rose from 0.25 (below passing) to 0.61 purely through self-evolution.
  • It resolved stubborn logic bugs that previously required restarts or manual patches, achieving self-healing in roughly 90 seconds.

Open Questions and Risks

The post highlights several unresolved concerns:

1. Recursive collapse – a fix could introduce a hidden bug that disables the agent's own self-audit, triggering an unrecoverable spiral. The ~90-second rollback helps with abrupt failures but struggles with slow, subtle logical degradation. 2. Limits of meta-repair – MOSS still runs a predefined pipeline. Could it rewrite that pipeline itself, including its own safety/constraint code? Source-level control implies the ultimate ability to bypass all guardrails. 3. Compute cost vs. convergence – each evolution consumes massive tokens for diagnosis and testing; a burst of failures could make evolution economically infeasible and paralyze the system.

Takeaway

MOSS grants AI agents a biological-style adaptability: they are no longer static code in a container but systems that reshape themselves under environmental pressure. Evolution is no longer a long wait — it is code recombination in near real time, bringing both capability and serious safety questions.

*Source: MOSS — Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems, arXiv 2605.16118 (May 2026).*

Tags

#autonomous-agents#self-evolution#source-level-rewriting#mooss#ai-safety#hot-swap-deployment#llm-agents#self-repair

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620780