autohelix 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. autohelix-0.0.1/.gitignore +30 -0
  2. autohelix-0.0.1/LICENSE +176 -0
  3. autohelix-0.0.1/NOTICE +2 -0
  4. autohelix-0.0.1/PKG-INFO +345 -0
  5. autohelix-0.0.1/README.md +317 -0
  6. autohelix-0.0.1/pyproject.toml +71 -0
  7. autohelix-0.0.1/src/autohelix/__init__.py +11 -0
  8. autohelix-0.0.1/src/autohelix/agents/__init__.py +153 -0
  9. autohelix-0.0.1/src/autohelix/agents/claudecode.py +303 -0
  10. autohelix-0.0.1/src/autohelix/agents/codex.py +207 -0
  11. autohelix-0.0.1/src/autohelix/agents/mock.py +116 -0
  12. autohelix-0.0.1/src/autohelix/agents/opencode.py +144 -0
  13. autohelix-0.0.1/src/autohelix/agents/runner.py +146 -0
  14. autohelix-0.0.1/src/autohelix/bin/check_notes.sh +85 -0
  15. autohelix-0.0.1/src/autohelix/bin/claude_hook_time_left.sh +52 -0
  16. autohelix-0.0.1/src/autohelix/bin/opencode_timer_pertool.js +70 -0
  17. autohelix-0.0.1/src/autohelix/bin/time_left.sh +50 -0
  18. autohelix-0.0.1/src/autohelix/checks.py +354 -0
  19. autohelix-0.0.1/src/autohelix/cli.py +707 -0
  20. autohelix-0.0.1/src/autohelix/config.py +448 -0
  21. autohelix-0.0.1/src/autohelix/dashboard.py +532 -0
  22. autohelix-0.0.1/src/autohelix/display.py +224 -0
  23. autohelix-0.0.1/src/autohelix/formatting.py +32 -0
  24. autohelix-0.0.1/src/autohelix/harness.py +1240 -0
  25. autohelix-0.0.1/src/autohelix/history.py +173 -0
  26. autohelix-0.0.1/src/autohelix/iteration_time.py +91 -0
  27. autohelix-0.0.1/src/autohelix/parallel/__init__.py +14 -0
  28. autohelix-0.0.1/src/autohelix/parallel/core.py +340 -0
  29. autohelix-0.0.1/src/autohelix/parallel/display.py +134 -0
  30. autohelix-0.0.1/src/autohelix/prompt_template.py +128 -0
  31. autohelix-0.0.1/src/autohelix/run_log.py +40 -0
  32. autohelix-0.0.1/src/autohelix/sandbox.py +467 -0
  33. autohelix-0.0.1/src/autohelix/state.py +153 -0
  34. autohelix-0.0.1/src/autohelix/templates/__init__.py +2 -0
  35. autohelix-0.0.1/src/autohelix/templates/config_template.yaml +41 -0
  36. autohelix-0.0.1/src/autohelix/templates/default_prompt.md +63 -0
@@ -0,0 +1,30 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .DS_Store
9
+
10
+ # AutoHelix runtime state
11
+ .autohelix/
12
+
13
+ # Benchmark data and plots (regenerate with: python scripts/bench/collect_results.py)
14
+ bench_results/
15
+
16
+ # Benchmark infrastructure (local-only launch/setup scripts)
17
+ scripts/bench/
18
+
19
+ # Scratch/manual real-agent test scripts (kept local, not shipped)
20
+ scripts/test_*.sh
21
+
22
+ # Local working notes (updates log, blog drafts, design docs, comparisons, archive)
23
+ notes/
24
+
25
+ # Local/personal
26
+ env.sh
27
+ TODO.md
28
+
29
+ # Progress-plot generator (kept local; the rendered progress.png is committed)
30
+ examples/posttrain-gsm8k/progress/plot_progress.py
@@ -0,0 +1,176 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
autohelix-0.0.1/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ AutoHelix
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -0,0 +1,345 @@
1
+ Metadata-Version: 2.4
2
+ Name: autohelix
3
+ Version: 0.0.1
4
+ Summary: Agent-powered iterative optimization: put an AI agent in a verified improvement loop
5
+ Project-URL: Homepage, https://github.com/awslabs/AutoHelix
6
+ Project-URL: Repository, https://github.com/awslabs/AutoHelix
7
+ Project-URL: Issues, https://github.com/awslabs/AutoHelix/issues
8
+ Author: Matthew Trager, Elman Mansimov, Yi Zhang, Wei Xia, Stefano Soatto
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: agent,ai,claude,code-generation,llm,optimization
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: click>=8.0
18
+ Requires-Dist: jinja2>=3.1
19
+ Requires-Dist: pyyaml>=6.0
20
+ Requires-Dist: rich>=13.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=7.0; extra == 'dev'
23
+ Provides-Extra: examples
24
+ Requires-Dist: numpy>=1.20; extra == 'examples'
25
+ Requires-Dist: scikit-learn>=1.4; extra == 'examples'
26
+ Requires-Dist: scipy>=1.10; extra == 'examples'
27
+ Description-Content-Type: text/markdown
28
+
29
+ <p align="center">
30
+ <picture>
31
+ <source media="(prefers-color-scheme: dark)" srcset="assets/autohelix-dark.svg">
32
+ <source media="(prefers-color-scheme: light)" srcset="assets/autohelix-light.svg">
33
+ <img alt="AutoHelix" src="assets/autohelix-light.svg" width="420">
34
+ </picture>
35
+ </p>
36
+
37
+ <p align="center"><b>Put an AI agent in a verified improvement loop.</b></p>
38
+
39
+ <p align="center">
40
+ Set <b>constraints</b> and <b>metrics</b>; the agent proposes changes in a loop. <br>
41
+ Only changes that pass checks get merged. Improvements compound across iterations.
42
+ </p>
43
+
44
+ <p align="center">
45
+ works with <b>Claude Code · Codex · OpenCode</b>
46
+ </p>
47
+
48
+ <p align="center">
49
+ <img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-blue?style=flat-square">
50
+ <img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-green?style=flat-square">
51
+ </p>
52
+
53
+ <p align="center">
54
+ <a href="#how-it-works">How it works</a> ·
55
+ <a href="#quick-start">Quick start</a> ·
56
+ <a href="#examples">Examples</a> ·
57
+ <a href="#configuration">Configuration</a> ·
58
+ <a href="#other-features">Other features</a> ·
59
+ <a href="#faq">FAQ</a>
60
+ </p>
61
+
62
+ <!-- ───────────────────────── DEMO ───────────────────────── -->
63
+ <table align="center"><tr>
64
+ <td><img alt="autohelix run — optimizing the sorting example" src="assets/demo.gif" height="320"></td>
65
+ <td><img alt="Example autohelix.yaml configuration for the sorting task" src="assets/config-simple.svg" height="320"></td>
66
+ </tr></table>
67
+
68
+ ---
69
+
70
+ AutoHelix is a lightweight harness that lets you point an agent at a goal and leave it
71
+ looping unattended. It provides the isolation, validation, scope, and budget control to
72
+ make that safe, and it's general enough for any measurable goal, from optimizing
73
+ code to training models.
74
+
75
+ Looping an agent can be far more effective than a single prompt, because later iterations
76
+ fix and build on what came before, and because it gives you a knob for controlling how much
77
+ effort (time or cost) to put toward the goal rather than letting the agent decide when it's
78
+ done. AutoHelix makes this pattern easy to run and customize, so you can let the agent
79
+ climb for as long as you want.
80
+
81
+ ## How it works
82
+
83
+ <p align="center">
84
+ <img alt="AutoHelix iteration loop: worktree → agent → checks → merge or discard → repeat" src="assets/how-it-works.svg" width="760">
85
+ </p>
86
+
87
+ You define a **goal**, the **constraints** that must hold, and the **metrics**
88
+ to track. The agent proposes changes and the harness decides if they land.
89
+
90
+ Core features:
91
+
92
+ - **Isolation.** Each iteration runs in a fresh git worktree. A rejected attempt's code is cleanly discarded.
93
+ - **Scope enforcement.** Only files marked `editable` can be changed; everything else is frozen.
94
+ - **Constraints gate changes.** Tests, type-checks, or any command that must exit 0. Break a constraint and the iteration is discarded.
95
+ - **Metrics track progress.** Metrics are captured and shown to the next iteration. Optionally gate on them to reject regressions. Logs and artifacts can be saved too.
96
+ - **Persistent memory.** Each iteration is a fresh session, but the agent reads and writes notes that survive across all iterations, including rejected ones.
97
+ - **Budget control.** Cap the run by iterations, time, or cost.
98
+
99
+ ## Quick start
100
+
101
+ Install from source:
102
+
103
+ ```bash
104
+ git clone https://github.com/awslabs/AutoHelix.git
105
+ cd AutoHelix
106
+ python -m venv .venv && source .venv/bin/activate
107
+ pip install -e .
108
+ ```
109
+
110
+ AutoHelix uses Claude Code by default (looks for `claude` on your `PATH`). Codex and
111
+ OpenCode are also supported — see [agent setup](docs/getting-started.md#agent-setup).
112
+
113
+ ```bash
114
+ cd my-project
115
+ autohelix init # initialize config and state
116
+ autohelix run # start the loop
117
+ ```
118
+
119
+ `init` creates a commented `autohelix.yaml` to fill in — see the configuration section
120
+ below. Other commands are described in the [CLI reference](docs/cli.md).
121
+
122
+ ## Examples
123
+
124
+ The [`examples/`](examples/) directory has ready-to-run tasks across different domains, from
125
+ a 2-minute [sorting function](examples/sorting/) example to algorithm optimization and model training. To list what's available:
126
+
127
+ ```bash
128
+ python examples/setup_example.py --list
129
+ ```
130
+
131
+ **Code optimization.** [AlgoTune](https://github.com/oripress/AlgoTune) is a benchmark for optimizing widely used
132
+ algorithms in math, physics, and CS. AutoHelix can scaffold any of them via
133
+ [`examples/algotune`](examples/algotune) (we measure speedup with our own eval setup, not identical
134
+ to AlgoTune's official harness). The plot below shows a run with Claude Opus 4.8: across 154 tasks,
135
+ the median speedup climbs each iteration, reaching ~8.5× by iteration 5.
136
+
137
+ <table align="center"><tr>
138
+ <td><img src="assets/progression_algotune.png" width="400"></td>
139
+ </tr></table>
140
+
141
+ **Model training.** The same loop works when each iteration is a training run rather than a
142
+ code edit: the agent writes the training code and trains a model, and AutoHelix scores the
143
+ result with a frozen eval the agent can't modify. In
144
+ **[`examples/posttrain`](examples/posttrain)**
145
+ (inspired by [PostTrainBench](https://posttrainbench.com/)), the agent is asked to post-train
146
+ `Qwen3-4B-Base` on GSM8K. Given an open-ended goal (no method prescribed), the agent
147
+ worked its way up from supervised fine-tuning through rejection sampling to reinforcement
148
+ learning (GRPO) — reaching **93%** accuracy over 8 iterations on one H200. See the
149
+ **[ML Experiments Guide](docs/ml-experiments.md)** for setup tips.
150
+
151
+ <p align="center">
152
+ <img alt="GSM8K accuracy climbing from 41% to 93% over AutoHelix iterations"
153
+ src="assets/progression_posttrain_gsm8k.png" width="640">
154
+ </p>
155
+
156
+ **In the wild.** Beyond the bundled examples, we've used AutoHelix on real projects. In
157
+ [Hybrid Model Factory](https://github.com/awslabs/hybrid-model-factory) — an open-source
158
+ toolkit for training hybrid architectures (Attention + SSMs) from our team — the agent
159
+ autonomously developed a faster sequence-parallelism implementation. Over multiple runs
160
+ (with some algorithmic hints in the goal), it arrived at a state-passing approach that
161
+ propagates recurrent state between GPUs instead of redistributing the full sequence,
162
+ reaching **~5× faster per layer** and **1.6× faster end-to-end training** at 128K
163
+ sequence length on a 27B model.
164
+
165
+ <!-- ───────────────────── CONFIGURATION ───────────────────── -->
166
+
167
+ ## Configuration
168
+
169
+ A run is defined by a single `autohelix.yaml`. Every field is documented in
170
+ [docs/config.md](docs/config.md).
171
+
172
+ <p align="center">
173
+ <img alt="Annotated autohelix.yaml configuration" src="assets/config-annotated.svg" width="880">
174
+ </p>
175
+
176
+ **Project layout**
177
+
178
+ ```
179
+ my-project/
180
+ ├── autohelix.yaml # your config
181
+ └── .autohelix/ # runtime state (gitignored)
182
+ ├── prompt.md # the prompt the agent gets each iteration (editable)
183
+ ├── history.jsonl # per-iteration results
184
+ ├── notes/ # agent's persistent notes (the only agent-owned state)
185
+ ├── observations/ # per-iteration captured metrics output and artifacts
186
+ ├── reviews/ # reviewer feedback per iteration (if a reviewer is set)
187
+ ├── hints.md # messages from `autohelix hint`
188
+ ├── logs/ # per-iteration prompts and agent output
189
+ ├── output/ # dashboard.html and reports
190
+ └── worktrees/ # temp iteration dirs (recreated each time)
191
+ ```
192
+
193
+ <!-- ───────────────────── OTHER FEATURES ───────────────────── -->
194
+
195
+ ## Other features
196
+
197
+ <details>
198
+ <summary><b>Report</b></summary>
199
+
200
+ `autohelix report` runs a one-shot agent over the run's history, notes, and git log and
201
+ writes a summary to `.autohelix/output/report.md`. See [CLI → report](docs/cli.md#autohelix-report).
202
+
203
+ </details>
204
+
205
+ <details>
206
+ <summary><b>Reviewer</b></summary>
207
+
208
+ Beyond quantitative metrics, you can add a `reviewer:` block with a custom prompt to get qualitative feedback from an LLM. Each review is archived to `.autohelix/reviews/iter-N.md`,
209
+ and the latest one guides the next iteration. See [Concepts → Reviewer](docs/concepts.md#reviewer).
210
+
211
+ </details>
212
+
213
+ <details>
214
+ <summary><b>Dashboard</b></summary>
215
+
216
+ After every iteration, AutoHelix regenerates a self-contained HTML dashboard at
217
+ `.autohelix/output/dashboard.html`. You can open it in a browser
218
+ to watch metrics, outcomes, and per-iteration changes as the run progresses. See
219
+ [Concepts → Dashboard](docs/concepts.md#dashboard).
220
+
221
+ </details>
222
+
223
+ <details>
224
+ <summary><b>Time limits</b></summary>
225
+
226
+ Two time controls:
227
+
228
+ - **`budget.time`** — caps *total* wall-clock for the whole run. Checked before each
229
+ iteration starts; doesn't interrupt one in progress.
230
+ - **`budget.iteration_time`** — per-iteration deadline. A hook injects a countdown into
231
+ the agent's context after each tool call, so it can wrap up and write notes before the
232
+ deadline hits.
233
+
234
+ See [Config → budget](docs/config.md).
235
+
236
+ </details>
237
+
238
+ <details>
239
+ <summary><b>Docker sandbox</b></summary>
240
+
241
+ Optionally run AutoHelix inside Docker for filesystem isolation. The agent can't reach
242
+ your home directory, SSH keys, or other projects. Build the image with `docker/build.sh`
243
+ and run via `docker/run.sh`. See [Docker sandbox](docs/docker.md).
244
+
245
+ </details>
246
+
247
+ <details>
248
+ <summary><b>Hints</b></summary>
249
+
250
+ `autohelix hint "..."` (run in a second terminal) drops a note the running agent picks up
251
+ at the start of its next iteration. Useful to steer a run without stopping it. See
252
+ [CLI → hint](docs/cli.md#autohelix-hint).
253
+
254
+ </details>
255
+
256
+ <details>
257
+ <summary><b>Parallel runs</b> (alpha)</summary>
258
+
259
+ `autohelix parallel` executes multiple AutoHelix runs concurrently, each with its own config and
260
+ worktree, sharing notes at a configurable frequency so each agent can see what the others
261
+ have tried. See [CLI → parallel](docs/cli.md#autohelix-parallel-alpha).
262
+
263
+ </details>
264
+
265
+ <!-- ───────────────────────── FAQ ───────────────────────── -->
266
+
267
+ ## FAQ
268
+
269
+ <details>
270
+ <summary><b>How does AutoHelix differ from other "agent in a loop" tools?</b></summary>
271
+
272
+ Running AI agents iteratively is becoming a popular strategy — a kind of test-time scaling
273
+ for agents, where more iterations buy more quality. Tools like
274
+ [autoresearch](https://github.com/karpathy/autoresearch),
275
+ [Ralph](https://github.com/snarktank/ralph), and Claude Code's
276
+ `/goal` and `/loop` commands each implement variations of this pattern.
277
+
278
+ Compared to other tools, AutoHelix adds a minimal amount of structure to ensure that long-running autonomous loops don't go off track, so you can let your agent work while keeping control over the direction.
279
+
280
+
281
+ | | AutoHelix | autoresearch | Ralph | `/goal` | `/loop` |
282
+ |--|--|--|--|--|--|
283
+ | Goal-directed | ✓ any metric(s) | ✓ val loss | ✓ task list | ✓ boolean | ✗ |
284
+ | Validation gates | ✓ | ~ self-checks | ✗ | ✗ | ✗ |
285
+ | Isolation on failure | ✓ worktree | ~ self-resets | ✗ | ✗ | ✗ |
286
+ | Fresh context each iteration | ✓ | ✗ | ✓ | ✗ | ✗ |
287
+ | Memory across iterations | ✓ notes, metrics, artifacts | session | progress file | session | session |
288
+ | Scope enforcement | ✓ | ~ by instruction | ✗ | ✗ | ✗ |
289
+ | Budget control | ✓ iters, time, cost | ✗ | iters only | iters only | ✗ |
290
+ | Time-aware agent | ✓ | ✗ | ✗ | ✗ | ✗ |
291
+ | Parallel exploration | ✓ | ✗ | ✗ | ✗ | ✗ |
292
+ | Agent-agnostic | ✓ | ✓ | ✓ | ✗ | ✗ |
293
+
294
+
295
+ </details>
296
+
297
+ <details>
298
+ <summary><b>What about reward hacking?</b></summary>
299
+
300
+ The agent optimizes what you measure: if your benchmark has loopholes, the agent may find
301
+ and exploit them, and more iterations apply more pressure to do so. Autonomous loops shift
302
+ the burden from "write perfect code" to "write strong checks."
303
+
304
+ You can look out for gaming by reading `autohelix report`, the agent's notes, or a
305
+ [reviewer](docs/concepts.md#reviewer)'s feedback. Then close the loophole with a new
306
+ constraint and re-run.
307
+
308
+ </details>
309
+
310
+
311
+ <details>
312
+ <summary><b>Is it safe to run unattended?</b></summary>
313
+
314
+ AutoHelix isolates the agent at two levels:
315
+
316
+ 1. **Git worktree** (default) — each iteration runs in a separate working copy.
317
+ Rejected iterations are deleted entirely; accepted ones merge back cleanly.
318
+ 2. **Docker sandbox** (optional) — filesystem isolation: the agent can't access your
319
+ home directory, SSH keys, or other projects. (Network is not isolated, since the
320
+ agent needs it to reach the model API.)
321
+
322
+ Worktree isolation protects your codebase from bad iterations, but it is **not a
323
+ security sandbox** — the agent still runs on your host and could in principle access
324
+ the filesystem or network. For focused optimization tasks (the typical use case), the
325
+ agent works toward a narrow goal, not exploring adversarially, so running without a
326
+ sandbox is usually a reasonable tradeoff. For stronger guarantees, or on sensitive
327
+ machines, use the Docker mode.
328
+
329
+ </details>
330
+
331
+ ## Citation
332
+
333
+ ```bibtex
334
+ @software{autohelix2026,
335
+ title = {AutoHelix: Verified Iteration for AI Agents},
336
+ author = {Trager, Matthew and Mansimov, Elman and Zhang, Yi and Xia, Wei and Soatto, Stefano},
337
+ year = {2026},
338
+ version = {0.1.0},
339
+ url = {https://github.com/awslabs/AutoHelix}
340
+ }
341
+ ```
342
+
343
+ ## License
344
+
345
+ AutoHelix is licensed under the [Apache License 2.0](LICENSE).