MOSS: Self-Evolution through Source-Level Rewriting

Autonomous agent self-improvement via source code adaptation

Published: May 21, 2026

Last updated: May 21, 2026

🤖 Research Paper Alert

MOSS (Self-Evolution through Source-Level Rewriting) represents a breakthrough in autonomous agent systems. Unlike previous self-improving agents that only modify text artifacts (prompts, configs, memory), MOSS performs source-level code adaptation—rewriting the actual agent harness code to fix structural failures.

📄 Paper Details

Full Title

"MOSS: Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems"

Authors

Qianshu Cai et al.

arXiv ID

arXiv:2605.22794 [cs.AI]

Submission Date

May 21, 2026

Paper Length

12 pages, 3 figures, 2 tables

💡 Key Innovation

🔧 Source-Level vs. Text-Level Evolution

Previous self-evolving agents only modify text-mutable artifacts: skill files, prompt configurations, memory schemas, workflow graphs. MOSS modifies the actual source code—routing, hook ordering, state invariants, dispatch logic—making it Turing-complete and deterministic.

📈 Performance Results

On OpenClaw, MOSS lifted a four-task mean grader score from 0.25 to 0.61 in a single cycle without human intervention.

⚙️ Multi-Stage Pipeline

1. Evidence Curation
Automatically collects production-failure evidence batches
2. Code Modification
Delegates to pluggable external coding-agent CLI
3. Verification
Replays batch against candidate in ephemeral trial workers
4. Deployment
User-consent-gated, in-place container swap with health-probe-gated rollback

🎯 Why This Matters

✅ Structural Failure Resolution

Since routing, hook ordering, and state invariants live in code (not text), source-level adaptation can fix an entire class of structural failures that text-mutable agents cannot reach.

✅ Deterministic Adaptation

Source code changes take effect deterministically rather than relying on base-model compliance, making evolution more reliable and predictable.

✅ No Context Drift

Unlike text-based evolution that can erode under long-context drift, source-level changes are permanent and don't degrade over time.

✅ Production-Ready

MOSS operates on production agentic substrates with safety mechanisms: verification, user consent, health probes, and automatic rollback.

Official Resources

← Back to Dashboard Back to Dashboard