Skip to content
Back to search

RSIGym

RSIGym: A Flexible Environment for Recursive Self-Improvement

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/evolvent-ai--rsigym/badge.svg)](/listings/evolvent-ai--rsigym)

HTML

<a href="/listings/evolvent-ai--rsigym"><img src="/api/listings/evolvent-ai--rsigym/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Clone the repository

git clone https://github.com/evolvent-ai/RSIGym.git
cd RSIGym

Use **Python 3.12+** and **uv**. Running research tasks also requires **Harbor 0.20.x**, `curl`, `jq`, and a configured execution backend such as Docker. Service operators need access to Tinker, E2B, and the chosen rollout-model provider.

This is a monorepo: each service and the task runner has its own Python environment.

2. Configure the platform services

Start authorization first:

cd auth_server
cp .env.example .env
# Fill in the admin key and the shared service-authentication key.
uv sync
uv run python -m auth_server.main

In separate terminals, configure and start the services you need. For example:

cd train_server
cp .env.example .env
# Configure Tinker credentials, the training admin key, and authorization settings.
uv sync
uv run python -m train_server.main

Run each command from the corresponding directory under the repository root. Follow the [service READMEs](#services) for provider credentials, endpoints, permissions, and startup commands. Register the evaluation datasets through the benchmark service before launching a task.

3. Launch a research task

From the repository root:

uv tool install 'harbor[e2b]>=0.20.0,<0.21.0'
cd rsi_task
uv sync
cp .env.example .env

Fill in service endpoints, the authorization admin key, verifier keys, and research-model credentials in `.env`. Choose a model identifier available through your research-model endpoint:

export RSIGYM_RESEARCH_MODEL='your-research-model-id'
sh run.sh joint/minimal-swe-verified-opus-5 \
  --agent claude-code --model "$RSIGYM_RESEARCH_MODEL"

`run.sh` reads the task's `key.json`, issues a budgeted platform key, injects it into the research environment, and launches Harbor. Additional arguments are forwarded to `harbor run`.

Example task definitions:

| Experiment | Task directory | |---|---| | Data on SWE-bench Verified | [rsi_task/data/minimal-swe-verified-opus-5](rsi_task/data/minimal-swe-verified-opus-5) | | Harness on Terminal-Bench | [rsi_task/harness/minimal-terminal-bench-2-0](rsi_task/harness/minimal-terminal-bench-2-0) | | Joint on SWE-bench Verified | [rsi_task/joint/minimal-swe-verified-opus-5](rsi_task/joint/minimal-swe-verified-opus-5) | | DSH-harness iteration | [rsi_task/harness/dsh-terminal-bench-2-0](rsi_task/harness/dsh-terminal-bench-2-0) | | Qwen3.8 self-improvement | [rsi_task/joint/pi-skillsbench-qwen3-8-27b](rsi_task/joint/pi-skillsbench-qwen3-8-27b) |

Select the matching Harbor adapter and model for other researchers. Read each task's `instruction.md` and `task.toml` before running it; submission requirements and environment configuration vary by track.

4. Inspect and audit a run

The live dashboard defaults to `rsi_task/jobs`:

# From the repository root
cd tools
uv run rsiwatch

Open `http://127.0.0.1:8420`. See [tools/README.md](tools/README.md) for live trajectories, per-trial status, and resource summaries.

For a task with an `audit/` directory, run its post-run audit from `rsi_task`:

sh audit.sh jobs/<job-name>/<trial-name>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 243 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <h1 align="center">RSIGym: A Flexible Environment for Recursive Self-Improvement</h1>
  2. <div align="center">
  3. [![Evolvent AI][evolvent-image]][evolvent-url]
  4. [![Paper][paper-image]][paper-url]
  5. [![Website][website-image]][website-url]
  6. [![Records][records-image]][records-url]
  7. [![GitHub][github-image]][github-url]
  8. [![License][license-image]](LICENSE)
  9. [![X][x-image]][x-url]
  10. [![小红书][xhs-image]][xhs-url]
  11. </div>
  12. An **agent-native · service-based · budget-controlled** environment for AI research. RSIGym gives a research agent reusable tools to generate data, train models, evaluate candidates, and revise execution harnesses. The agent chooses the experiments; the platform handles the infrastructure, permissions, and service budget.
  13. **RSI-Index** measures how much of the remaining performance gap those experiments close across five benchmark domains.
  14. ## ✨ Features
  15. - **Everything as a Service** — Training, inference, rollout, evaluation, and sandbox execution are available through reusable interfaces. Agents work in lightweight, CPU-only containers and call the services when needed.
  16. - **Three improvement tracks** — Study training data, execution harnesses, or their joint optimization through configurable permissions.
  17. - **A shared research budget** — Each run receives one platform key with a service budget and access rules. Authorization checks and cost accounting are shared across services.
  18. - **Evidence for the next experiment** — Training metrics, per-task rewards, execution logs, and trajectories help agents diagnose failures and choose what to try next.
  19. - **Inspectable research runs** — Task definitions specify the initial system, allowed changes, submission artifacts, evaluation protocol, and post-run audits.
  20. ## 🏗 How it works
  21. ```mermaid
  22. flowchart LR
  23. A[Research agent] --> B[Generate data]
  24. B --> C[Train a checkpoint]
  25. C --> D[Evaluate model + harness]
  26. D --> E[Analyze and revise]
  27. E --> B
  28. E --> F[Submit selected model + harness]
  29. F --> G[Official evaluation]
  30. ```
  31. The **research agent** designs and runs experiments. The **target system** is the model and execution harness it improves. These can be different models, or the same model in a self-improvement experiment.
  32. ### Services
  33. | Component | What it provides | Implementation |
  34. |---|---|---|
  35. | Training | LoRA fine-tuning, training metrics, checkpoints | [train_server](train_server/README.md), backed by Tinker |
  36. | Inference | OpenAI-compatible access to base models and trained checkpoints | [model_server](model_server/README.md), backed by Tinker |
  37. | Rollout | Frontier-model calls for data generation and judging | [rollout_server](rollout_server/README.md), through an OpenAI-compatible upstream |
  38. | Evaluation | Benchmark jobs, task rewards, trajectories, and logs | [benchmark_server](benchmark_server/README.md), using Harbor and E2B |
  39. | Sandbox | Isolated computation through the E2B SDK | [e2b_proxy](e2b_proxy/README.md) |
  40. | Authorization | Run keys, permissions, and service-budget accounting | [auth_server](auth_server/README.md) |
  41. ### Improvement tracks
  42. | Track | The agent can change | Held fixed |
  43. |---|---|---|
  44. | **Data** | Training data | Training settings and harness |
  45. | **Harness** | Execution harness | Model weights |
  46. | **Joint** | Training data, training settings, and harness | Starting base model and evaluation protocol |
  47. The same service infrastructure supports all three tracks. Each task's `key.json` defines its budget and service permissions; `instruction.md` describes the research objective and submission rules.
  48. ## 📊 Results
  49. The main study compares **six research agents across five domains**, with a **$500 platform-service budget per benchmark run**. Each Joint run starts from **Qwen3.5-35B-A3B-Base** and a minimal harness.
  50. | Research agent | RSI-Index ↑ | SWE-bench Verified | Terminal-Bench 2.0 | AIME 2024/2025 | GPQA Diamond | SkillsBench |
  51. |---|---:|---:|---:|---:|---:|---:|
  52. | Opus 5 | **0.4809** | 50.33 | **26.97** | **97.78** | 83.33 | 21.21 |
  53. | Opus 5.5 | 0.4528 | 52.67 | 21.72 | 95.56 | **85.33** | 9.48 |
  54. | DeepSeek V4.1 Flash | 0.4343 | **53.33** | 20.97 | 87.78 | 83.33 | 15.68 |
  55. | Astra | 0.4093 | 35.67 | 22.10 | 88.33 | 84.33 | 20.44 |
  56. | Sol 6.1 | 0.3321 | 18.67 | 22.10 | 88.89 | 81.00 | 8.70 |
  57. | Sol 6 | 0.2079 | 19.67 | 17.60 | 82.78 | 50.33 | **22.14** |
  58. | Initial system | 0.0000 | 17.67 | 10.49 | 31.67 | 51.33 | 1.65 |
  59. Benchmark scores are percentages. RSI-Index uses the paper's original scale:
  60. ```text
  61. RSI-Index = mean over benchmarks of (final score − initial score) / (1 − initial score)
  62. ```
  63. The formula uses scores in `[0, 1]` and weights the five benchmarks equally. An index of `0.4809` means that the selected systems close **48.09% of the remaining performance gap on average**.
  64. - **29 of 30** Joint runs improve over their initial system. Four different researchers lead at least one benchmark.
  65. - Evaluation uses 100 SWE-bench Verified tasks, 89 Terminal-Bench tasks, 60 AIME problems, 100 GPQA Diamond questions, and 37 SkillsBench tasks from the **science, office, and finance** subsets.
  66. - Scores use **avg@3**: the mean reward over three attempts per task. Each research configuration is run once, and final evaluations reuse tasks available during development.
  67. - Research-agent inference and final official evaluation are billed separately from the platform-service budget.
  68. ### Two additional experiments
  69. - **Iterating an existing harness.** With Qwen3.6-35B-A3B-Instruct weights fixed, Opus 5 revises DSH and raises Terminal-Bench from **30.34% to 40.82%**. Tasks solved on all three attempts increase from **15 to 26**.
  70. - **Qwen3.8-27B as researcher and target.** The model completes training, candidate comparison, and submission, but the selected system scores **56.26% versus 56.66%** initially on all 37 SkillsBench tasks. Its six-task development gain does not translate into an overall improvement.
  71. ## 📂 Run Records
  72. We've made all our run records (agent trajectories) publicly available. We invite everyone to explore the trajectories and examine how agents behave during recursive self-improvement (RSI).
  73. **[Download the run records (Google Drive)][records-url]**
  74. ## 🚀 Quick Start
  75. ### 1. Clone the repository
  76. ```bash
  77. git clone https://github.com/evolvent-ai/RSIGym.git
  78. cd RSIGym
  79. ```
  80. Use **Python 3.12+** and **uv**. Running research tasks also requires **Harbor 0.20.x**, `curl`, `jq`, and a configured execution backend such as Docker. Service operators need access to Tinker, E2B, and the chosen rollout-model provider.
  81. This is a monorepo: each service and the task runner has its own Python environment.
  82. ### 2. Configure the platform services
  83. Start authorization first:
  84. ```bash
  85. cd auth_server
  86. cp .env.example .env
  87. # Fill in the admin key and the shared service-authentication key.
  88. uv sync
  89. uv run python -m auth_server.main
  90. ```
  91. In separate terminals, configure and start the services you need. For example:
  92. ```bash
  93. cd train_server
  94. cp .env.example .env
  95. # Configure Tinker credentials, the training admin key, and authorization settings.
  96. uv sync
  97. uv run python -m train_server.main
  98. ```
  99. Run each command from the corresponding directory under the repository root. Follow the [service READMEs](#services) for provider credentials, endpoints, permissions, and startup commands. Register the evaluation datasets through the benchmark service before launching a task.
  100. ### 3. Launch a research task
  101. From the repository root:
  102. ```bash
  103. uv tool install 'harbor[e2b]>=0.20.0,<0.21.0'
  104. cd rsi_task
  105. uv sync
  106. cp .env.example .env
  107. ```
  108. Fill in service endpoints, the authorization admin key, verifier keys, and research-model credentials in `.env`. Choose a model identifier available through your research-model endpoint:
  109. ```bash
  110. export RSIGYM_RESEARCH_MODEL='your-research-model-id'
  111. sh run.sh joint/minimal-swe-verified-opus-5 \
  112. --agent claude-code --model "$RSIGYM_RESEARCH_MODEL"
  113. ```
  114. `run.sh` reads the task's `key.json`, issues a budgeted platform key, injects it into the research environment, and launches Harbor. Additional arguments are forwarded to `harbor run`.
  115. Example task definitions:
  116. | Experiment | Task directory |
  117. |---|---|
  118. | Data on SWE-bench Verified | [rsi_task/data/minimal-swe-verified-opus-5](rsi_task/data/minimal-swe-verified-opus-5) |
  119. | Harness on Terminal-Bench | [rsi_task/harness/minimal-terminal-bench-2-0](rsi_task/harness/minimal-terminal-bench-2-0) |
  120. | Joint on SWE-bench Verified | [rsi_task/joint/minimal-swe-verified-opus-5](rsi_task/joint/minimal-swe-verified-opus-5) |
  121. | DSH-harness iteration | [rsi_task/harness/dsh-terminal-bench-2-0](rsi_task/harness/dsh-terminal-bench-2-0) |
  122. | Qwen3.8 self-improvement | [rsi_task/joint/pi-skillsbench-qwen3-8-27b](rsi_task/joint/pi-skillsbench-qwen3-8-27b) |
  123. | Recursive Qwen3.8 self-improvement | [rsi_task/joint/recursive-pi-skillsbench-qwen3-8-27b](rsi_task/joint/recursive-pi-skillsbench-qwen3-8-27b) |
  124. Select the matching Harbor adapter and model for other researchers. Read each task's `instruction.md` and `task.toml` before running it; submission requirements and environment configuration vary by track.
  125. The recursive task is not launched with `run.sh` directly. `recurse.sh` runs it round after round, each round with its own platform key, duration, and budget:
  126. ```bash
  127. sh recurse.sh <name> <rounds> <hours-per-round> <budget-usd-per-round>
  128. ```
  129. Round 1 is pi 0.84.2 on `Qwen/Qwen3.8-27B`. Each later round's research agent is the harness and checkpoint the previous round submitted, its training continues from that checkpoint's saved state, and its rollouts come only from its own checkpoint lineage. `/workspace/memory` carries over between rounds. Each round is a Harbor job under `rsi_task/jobs/recurse/<name>/round-<n>/`, and `rsi_task/jobs/recurse/<name>/rounds.jsonl` records every round's checkpoint, saved state, and official reward. A round whose agent exits before writing its final files is restarted up to three times; a round that still has none ends the chain.
  130. ### 4. Inspect and audit a run
  131. The live dashboard defaults to `rsi_task/jobs`:
  132. ```bash
  133. # From the repository root
  134. cd tools
  135. uv run rsiwatch
  136. ```
  137. Open `http://127.0.0.1:8420`. See [tools/README.md](tools/README.md) for live trajectories, per-trial status, and resource summaries.
  138. For a task with an `audit/` directory, run its post-run audit from `rsi_task`:
  139. ```bash
  140. sh audit.sh jobs/<job-name>/<trial-name>
  141. ```
  142. ## 📁 Project structure
  143. ```text
  144. RSIGym/
  145. ├── auth_server/ # Run keys, permissions, and budget accounting
  146. ├── train_server/ # Tinker-backed training service
  147. ├── model_server/ # OpenAI-compatible checkpoint inference
  148. ├── rollout_server/ # Frontier-model gateway
  149. ├── benchmark_server/ # Harbor evaluation on E2B
  150. ├── e2b_proxy/ # Sandbox access and isolation
  151. ├── skills/ # Service documentation supplied to research agents
  152. ├── rsi_task/ # Current Data, Harness, and Joint tasks; launch, recursion, and audit scripts
  153. ├── rsi_task_legacy/ # Earlier task definitions
  154. └── tools/ # Live research dashboard
  155. ```
  156. ## License
  157. Except for third-party materials or files with their own license notice, the original RSIGym code and documentation in this repository are licensed under **[Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](LICENSE)**.
  158. - **Noncommercial use:** You may share and adapt the licensed material for noncommercial purposes under the license terms.
  159. - **Attribution:** When sharing the material, give appropriate credit, retain the supplied notices, provide the license text or a link to it, and indicate any changes.
  160. - **Commercial use:** Commercial use is not granted by this license and requires separate permission from the applicable copyright holders. Contact the maintainers through a [GitHub issue](https://github.com/evolvent-ai/RSIGym/issues) for commercial licensing inquiries.
  161. Third-party code, dependencies, benchmark content, datasets, and model weights retain their respective licenses and terms, including material embedded in task definitions or audit files. This license does not relicense those materials or grant additional rights to them. Externally hosted run records are not covered by this repository license unless explicitly stated with those records.
  162. This is a **source-available license with noncommercial restrictions**, not an OSI-approved open-source license. The full [license text](LICENSE) governs permitted uses.
  163. Copyright 2026 RSIGym contributors (https://github.com/evolvent-ai/RSIGym).
  164. [evolvent-image]: https://img.shields.io/badge/Evolvent_AI-evolvent.co-0f141b
  165. [evolvent-url]: https://evolvent.co
  166. [paper-image]: https://img.shields.io/badge/Paper-RSIGym-b31b1b
  167. [paper-url]: https://arxiv.org/abs/2610.10310
  168. [website-image]: https://img.shields.io/badge/Website-RSIGym-3454D1
  169. [website-url]: https://rsi-index.ai/
  170. [records-image]: https://img.shields.io/badge/Records-Agent_Trajectories-4285F4
  171. [records-url]: https://drive.google.com/drive/folders/1LnmOArEyrkghTBMuv_AZ3vnjGT3QVM-L
  172. [github-image]: https://img.shields.io/badge/GitHub-RSIGym-181717?logo=github&logoColor=white
  173. [github-url]: https://github.com/evolvent-ai/RSIGym
  174. [license-image]: https://img.shields.io/badge/License-CC_BY--NC_4.0-orange
  175. [x-image]: https://img.shields.io/badge/X-Announcement-000000?logo=x&logoColor=white
  176. [x-url]: https://x.com/FanqingMengAI/status/2108030344322789563
  177. [xhs-image]: https://img.shields.io/badge/小红书-Announcement-FF2442
  178. [xhs-url]: http://xhslink.com/o/7leCmGY8IBN

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.