← Blog

/

Insights

Insights

RRSI explained: what it takes to optimize an AI agent's harness

Toloka Arena is live. See how your model ranks.

What it is
RRSI (Regularized Recursive Self-Improvement of Agent Harnesses) is a loop that proposes edits to the code and prompts around a frozen model, tests them on tasks and keeps only the ones that win by more than the noise. Regularization keeps it from overfitting to the tasks it is tuned on.

What it reports
Gains of 1.1 to 6.0 points across eight benchmarks in coding, agentic workspace tasks and engineering design, including sets the loop never saw.

What it needs
The same things as every other harness optimizer: tasks with automatic checks, and an environment, often called an RL gym, where the agent can run them many times, safely and reproducibly. For a company's own agent both have to be built, and how well they are built decides how much an optimizer can find.

Where people help
The loop runs without people. Reviewers at a few points make its results more reliable and easier to trust.

What we found
On a customer-support agent, an RRSI-style loop raised GPT-6 Luna from 56% to 69% of held-out runs passed and closed about half the gap to the stronger GPT-6.1 Terra. The gain came from better ticket discipline. It did not carry over to a second domain, and it did no harm there either.

Where Toloka fits
Toloka builds the environments and task sets that harness optimizers run on. The experiment in this article ran in one of them.

Why the harness is the lever

Consider a company that runs an LLM-based product: a support assistant, a developer agent, a document pipeline. The model is one component. Everything around it is the harness, the engineering that turns a model call into a working product.

A harness is a system of components, and the model is only one of them

Component

What it contains

Orchestration

The agent loop, routing, retries, time and budget limits

Prompts and context

Instructions, templates, context assembly and compression, memory between steps

Retrieval (RAG)

Indexing, vector search, reranking, passage selection

Data stores

Databases, caches, vector stores, interaction logs

Tools and services

Internal microservices, external APIs, tool descriptions, response parsing

Guardrails

Output validation, filters, safety rules, rollback on errors

Model providers

One or several models behind third-party APIs

The company wants better numbers: resolution rate, accuracy, latency, cost. When the model sits behind a provider's API, the weights are out of reach, fine-tuning is often unavailable or the team is not ready for it yet, and an update can arrive at any time and shift the behavior of the whole system. The lever the company always controls is the harness. Managing the quality of such a product therefore means managing its harness, and the open question is whether that happens systematically or as a patch after each incident.

None of this makes harness optimization a rival to fine-tuning. They solve different parts of the problem. The harness is the place for rules that can be put into words: an edit takes minutes, reads as a diff and usually carries over to the next model version. Fine-tuning takes over where the knowledge cannot be written down, or when cost and latency at volume call for a smaller model. A sensible order is to optimize the harness first and fine-tune once it plateaus, and that holds for an open-weight model on a team's own infrastructure as much as for a model behind an API. Both stages run on the same foundation, which is the subject of most of this article: realistic tasks with known correct outcomes and an environment to run them in. RRSI is a way to make the first stage systematic.

How RRSI works

RRSI (Regularized Recursive Self-Improvement of Agent Harnesses) is an open-source project from Google Research, released under Apache-2.0 and described in arXiv 2609.24972. It proposes edits to an agent's harness, measures them on tasks, and keeps the ones that win, while the model stays frozen.

Automatic harness optimization is not new: methods such as GEPA, ACE and Meta-Harness already let an LLM read an agent's traces and propose edits, and they are compared with RRSI below. The difficult part is not generating edits but avoiding self-deception. An unconstrained loop overfits to the tasks it is scored on, and the gain disappears on anything new. RRSI addresses this by regularizing the search itself.

RRSI consists of three layers: a task layer, a search loop and state. The model is frozen, and only the harness's code and prompts change, stored in a git branch.

Diagram of one RRSI round. A domain adapter feeds the current harness's traces into a six-step loop: analyst, proposer, critic, evaluate and selection. Selection fast-forwards the harness branch to the winning candidate and writes the verdict and hypothesis to a history log, which the proposer reads in the next round.

The task layer is the only part that depends on the domain. It holds the evolve and held-out sets, running and scoring, trace loading, a check that a candidate runs at all, and the critic's patterns. The core is domain-independent, so a new domain requires an adapter. For a company's own agent, that adapter and everything behind it is the part that has to be built, as described after the results.

In the search loop, the Analyst first reads the traces of the current harness: the worst attempts on weak tasks and the best on strong ones, so that working behavior is not broken. The Proposer drafts several candidates, each in its own git worktree. The Critic reviews them with a bounded number of repairs, the survivors are evaluated on the full evolve set, and Selection picks the winner. The branch evolve/‹name› is then fast-forwarded to it, and a history log records the component, hypothesis, score, cost change and verdict of every edit.

The regularizers distinguish this design from naive evolution. Each sits at a different point of the loop and covers a different failure mode.

Five regularizers, each against a different way a search goes wrong

Mechanism

Where in the loop

What it guards against

Annealed edit budget

Proposer

Large bundles of edits whose effect cannot be attributed

Hypothesis history; forced move to untried components

Proposer

Repeating refuted ideas; getting stuck in one place

Critic: rules and an LLM check

Before evaluation

Logic tailored to specific tasks in the set

Noise floor δ

Selection

Random variation mistaken for improvement

Cost rule and pruning

Selection

Rising cost without a gain; accumulating useless components

δ is set before the loop starts. The baseline harness is run several times, and δ equals two standard deviations of the difference between repeated runs of the same harness, or is estimated by bootstrapping over trials when only one run exists.

What RRSI reports

The authors report gains both on the sets used for evolution and on sets the harness never touched.

Reported gains, by the role the benchmark played. OOD is a set outside the evolution

Benchmark

Set role

Baseline

RRSI

Change, pts

Terminal-Bench 2.1

evolve

74.2

80.2

+6.0

EngDesign

evolve

50.0

54.9

+4.9

Harvey LAB

evolve

89.4

90.5

+1.1

Harvey LAB

held-out

86.9

89.2

+2.3

SWE-bench Verified

OOD

82.0

83.8

+1.8

JobBench

OOD

36.0

40.7

+4.7

GDPval

OOD

48.8

52.3

+3.5

APEX-Agents

OOD

34.2

37.9

+3.7

Frontier-Eng

OOD

17.7

22.0

+4.3

All nine reported results across eight benchmarks. Source: arXiv 2609.24972, Tables 1, 3 and 7, with Claude Opus 4.8 as the policy model. These are the authors' figures and were not reproduced here.

The effect is larger on a weaker model. With Gemini 3.5 Flash as the policy, the authors report Terminal-Bench 2.1 rising from 64.6 to 78.7 and SWE-bench Verified from 76.8 to 79.0. The evolved harness also carries over to a model it was not evolved with, which matters when a provider swaps the model underneath: with Gemini 3.1 Flash Lite, Terminal-Bench 2.1 rises from 11.2 to 14.6. The gains vary widely across benchmarks, and the smaller ones sit close to the range where evaluation noise matters. The authors also report that the harness RRSI produces runs on 30% fewer policy tokens than one produced by evolution without regularization, although it still uses more than the original harness.

All of these benchmarks are coding, agentic workspace and engineering design tasks. Results on customer support or other enterprise workflows have not been reported, so we ran it ourselves on a customer-support agent, as described later in this article.

RRSI is one of several harness optimizers

RRSI is the newest member of a fast-growing family. The methods differ in what they are allowed to edit and in how they search, so it is worth knowing the main ones before picking RRSI by default.

The main harness optimizers: what they edit, how they search and what they run on

Method

What it edits

How it searches

What it runs on

GEPA(2025)

Prompts and other text components

An LLM reflects on the traces of a few examples and rewrites the text. Candidates that are best on at least some validation examples stay in the pool

Training and validation examples with a metric, ideally one that also returns feedback in words

ACE(2025)

The context itself: a playbook of strategies, kept as a system prompt or as agent memory

Generation, reflection and curation add small structured updates instead of rewriting the whole context, so details are not lost

Tasks to run and a signal for each run: labels, or just the outcome of execution

Meta-Harness(2026)

Harness code

An agentic proposer reads the source code, scores and execution traces of all earlier candidates

A set of tasks with a scorer, and the stored traces of every run

AHE, TTHE, HarnessX (2026)

Harness code or typed harness components

Evolution loops driven by execution traces; TTHE adapts the harness at test time

Tasks, traces and a score or a judge for each run

RRSI(2026)

Harness code and prompts

An analyst, a proposer and a critic, with regularizers on what is proposed and what is accepted

Evolve and held-out task sets with verifiers, and repeated baseline runs to measure noise

The descriptions of AHE, TTHE and HarnessX follow the RRSI paper, which uses them as baselines together with Meta-Harness.

The last column is nearly the same in every row. Each method needs tasks to run the agent on, a signal that says whether a run went well, and a way to run the agent hundreds or thousands of times. Some need less labeling than others: ACE, for example, can learn from execution feedback without ground-truth answers. But that feedback has to come from a reliable source, and knowing whether an edit really helped still takes tasks the optimizer never saw. Tasks and an environment are therefore not the price of choosing RRSI. They are what harness optimization runs on, whichever method does the editing.

What harness optimization runs on: tasks and an RL gym

A harness optimizer improves what it measures, so the quality of the task set caps the quality of the result. A set that is too easy leaves nothing to improve, and one that leaks the answer teaches the system to look for it. Six properties are required, whichever optimizer is used, and each can be checked before the loop starts.

Six properties of a task set, what breaks without each, and how to check it

Property

If it is missing

How to check it

Automatically checkable outcome: tests, checks of the final state, or rubrics scored by a calibrated judge

Candidates cannot be compared; evaluation noise grows

A reference solution passes and an empty or trivial answer fails; where a judge scores, its scores agree with experts on a sample

Held-out set the system never sees

A gain on training tasks is mistaken for a real one

The split is made before the run, and the held-out set covers the shifts you expect, such as new case types or a policy change

Difficulty of "solved sometimes"

At 100% there is nothing to improve; at 0% there is no signal

The current agent runs each task repeatedly, and tasks solved only sometimes are kept, for example in 1 to 5 of 8 rollouts

No leakage

The system learns to find the answer instead of solving the task

Nothing in the task gives the answer away; for code, the environment holds no commits from the future

Realism

The loop improves a benchmark instead of the product

Tasks are built from real cases, and a domain expert confirms they reflect how the work is actually done

Freshness and volume

A long evolution exhausts the set and leads back to overfitting

Enough tasks for each type of failure, with new failures from production added over time

A production log is not yet a task. It records one run, and the loop needs to replay the same situation many times. Turning a real case into a task means recovering the state it started from, such as the customer's data and each tool's responses, writing a scenario for the simulated user, and stating what correct behavior is, since the agent or operator in the log may have got it wrong. Real cases form the core of the set; synthetic tasks fill the gaps and cover shifts that have not happened yet.

The environment

The tasks also need somewhere to run. In the benchmarks above, each task ships with its own sandbox: a container, a repository, a test suite. In most cases, a company's agent has nothing like that. It talks to internal services, databases, external APIs and real customers, while each round of the loop runs every candidate across the whole evolve set, and the baseline is run several times before the loop even starts to estimate δ. None of that can happen against production. It needs an environment built for the purpose, often called an RL gym. Despite the name, no reinforcement learning is required here: the environment is where the agent is evaluated and where better harness versions are searched for.

What an environment for an agent contains

Component

What it does

Sandboxed tools and services

Replicas or mocks of internal services and external APIs that respond the way production does, without touching production systems or real customer data

Seeded state

The accounts, records and documents each task starts from, reset to the same state before every run

User simulator

Plays the user in multi-turn tasks, following the task's scenario

Verifiers

Tests and checks of the final state, such as whether the right tool was called with the right arguments, plus rubrics where no test applies

Run infrastructure

Many isolated runs in parallel, each with a full trace, at a cost that makes repeated runs affordable

The algorithms are open source, and the model is often rented from a provider. The environment and the task set are specific to each system, and they are what a team has to build. How good they are decides how much any optimizer can find, because it can only improve what the checks can see. They also outlive the loop. The same environment shows whether a new model version is safe to switch to, catches regressions after a policy change and, if the team later decides to fine-tune, becomes the environment for reinforcement learning. Built once, it serves evaluation, harness optimization and training. This is the part Toloka builds for AI labs and enterprises: the environment, the tasks and the checks.

Making the results more reliable

RRSI runs without people, and the reported gains were obtained that way. A fully automatic loop, however, optimizes the metric rather than the goal: models propose the edits, score them and review them, and some failures are hard for a model to notice. Adding people at a few points makes the results more reliable and easier to trust, which matters most where a wrong change is expensive or has to be audited. None of these points is required; each can be added where it pays off.

Diagram of the RRSI loop with optional human review points. A task set in an environment feeds the RRSI loop, which proposes, evaluates and selects edits. A diff review accepts each winning edit before it becomes the next harness version. Two more review points feed in: experts check the verifiers and judge before the run, and experts diagnose failed traces for the loop.

Where human review adds reliability

Review point

What can go wrong without it

What the reviewer does

Checks, before the run

Tests and rubrics check only what someone thought to check, and an agent can learn to pass a check without solving the task

Looks for loopholes in the verifiers and closes them before the loop starts

Judge calibration

An LLM judge is noisy and can be biased, and its noise widens δ until real gains are rejected

Scores a sample of runs so the judge can be measured against expert scores and adjusted

Diff review

RRSI's critic is also a model; subtle fitting to the set, or a change that breaks a policy, can slip past it

Accepts each winning edit by its diff before it becomes the new version

Trace diagnosis

A 0/1 score does not show whether the agent, the test, the environment or noise is at fault

Reads failed traces, separates agent failures from task defects and gives the loop a precise diagnosis

New tasks

Production failures can be turned into tasks automatically, but an automatically built task can be wrong

Checks each new task before it enters the set

These review points are this article's recommendation, not part of the RRSI method, in which every step is automatic.

Automation does the search. People are worth adding where a wrong call is expensive. At Toloka, this review is done by domain experts from our network who work in the field the agent serves.

What happened when we ran it ourselves

The published benchmarks are coding, workspace and engineering tasks. To see how the approach behaves on an enterprise agent, we ran an RRSI-style loop on a customer-support agent in a help-desk environment for a retail brokerage that Toloka built: sandboxed account and ticketing tools, seeded customer data, a simulated customer and checks of the final database state. The agent talks to the simulated customer, looks up the account and the relevant policy, acts on the account and keeps support tickets, each with a status, tags and links to the records it concerns. A run passes only if the final state of the database matches the expected one and an LLM judge that reads the conversation scores it high enough.

The agent ran on GPT-6 Luna. Claude Sonnet 4.6 played the customer, Gemini 3.6 Flash was the judge, and Gemini 4 Argon read the traces and proposed edits. We let the loop change one thing: a block of additional instructions in the agent's prompt. That is a narrower search than RRSI allows, since RRSI can also change code, tools and control flow. The loop evolved the instructions on 48 tasks over three rounds. The winner was then frozen and tested on 48 held-out tasks that played no part in the search (4 runs per task), on 36 new tasks (5 runs per task) and on 48 tasks from a second domain, internal logistics operations (5 runs per task). As a reference point, we ran GPT-6.1 Terra, a stronger model, on the same brokerage tasks with no additional instructions.

What the loop found

Figure 3 shows the whole search: six attempts over three rounds, each scored on the 48 search tasks. Both candidates of the first round beat the baseline, and the better one was accepted. In the second round neither proposer finished a candidate within its turn limit. Both candidates of the third round scored below the accepted one and were rejected. One of them included a rule about hyphens in tags, aimed at a mistake we come back to below, but the rule arrived bundled with other changes and the candidate scored lower overall. So the result is one good edit rather than a chain of improvements.

Chart of the six search attempts, scored on the 48 search tasks. The baseline harness passed 56.3%. In round 1, candidate A reached 75.0% and was accepted; candidate B scored 70.8%. In round 2, neither proposer produced a candidate. In round 3, candidates scored 58.3% and 64.6% and were rejected, so 75.0% remained the best result.

Share of the 48 search tasks passed, one run per task. Scores on the search tasks are optimistic by construction, which is why the accepted candidate was then tested on other tasks.

The accepted edit added four rules, paraphrased here:

  • Keep one ticket per request; when the customer follows up, update it instead of opening a new one.

  • Leave optional fields empty when nothing applies. If a tool rejects the arguments, fix them and retry; a rejected call is not a system failure.

  • While waiting for the customer to confirm something or send details, keep the ticket open.

  • Before closing a ticket, check the required tags, and include the figures and references from the policy in the reply.

None of them mentions a specific task or answer. They read like advice a team lead would give a new support agent in the first week.

The results

Chart comparing share of runs passed on brokerage tasks. On 48 held-out tasks, GPT-6 Luna passed 55.7%, Luna with the RRSI instructions 69.3%, and GPT-6.1 Terra 85.9%. On 36 new tasks, the figures were 51.1%, 66.1% and 78.3%. The instructions closed about half the gap between Luna and the stronger Terra.

Share of runs passed, by task set

Task set

Luna

Luna + RRSI instructions

Terra

Held-out brokerage tasks (48 tasks, 4 runs each)

55.7%

69.3%

85.9%

New brokerage tasks (36 tasks, 5 runs each)

51.1%

66.1%

78.3%

Logistics, a second domain (48 tasks, 5 runs each)

49.2%

51.3%

not run

Intervals in the text are 97.5% intervals from a bootstrap over tasks, so repeated runs of one task count as one cluster. The Luna and Terra runs were three days apart, so drift on the provider side cannot be ruled out.

On the held-out tasks the share of passed runs rose from 55.7% to 69.3%, a gain of 13.5 points with a 97.5% interval of 4.7 to 22.4. This was the main test, and its success criterion was fixed before the run. On the new tasks the gain was 15.0 points, and the instructions came out ahead in each of the five repeats. The agent also got slightly cheaper to run, using 4.5% to 6.7% fewer tokens. In logistics the gain was 2.1 points, with an interval from -5.4 to 9.2, so no transfer was established. The good news is that there was no sign of harm either: rules written for one domain did not make the agent worse in another.

The instructions closed 45% of the gap to Terra on the held-out tasks and 55% on the new ones. Terra stayed ahead: by 16.7 points on the held-out tasks, where the interval (6.3 to 27.1) clears zero, and by 12.2 points on the new tasks, where it does not (-1.7 to 26.1). Luna with the instructions beat Terra on 7 of the 84 tasks, and Terra used 7% to 10% more tokens per run. The instructions were not free of side effects: of the 84 brokerage tasks, 41 improved, 35 did not change and 8 got worse.

What the traces showed

A pass rate shows how much changed, not what. We read through the verdicts of the brokerage runs, 372 for each of the three setups, and a few things stood out.

Three tickets for one question. Without the instructions, Luna often opened a new ticket for a request that already had one. In the worst cases, a conversation about a single request ended with three tickets. With the instructions, runs that failed on an extra ticket went from 34 to one. Terra, for comparison, still had 14.

Blaming the system for its own typo. Luna often passed empty strings to optional fields, or numbers where the tool expected text, and the ticketing tool rejected the call. That happened in 56 of 372 runs, and in nine of them the agent then escalated the ticket to the second line with the reason "system error". With the instructions, rejected calls fell to 20 runs and these escalations to zero. Terra had a call rejected once.

One underscore. The agent's system prompt lists the allowed tags with words joined by hyphens. The customer's profile stores one of those values with an underscore, and Luna regularly copied it from there. That single character failed 29 runs without the instructions and 34 with them, more than a quarter of everything Luna with the instructions still got wrong. Terra did not make this mistake once in 372 runs.

A happy judge is not a passed task. In more than a quarter of Luna's failed runs, the LLM judge gave a perfect score, and the check of the database failed them on a tag, a link or a ticket. Graded by the judge alone, the three setups would look almost alike: average judge scores were 0.82, 0.83 and 0.86, while the pass rates were 53%, 68% and 82%. Without strict checks of the final state there would have been little for an optimizer to improve, and little to show that it had.

What we took from it

  • The gain held where it counts. It showed up on tasks the search never touched, and it needed no change to the model.

  • The environment made the result possible. The strict checks of the final state built into Toloka's environment separated setups that a judge scored almost the same. An optimizer can only improve what the checks can see, so the quality of the environment set the ceiling for the whole exercise. It also means the expected answers have to be right, which is a job for a domain expert when the tasks are built, the first review point in Table 7.

  • The gain stays in its domain. The logistics agent fails mostly on other ticket fields, statuses and escalation details, which the brokerage rules do not address. Each domain needs its own tasks, its own environment and its own search, as Tables 5 and 6 describe.

  • Instructions fix discipline, not capability. The rules taught Luna habits that Terra mostly has without being told: one ticket per request, the closing tag, no escalations for its own mistakes. The remaining gap lies in precision, in the exact tags, links and fields that the stronger model gets right more often. Closing it is a job for a stronger model or for fine-tuning.

  • Measure the noise before you start. We calibrated the noise floor δ from a single baseline run, which gave zero, so the loop fell back to a minimum of two tasks out of 48, or 4.2 points. Repeated runs later showed the unchanged baseline scoring anywhere from 25 to 30 of the 48 held-out tasks, which puts δ at about 12 points. It did not change the outcome, since the winner led by 18.8 points, but a smaller edit could have been accepted on noise. Run the baseline several times.

  • A small search space gives a short search. With only the instructions to edit, the loop found its best idea in the first round. Letting it change tool descriptions or code, and giving the proposer more turns, is the obvious next step.

Optimizing your agent's harness with Toloka

RRSI, GEPA and the other optimizers supply the engine, and most of them are open source. What a team has to add is what every one of them runs on: an environment, a task set with the six properties from Table 5 and, where it pays off, reviewers at the points from Table 7. Toloka builds RL gyms for web, coding and enterprise agents, both custom and off-the-shelf. The off-the-shelf enterprise set alone has 1,990 agentic tasks across 11 business environments, including customer support, travel, logistics and HR, and it has already been used for training: one epoch of RL on it took Qwen3.5-27B from 41.6% to 64.5% on held-out tasks.

This is for teams that run an agent in production, such as a support assistant, a document pipeline or a developer agent, and want measurable gains from the system they already have, whether its model is reached through an API or is an open-weight model deployed in-house. It fits regulated settings especially well: the model's weights do not change, and every improvement arrives as a readable diff that can be reviewed, logged and rolled back. It also prepares the ground for fine-tuning, because the same environment and tasks are what a model would later be trained on.

How an engagement runs, and what each stage leaves you with

Stage

What happens

What you get

1. Assessment

We review your agent and its failures, turn a sample of your scenarios into tasks and run your current harness on them

Where your agent stands, where and why it fails, and how much room the harness has to improve

2. Environment and task set

We build the environment around your tools and services, and evolve and held-out sets from your cases, with every task checked against Table 5

An environment and task set you own, reusable for evaluation, regression testing and RL training

3. Optimization

RRSI, GEPA or another optimizer runs in the environment; where it pays off, experts review checks, edits and failed traces at the points from Table 7

Harness versions whose gains hold on held-out tasks, with every change logged

Tasks can come from your production cases, from synthetic data that mirrors them when real data cannot leave your perimeter, or from domain experts.

Talk to an expert

If you run an agent and want to know whether this approach fits it, book a call with a Toloka expert in agent evaluation. We will go through your agent and where it fails, what an environment and task set for it would involve, and where its harness is likely to have room to improve.

Subscribe to our newsletter

Product updates, case studies and the latest news from our team, straight to your inbox