Self-Harness: The Rise of the Self-Reshaping Agent

Self-Harness: Harnesses That Improve Themselves

2026-01-01
Hangfan Zhang, Shao Zhang, Kangcong Li, Chen Zhang, Yang Chen, Yiqun Zhang, Lei Bai, Shuyue Hu
Summary
Problem
Method
Results
Takeaways
Abstract

This paper introduces Self-Harness, an iterative framework that enables LLM-based agents to autonomously refine their own "harness" (prompts, tools, and runtime logic). By implementing it on Terminal-Bench-2.0, the authors achieved significant performance gains across diverse models like MiniMax M2.5, Qwen3.5, and GLM-5, with held-out pass rates increasing by up to 21.4% absolute points.

TL;DR

In the evolution of AI agents, we have transitioned from simple prompt engineering to complex "harnesses"—the scaffolding of tools, system prompts, and runtime rules that dictate how an LLM interacts with the world. However, these harnesses are usually handcrafted by humans. Self-Harness flips the script, allowing a fixed LLM to analyze its own execution failures and rewrite its own operating rules. The result? Performance boosts of up to 138% on complex terminal tasks, tailored specifically to the "personality" of the underlying model.

Problem: The "One-Size-Fits-All" Harness Trap

Currently, when we build an agent, we provide it with a harness (e.g., ReAct, Claude Code). But a harness that works for GPT-4 might lead Qwen or GLM into an endless loop. Different models have different tool-use habits, sensitivities to instruction, and failure modes.

Historically, solving this meant:

  1. Human Engineering: Slow, expensive, and unscalable.
  2. Meta-Harnessing: Using a 1-trillion parameter model to "fix" a smaller model. This is expensive and often misses the local nuances of the smaller model's behavior.

The authors argue that for a system to truly mature, it must be capable of self-creation—identifying its own weaknesses and patching its own interface.

Methodology: The Propose-Evaluate-Accept Loop

The core of Self-Harness is a three-stage iterative loop that treats harness improvement as an empirical state transition rather than a shot in the dark.

1. Weakness Mining

Instead of looking at failures as isolated errors, the system clusters them by "Verifier-Grounded Failure Signatures." It asks: Did we fail because of a timeout? A missing file? A syntax error? By grouping these, the agent sees patterns (e.g., "I always forget to create the output file until the last second").

2. Harness Proposal

The same model that failed the task is now asked to act as a "Developer." Provided with summarized evidence of its failures, it proposes minimal code changes to its own configuration—such as adding a new system instruction, changing a tool's retry logic, or enabling a runtime control policy.

Overview of the Self-Harness Loop

3. Proposal Validation (The Regression Gate)

Crucially, No edit is accepted blindly. Every proposal must pass a Regression Test. It is tested on "Held-in" tasks (the ones it failed) and "Held-out" tasks (new challenges). An edit is only merged if it improves performance on one without breaking the other.

Experiments: Model-Specific Evolution

The researchers tested Self-Harness on Terminal-Bench-2.0 using three distinct model families: MiniMax M2.5, Qwen3.5, and GLM-5.

Performance Across Models

Model Personality Discoveries:

  • MiniMax M2.5: The system discovered that this model explored too much and forgot to write output files. Self-Harness added a "create artifact early" instruction and a "max tool message" limit to force progress.
  • Qwen3.5: This model tended to retry failed commands endlessly. Self-Harness implemented a specialized middleware that triggered recovery prompts after tool errors.
  • GLM-5: It struggled with environment persistence. The evolved harness added rules to ensure shell settings persisted across sessions.

Critical Analysis: Why This Matters

The beauty of Self-Harness lies in its Inductive Bias. It assumes that the model isn't broken, but the interaction is. By keeping model weights fixed, it provides a "non-parametric" way to improve AI.

Limitations:

  • Benchmark Specificity: There is a risk that the harness overfits the specific types of tasks in Terminal-Bench.
  • High Compute Cost: Running multiple evaluation loops and regression tests is expensive in terms of inference tokens.
  • Bootstrap Requirement: You still need a "minimal" base harness to start; the agent cannot yet build itself from absolute zero.

Conclusion

Self-Harness moves us closer to "Autonomous Agent Engineering." Instead of human experts painstakingly tuning prompts for every new model version, we can let the models "mature" through their own experience. As the authors quote Henri Bergson: "To exist is to change... to mature is to go on creating oneself endlessly."

Evolution Trajectory Example

Find Similar Papers

Try Our Examples

  • Search for recent papers published in 2025 or 2026 that explore "Recursive Self-Improvement" (RSI) in LLM agents without external teacher models.
  • What are the architectural differences between "Self-Harness" and the "Meta-Harness" framework proposed by Lee et al. (2026)?
  • Find studies that apply automated prompt or harness optimization specifically to software engineering benchmarks like SWE-bench or Terminal-Bench-2.0.
Contents
Self-Harness: The Rise of the Self-Reshaping Agent
1. TL;DR
2. Problem: The "One-Size-Fits-All" Harness Trap
3. Methodology: The Propose-Evaluate-Accept Loop
3.1. 1. Weakness Mining
3.2. 2. Harness Proposal
3.3. 3. Proposal Validation (The Regression Gate)
4. Experiments: Model-Specific Evolution
4.1. Model Personality Discoveries:
5. Critical Analysis: Why This Matters
6. Conclusion