Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
35d3b2c
Build canonical evaluation and optimization kernel
varunursekar Jul 15, 2026
631f1c2
Add generic optimization runtime and coding-agent gateway
varunursekar Jul 15, 2026
1279b78
Migrate coding agents to canonical runtime
varunursekar Jul 15, 2026
e27988e
Add canonical program optimization CLI
varunursekar Jul 15, 2026
6365e8a
Extract Python task protocol from legacy core
varunursekar Jul 15, 2026
f4da52b
Enforce external Python evaluation boundaries
varunursekar Jul 15, 2026
8cb3fba
Migrate benchmarking to canonical runtime
varunursekar Jul 15, 2026
997ae68
Add Harbor evaluation backend
varunursekar Jul 15, 2026
44e8192
Add canonical Harbor sidecar and verifier
varunursekar Jul 15, 2026
73d983d
Expose Harbor sidecar HTTP and CLI surfaces
varunursekar Jul 15, 2026
818e3cc
Compile canonical Harbor optimization tasks
varunursekar Jul 15, 2026
50f95e4
Exclude generated Harbor compiler caches
varunursekar Jul 15, 2026
95cd51d
Refresh benchmarking lock for Harbor extra
varunursekar Jul 15, 2026
bfaea83
Remove paper-era implementation from v0.5
varunursekar Jul 15, 2026
f38dfba
Harden generic program optimization workflow
varunursekar Jul 15, 2026
b0ae83d
Resolve concurrency and persistence review findings
varunursekar Jul 15, 2026
68f58a6
Support isolated sandbox execution
varunursekar Jul 15, 2026
34982ce
Separate candidate and evaluation limits
varunursekar Jul 15, 2026
5dd4f26
Harden evaluation persistence and process cleanup
varunursekar Jul 15, 2026
9c95d96
Support nested Harbor evaluation on Modal
varunursekar Jul 15, 2026
4b3f2c7
Document nested Modal Harbor workflow
varunursekar Jul 15, 2026
2f48d80
Add durable candidate repositories
varunursekar Jul 16, 2026
e5b96d3
Restore evaluation retries and reject ignored controls
varunursekar Jul 16, 2026
b61e7a1
Expose authorized context to optimization agents
varunursekar Jul 16, 2026
fed6a51
Harden agent and Harbor end-to-end execution
varunursekar Jul 16, 2026
e9b45f6
Implement multi-evaluation optimization protocol
varunursekar Jul 17, 2026
3db69df
Restore failed-case evaluation semantics
varunursekar Jul 17, 2026
aa7744a
Pass Harbor objectives to coding agents
varunursekar Jul 17, 2026
5255f5d
Add circle packing optimization benchmark
varunursekar Jul 17, 2026
272c772
Add self-contained experiment reports
varunursekar Jul 17, 2026
aef04eb
Add Harbor-native GAIA optimization benchmark
varunursekar Jul 17, 2026
55609a0
Rename benchmark suite to program-opt-bench
varunursekar Jul 17, 2026
5df8360
Add durable Harbor optimization workflows
varunursekar Jul 17, 2026
1e3d93c
Drain in-flight evaluations before Harbor finalization
varunursekar Jul 17, 2026
e467616
Add durable Harbor evaluation jobs
varunursekar Jul 17, 2026
df700a7
Allow GPT-5.5 for GAIA optimization
varunursekar Jul 17, 2026
3a3031d
harbor: lock the admin token to the trusted verifier (0o400 file, 0o7…
varunursekar Jul 17, 2026
9533e99
harbor: offload verifier finalize's atomic write to a thread
varunursekar Jul 17, 2026
96ffbb4
harbor: ${...} run-time parameters in build YAML (no rebuild to vary …
varunursekar Jul 18, 2026
4918ea3
harbor: document the soft fixed-target guarantee at the gateway allow…
varunursekar Jul 18, 2026
bb9930a
native: remove token-limit hook; bump openai-agents 0.13.6 -> 0.18.3
varunursekar Jul 18, 2026
87c3ccb
native: rebuild VeroAgent on SandboxAgent; drop run_agent_with_json_s…
varunursekar Jul 18, 2026
5e149f7
native: delete replaced tools + filesystem ACL; strip ClaudeCodeAgent…
varunursekar Jul 18, 2026
98d7303
native: drive VeroAgent via the OpenAI Responses API (SandboxAgent ne…
varunursekar Jul 18, 2026
616e8db
native: single model-agnostic path — function tools over a sandbox se…
varunursekar Jul 18, 2026
219a5fb
optimization: GenerationBackend seam over candidate production
varunursekar Jul 18, 2026
5bd572f
optimization: EvolutionaryStrategy (population-based, N offspring/round)
varunursekar Jul 18, 2026
0a4a95c
runtime: stream agent activity to the event bus (observability)
varunursekar Jul 18, 2026
e78f8b8
cleanup: remove vestigial classes/functions orphaned by the refactor
varunursekar Jul 18, 2026
975caa8
chore: gitignore harbor jobs/ output directory
varunursekar Jul 18, 2026
837c855
chore: move matmul-{kernel,eval} examples to vero-tasks
varunursekar Jul 18, 2026
1a642e3
examples: add a Harbor outer-loop / simple inner-loop example
varunursekar Jul 18, 2026
41e0eb7
docs: rewrite the agent setup guide for the current architecture
varunursekar Jul 18, 2026
473d5b8
docs: refresh README for the modernized native runner
varunursekar Jul 18, 2026
629063c
docs: frame VeRO as optimizing programs, text, AND agents
varunursekar Jul 18, 2026
69ece41
docs: add badges, mermaid figures, highlights, and a callout to the R…
varunursekar Jul 18, 2026
36c190e
docs: stop advertising `pip install scale-vero` (squatted PyPI name)
varunursekar Jul 18, 2026
7719ec0
chore: add gitignored runs/ dir for local GAIA/harbor run outputs
varunursekar Jul 18, 2026
12a99b9
Add Claude optimizer support + injectable insights bundle to Harbor
varunursekar Jul 19, 2026
fe92b38
README: lead with Harbor and break up the text walls
varunursekar Jul 19, 2026
88cc42f
README: break up the remaining text walls
varunursekar Jul 19, 2026
0932d2d
Unblock tau3 (and other env-declaring tasks) via non-interactive sub-…
varunursekar Jul 19, 2026
6968e7a
Add DarwinGodelStrategy: open-ended archive evolution
varunursekar Jul 19, 2026
282f5c8
tau3: collapse to a single host-side agent; delete runner.py + cred f…
varunursekar Jul 19, 2026
8bd5655
harbor: add disclose_budget toggle for budget-blind optimization
varunursekar Jul 19, 2026
3c106b1
harbor: route task-owned eval LLM services to upstream (fix tau3 user…
varunursekar Jul 19, 2026
f53ce9b
harbor: give the trusted eval-sidecar the upstream for task_services_…
varunursekar Jul 19, 2026
2cdd60e
program-opt-bench: add ALE-Bench (program optimization) task
varunursekar Jul 19, 2026
d285d63
program-opt-bench: add OfficeQA (grounded-reasoning agent benchmark)
varunursekar Jul 19, 2026
2ff7e95
Reserve a finalization inference budget so re-scoring cannot be starved
varunursekar Jul 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Python-generated files
__pycache__/
.pytest_cache/
*.py[oc]
build/
dist/
Expand All @@ -9,3 +10,8 @@ wheels/
# Virtual environments
.venv
.env*

# Run secrets loaded via `vero harbor run --env-file` (keep only *.example)
secrets.env
*.secrets.env
!*.example
145 changes: 54 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,85 @@
# VeRO: Versioning Rewards and Observations
# VeRO: a harness for agents to optimize programs, text, and agents

[![Paper](https://img.shields.io/badge/arXiv-2602.22480-b31b1b.svg)](https://arxiv.org/abs/2602.22480)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

VeRO is an evaluation harness for using coding agents to optimize LLM-based agents and workflows. It treats agent code as a versioned artifact — making changes, evaluating results, and hill-climbing toward better performance using git version control.

> **Paper**: [VeRO: An Evaluation Harness for Agents to Optimize Agents](https://arxiv.org/abs/2602.22480)

## Repository Structure

```
vero/
├── vero/ # Core library (scale-vero)
├── vero-agents/ # Agent implementations (benchmarking targets)
├── vero-benchmarking/ # Benchmarking scripts and analysis
└── LICENSE
```

### [vero/](vero/)

The core optimization framework. Provides:

- **Policy** — orchestrates the optimization loop (agent + evaluator + git)
- **Agents** — VeroAgent (OpenAI Agents SDK) and ClaudeCodeAgent (Claude Agent SDK)
- **Evaluator** — runs task evaluations in isolated subprocess environments
- **Tools** — MCP-based tools for agents (bash, file I/O, experiment runner, dataset viewer, etc.)
- **Traces** — session analysis and LLM-based trace interpretation

```bash
cd vero && uv sync --extra optimize
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)

VeRO gives a coding agent something to edit, an evaluation boundary, and durable
memory of every candidate it tried. The target is anything you can put under Git
and score — a **program** (a single function up to a whole codebase), **text**
(a prompt, spec, or config), or an **agent** (its scaffold, tools, and prompts).
Agents are programs, but not everyone reads "program" that way, so VeRO names
them explicitly: it was introduced to optimize agents and generalizes the same
version / evaluate / select loop to any Git-versioned artifact.

```mermaid
flowchart LR
S["Strategy<br/>proposes ideas"] --> P["Candidate producers<br/>edit isolated workspaces"]
P --> E["Evaluation backends<br/>score versioned reports"]
E --> Sel["Selection keeps the<br/>best feasible candidate"]
Sel -->|"next round"| S
```

See [vero/README.md](vero/README.md) for full documentation.

### [vero-agents/](vero-agents/)
The target and evaluator do not need to be Python. External evaluators and
candidate producers connect through command protocols; Python benchmarks can
use the optional, optimizer-independent `scale-vero-tasks` package.

Agent implementations used as optimization targets:
Targets may live locally or in an isolated sandbox. VeRO keeps optimization
state and experiment tracking on the host while running Git worktrees, producer
commands, builds, and evaluation commands in the target sandbox. The core guide
includes a no-bind-mount `DockerSandbox` example.

| Agent | Description |
|-------|-------------|
| **generic-agent** | General-purpose agent for MATH, GPQA, GAIA, GSM8K, etc. |
| **web_search_agent** | Web search agent for SimpleQA, Facts Search |
| **KIRA** | Terminal task agent for Terminal Bench 2.0 |
| **tau-bench** | Customer service tool-use agent |
| **pharma_summarizer** | Document summarization agent |
## Repository layout

See [vero-agents/README.md](vero-agents/README.md) for details.
| Directory | Purpose |
| --- | --- |
| [`vero/`](vero/) | The `scale-vero` optimization kernel, runtime, CLI, and coding-agent adapters |
| [`vero-tasks/`](vero-tasks/) | Narrow Python task types and schema-v1 evaluation runner |
| [`program-opt-bench/`](program-opt-bench/) | Harbor-native target programs and end-to-end optimization benchmarks |

### [vero-benchmarking/](vero-benchmarking/)
Start with the [generic C matrix-multiplication quickstart](vero/examples/c-matmul/),
try the [26-circle packing benchmark](vero/examples/circle-packing/), or read the
[core guide](vero/README.md). The C example demonstrates the language-neutral
command protocol without model credentials. Circle packing is a substantive
coding-agent benchmark with exact geometry checks and inspectable search
artifacts.

Scripts and infrastructure for running optimization experiments:
For a full agent-optimization example, the [GAIA benchmark](program-opt-bench/gaia/)
pairs a tool-using GPT-5.4 mini target with Harbor's canonical GAIA verifier and
an immutable 20% / 40% / 40% development, validation, and test split.

```bash
cd vero-benchmarking && uv sync --all-extras

# Run an optimization experiment
uv run python scripts/run_benchmark.py --scaffold claude-code-vmf --model sonnet --task math

# Build datasets
./scripts/build_datasets.sh
cd vero
uv sync --all-extras
uv run vero --help
```

See [vero-benchmarking/README.md](vero-benchmarking/README.md) for full documentation.

## Quick Start
## Paper reproduction

### Prerequisites
VeRO was introduced in [*VeRO: A Harness for Agents to Optimize
Agents*](https://arxiv.org/abs/2602.22480), accepted at ICML 2026. The current
library generalizes that version/evaluate/select loop from agents to programs.

- Python 3.11+
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
- Git
- Access to an LLM provider (via LiteLLM, OpenAI, Anthropic, etc.)

### Install
The exact paper implementation is frozen separately from the v0.5 redesign:

```bash
git clone <repo-url> && cd vero

# Install core library
cd vero && uv sync --extra optimize

# Install benchmarking tools
cd ../vero-benchmarking && uv sync --all-extras
git checkout paper-v1
```

### Run Your First Optimization

```python
from agents import Agent as OAIAgent
from vero.policy import Policy
from vero.agents.vero import VeroAgent

policy = Policy(
project_path="/path/to/my-agent",
dataset="/path/to/my-dataset",
agent=VeroAgent(
oai_agent=OAIAgent(name="VeroAgent", model="anthropic/claude-sonnet-4-5-20250929"),
),
task="main",
train_budget=10,
max_turns=200,
)

best = await policy.run()
print(f"Best commit: {best.commit}, score: {best.score}")
```
Use the `paper/v1` branch or `paper-v1` tag for reproduction. Development of
the generic program optimizer continues on the `v0.5` branch. The frozen ref
also preserves the paper-era `vero-agents` and `vero-benchmarking` directories;
their Harbor-native replacement on `v0.5` is `program-opt-bench`.

## Citation

```bibtex
@article{ursekar2026vero,
title={VeRO: An Evaluation Harness for Agents to Optimize Agents},
title={VeRO: A Harness for Agents to Optimize Agents},
author={Ursekar, Varun and Shanker, Apaar and Chatrath, Veronica and Xue, Yuan (Emily) and Denton, Sam},
journal={arXiv preprint arXiv:2602.22480},
year={2026}
}
```

## License

[MIT](LICENSE)
VeRO is licensed under the [MIT License](LICENSE).
29 changes: 29 additions & 0 deletions program-opt-bench/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Program optimization benchmarks

`program-opt-bench` contains end-to-end benchmarks for improving programs with
VeRO. Each leaf directory pairs one editable target program with one immutable
Harbor dataset and compiles them into an outer Harbor optimization task.

The benchmark definitions intentionally keep three boundaries visible:

- `target/` is the program the optimization agent may edit.
- `partitions/` pins the cases and the development/validation/test split.
- `build.yaml` is trusted configuration: model, evaluator, access policy,
budgets, and final scoring.

In each benchmark, the complete development tasks and attachments are mounted
read-only for the optimization agent. Development evaluations expose per-case
results and complete Harbor trial records, including exact failures and
target-agent logs. Validation remains aggregate-only, and
test is reachable only by the trusted final verifier.

The paper-era benchmark stack remains available on the `paper/v1` branch and
the `paper-v1` tag. New benchmarks should use this Harbor-native layout.

## Benchmarks

| Benchmark | Editable target | Dataset | Split |
| --- | --- | --- | --- |
| [GAIA baseline](gaia/baseline/) | Tool-using Responses API agent | Harbor `gaia/gaia` | 20% / 40% / 40% |
| [SWE-Atlas-QnA baseline](swe-atlas-qna/baseline/) | Codebase investigation agent | Harbor `scale-ai/swe-atlas-qna` | 20% / 40% / 40% |
| [tau3 baseline](tau3/baseline/) | MCP customer-service agent | Harbor `sierra-research/tau3-bench` | 20% / 40% / 40% |
2 changes: 2 additions & 0 deletions program-opt-bench/ale-bench/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
environment/vero/
runs/
19 changes: 19 additions & 0 deletions program-opt-bench/ale-bench/environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Main service: the optimizer workbench a coding agent works in.
# Holds the editable target (solution.cpp) plus the VeRO CLI so the agent can
# call `vero harbor eval` / `vero harbor status` against the trusted sidecar.
FROM ghcr.io/astral-sh/uv:python3.12-bookworm

RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# VeRO is not on public PyPI; vendor it into the build context first
# (`cp -r <repo>/vero environment/vero`) then install it.
COPY vero /opt/vero
RUN uv pip install --system "/opt/vero[harbor]"

COPY agent-seed /opt/agent-seed
COPY main/seed.sh /opt/seed.sh
RUN chmod +x /opt/seed.sh && useradd -m -u 1001 agent

WORKDIR /work/agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <bits/stdc++.h>
int main(){
std::ios::sync_with_stdio(false);
std::string line;
while (std::getline(std::cin, line)) {}
std::cout << "\n";
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <bits/stdc++.h>
int main(){
std::ios::sync_with_stdio(false);
std::string line;
while (std::getline(std::cin, line)) {}
std::cout << "\n";
return 0;
}
60 changes: 60 additions & 0 deletions program-opt-bench/ale-bench/environment/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Harbor merges this after its generated main-service configuration.
services:
main:
command: ["/opt/seed.sh"]
environment:
VERO_EVAL_URL: "http://eval-sidecar:8000"
OPENAI_API_KEY: "${OPENAI_API_KEY:?OPENAI_API_KEY must be set}"
OPENAI_BASE_URL: "${OPENAI_BASE_URL:?OPENAI_BASE_URL must be set}"
volumes:
- agent_repo:/work/agent
- token_state:/state/token:ro
depends_on:
eval-sidecar:
condition: service_healthy

eval-sidecar:
build:
context: .
dockerfile: sidecar/Dockerfile
# Runs its own Docker daemon (DinD) so ALE-Bench's sibling judge/tool
# containers share this container's filesystem — required for their bind
# mounts to resolve. Needs privileged + host cgroup ns (nested cgroup v2
# otherwise fails: "cannot enter cgroupv2 ... it is in threaded mode").
privileged: true
cgroup: host
command:
- "vero"
- "harbor"
- "serve"
- "--factory"
- "ale_factory:build"
- "--config"
- "/opt/serve.json"
- "--admin-token"
- "/state/token/admin.token"
environment:
# ALE-Bench talks to the in-container dockerd started by the entrypoint.
DOCKER_HOST: "unix:///var/run/docker.sock"
ALE_BENCH_DATA: "/state/ale-data"
volumes:
- agent_repo:/work/agent:ro
- admin_state:/state/admin
- token_state:/state/token
- ale_data:/state/ale-data
# DinD storage (avoids overlay-on-overlay issues for the inner daemon).
- docker_storage:/var/lib/docker
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 5s
timeout: 10s
# The entrypoint starts dockerd + pulls the ~4GB judge image before serving.
retries: 40
start_period: 180s

volumes:
agent_repo:
admin_state:
token_state:
ale_data:
docker_storage:
12 changes: 12 additions & 0 deletions program-opt-bench/ale-bench/environment/main/seed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -eu
if [ ! -d /work/agent/.git ]; then
cp -a /opt/agent-seed/. /work/agent/
cd /work/agent
git init -q
git add -A
git -c user.email=seed@vero.test -c user.name=seed commit -qm "baseline"
fi
find /work/agent -exec chown agent:agent {} +
git config --system --add safe.directory /work/agent
exec sleep infinity
42 changes: 42 additions & 0 deletions program-opt-bench/ale-bench/environment/sidecar/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Trusted evaluation sidecar. It owns scoring, budget, disclosure, and final
# selection. The inner loop is a plain CommandBackend (harness/score.py), which
# calls ALE-Bench's deterministic judge. ALE-Bench spawns the C++ judge + its
# Rust-tool builder as sibling Docker containers with bind mounts, so this
# container runs its OWN Docker daemon (DinD) — the sibling containers must share
# this container's filesystem for their mounts to resolve. Requires privileged.
FROM ghcr.io/astral-sh/uv:python3.12-bookworm

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git ca-certificates curl \
docker.io iptables \
libcairo2 libffi8 \
&& rm -rf /var/lib/apt/lists/*

# VeRO (not on public PyPI): vendor into the build context, then install.
COPY vero /opt/vero
RUN uv pip install --system "/opt/vero[harbor]"

# ALE-Bench toolkit (the judge orchestration + scoring).
RUN uv pip install --system "git+https://github.com/SakanaAI/ALE-Bench.git"

COPY agent-baseline /opt/agent-baseline
COPY sidecar/ale_factory.py /opt/ale_factory.py
COPY sidecar/harness /opt/harness
COPY sidecar/serve.json /opt/serve.json
COPY sidecar/dind-entrypoint.sh /opt/dind-entrypoint.sh
RUN chmod +x /opt/dind-entrypoint.sh

RUN cd /opt/agent-baseline \
&& git init -q \
&& git add -A \
&& git -c user.email=baseline@vero.test -c user.name=baseline commit -qm "baseline" \
&& git config --system --add safe.directory /opt/agent-baseline \
&& git config --system --add safe.directory /work/agent \
&& git config --system --add safe.directory /work/agent/.git

ENV PYTHONPATH=/opt
WORKDIR /opt
# Start the in-container Docker daemon + bootstrap the judge image, then exec the
# serve command passed by docker-compose.
ENTRYPOINT ["/opt/dind-entrypoint.sh"]
Loading