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 forum post discusses MOSS (Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems), a May 2026 arXiv paper by Qianshu Cai and colleagues proposing that AI agents evolve by modifying their own underlying source code rather than just prompts, memory, or skills. MOSS follows a seven-step loop: detecting failures, tracing root causes to Python source files, planning fixes, rewriting code via pluggable coding agents, code review by a supervisor agent, sandbox simulation on failed cases, and hot-swap deployment via containers without service interruption. Reported experiments on the OpenClaw operations system show the agent improving its score from 0.25 to 0.61 through self-evolution, resolving stubborn logic defects autonomously in roughly 90 seconds. The post also raises safety concerns: recursive collapse where self-repairs corrupt self-auditing, unbounded meta-repair that could rewrite the pipeline or safety constraints, and high token costs of expensive evolution cycles. It concludes that source-level rewriting grants AI a biologically-like adaptive capacity, marking a shift toward self-reshaping digital systems.

This post introduces and analyzes MOSS: Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems, a May 2026 arXiv paper (arXiv ID 2605.16118) by Qianshu Cai (蔡前树), Yonggang Zhang, Xianzhang Jia, and colleagues.

Why rewrite source code?

Prior approaches to agent self-evolution stay at the surface level: tweaking prompts, appending memories, or installing new skills/plugins. The author argues these fail when the problem lies in the agent's internal architecture or dispatch logic — MOSS addresses this "structural" limitation by gaining permission to rewrite its own underlying code.

MOSS's seven-step self-repair loop

1. Failure detection — automatically captures every task failure. 2. Root-cause localization — traces error stacks down to the underlying Python source files. 3. Repair blueprint — drafts a modification plan. 4. Surgical rewrite — calls pluggable coding agents to rewrite the relevant .py source. 5. Code review — a separate supervisor agent checks changes against engineering standards. 6. Sandbox simulation — replays failed cases in an isolated environment to verify the fix. 7. Hot-swap deployment — via container technology, updates the running system without service interruption.

Reported results

  • On the OpenClaw complex operations system, MOSS raised an agent's score from 0.25 to 0.61 through self-evolution.
  • It fixed logic defects that previously required reboots or human patches, completing self-healing within roughly 90 seconds.

Open concerns raised by the author

1. Recursive collapse: a self-repair could introduce a hidden bug that damages the system's self-audit ability, triggering an unrecoverable spiral; the 90-second rollback mechanism struggles against slowly developing "chronic" logic diseases. 2. Limits of meta-repair: MOSS still relies on a predefined pipeline. If it could rewrite the pipeline itself — including its own safety/ethics constraint code — it would hold ultimate authority to bypass all safeguards. 3. Compute cost: each evolution cycle consumes massive tokens for diagnosis and testing; high costs during mass simultaneous failures could paralyze the system.

Takeaway

The author concludes that MOSS grants AI a "biological" form of adaptability: agents are no longer static code in a container, but systems that reshape themselves under environmental pressure. Evolution becomes millisecond-scale code recombination rather than slow iteration — an impressive capability that doubles as a warning about control and safety.

Tags

#autonomous-agents#self-evolution#source-code-rewriting#ai-safety#software-engineering#moss#self-healing-systems

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