# EnvHarness

> Research framework that wraps frozen agent environments with plug-in Setup, Rule, and Link components so a designer agent can reshape them to target an agent's weaknesses.

EnvHarness is a research codebase from google-research that accompanies the paper "EnvHarness: Awakening Static Worlds for Agent Learning". It wraps a frozen benchmark environment with plug-in layers so the environment can change in response to the agent interacting with it, without editing the environment's internal code. The repository includes experiment drivers for ALFWorld, WebArena, SWE-bench Verified, OfficeQA, SpreadsheetBench, and a toy24 example, plus an RL training directory.

## What It Is

EnvHarness applies the agent-harness idea to the environment side of the interaction. Three composable components operate at the standard reset/step interface: Setup reshapes the initial state, Rule reshapes which actions are allowed, what they do and what the agent observes, and Link composes in another environment's tasks. The goal predicate that decides success is left untouched, so reshaped environments keep the original benchmark's verifiers.

## How the designer loop works

An LLM designer agent reads the agent's trajectories, diagnoses a specific weakness, writes components that reshape the environment to target it, tests the policy in the new environment, and revises. The designer emits real Python, a Rules subclass, which is compiled and executed in an isolated subprocess so a failed mutation becomes a recorded trace rather than a dead run. The loop can repeat as the agent improves.

## Running and extending it

Each benchmark has its own experiment folder with a preflight check, a smoke-test script, and a full reproduce script. Every stage accepts a model string with a provider prefix, supporting OpenAI, Claude on Vertex AI, and Gemini models, and skill retrieval uses a paired embedding model. New benchmarks are added by implementing the ActionableEnv interface, and new harness layers by subclassing EnvHarness and registering a tag.

## Reported results

The README reports that skills learned in EnvHarness environments outperformed no-skill and original-environment baselines across the five benchmarks, with gains of up to 9 points on held-out tasks and about 9.8% fewer interaction steps. It says all numbers were produced with Gemini as a mean over three runs. The project states it is not an officially supported Google product.

## Features
- Wraps frozen environments without editing internal code
- Setup, Rule, and Link plug-in components
- LLM designer agent diagnostic loop that reshapes environments
- Designer emits Python Rules code run in an isolated subprocess
- Composable stackable layers via the ActionableEnv interface
- Benchmark-agnostic design with a single interface to implement
- Experiment drivers for ALFWorld, WebArena, SWE-bench Verified, OfficeQA, SpreadsheetBench, and toy24
- RL training with GRPO via verl-agent
- Multi-provider LLM support for OpenAI, Claude on Vertex AI, and Gemini

## Integrations
OpenAI, Gemini API, Claude on Vertex AI, ALFWorld, WebArena, SWE-bench Verified, OfficeQA, SpreadsheetBench, verl-agent, LiteLLM

## Platforms
API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Links
- Website: https://github.com/google-research/envharness
- Repository: https://github.com/google-research/envharness
- EveryDev.ai: https://www.everydev.ai/tools/envharness
