google-research

envharness: Adapt Environments for Agent Learning

EnvHarness wraps frozen interactive environments with composable layers that can target an AI agent’s weaknesses without changing benchmark code or grading. It is for researchers building and evaluating agent-training workflows across different environments.

Stars
615
Forks
49
Stars, last 16 days
+41

Our take

Health score

27/100

How it is scored
Activity
32
Community
33
Issues
21
Pull requests
21

+41 stars in the last 16 days

  • Fewer contributors than 86% of the projects we track

Overview

EnvHarness is a Python framework for adapting interactive environments used to train and evaluate AI agents. Static benchmarks do not change in response to an agent’s abilities, which can make them less useful for addressing specific weaknesses or continuing to teach as an agent improves.

The framework wraps an environment at its standard reset and step interface. An LLM-based designer can use agent trajectories to propose changes to the starting state, interaction rules, or tasks linked into an episode. The underlying environment and its success evaluator remain unchanged. The README reports experiments across several benchmarks, but results depend on the model and setup used.

Key Features

  • Wraps environments without requiring changes to their internal code.
  • Provides Setup layers to reshape initial states, Rules layers to alter interactions, and Link layers to compose tasks from another environment.
  • Lets a designer generate Python rules based on observed agent weaknesses.
  • Keeps the original environment’s task definitions and success evaluator in place.
  • Composes layers through a shared ActionableEnv interface.
  • Supports skill induction and evaluation workflows, as well as reinforcement-learning training integrations described in the repository.
  • Includes guidance for connecting new benchmarks through an environment bridge.

Use Cases

  • Agent researchers: target a policy’s diagnosed weaknesses with adapted environments rather than relying only on a fixed task distribution.
  • Benchmark teams: reuse existing environments and evaluators while experimenting with different starting states, action rules, or task compositions.
  • Training teams: compare skills learned from adapted environments with skills learned from original environments or with no skills.
  • RL practitioners: explore training policies in dynamically adapted environments, using the integration documented by the project.

Getting Started

Choose a benchmark and follow its experiment README. The repository provides a preflight check and smoke-test pattern:

python scripts/check_env.py <benchmark>
bash experiments/<benchmark>/reproduce_smoke.sh

Runs require provider credentials and a configured model; consult the main README and the selected benchmark’s README for setup and full commands.

Considerations

  • This is a research-oriented framework, not a turnkey benchmark runner. Each benchmark has its own environment and setup requirements.
  • Model API credentials and provider quotas affect runs. The README warns that excessive concurrency can cause rate-limit errors and incomplete episodes.
  • Generated Python rules execute in an isolated subprocess, but users still need to configure and validate their runs carefully.
  • The reported results are tied to specific experiment configurations and models; they should not be treated as guarantees for other setups.
  • Reinforcement-learning workflows use a separate integration, documented under rl/ in the repository.

Found this useful?

Share it with someone who would like envharness.

Comparisons