EnvHarness: Dynamically Adapting Environments for Agent Learning

This repository profile is provided by osrepos.com, an open source repository discovery platform.

EnvHarness: Dynamically Adapting Environments for Agent Learning

Summary

EnvHarness empowers large language models (LLMs) acting as autonomous agents to learn more effectively from interactive environments. It achieves this by wrapping static environments with plug-in components, making them dynamically controllable without altering their internal code. This innovative approach allows environments to target specific agent weaknesses and continuously teach as agents improve, leading to more effective and efficient learning outcomes.

Repository Information

Analyzed by OSRepos on September 3, 2026

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

As large language models (LLMs) evolve into autonomous agents, their learning increasingly shifts from curated text to interactive environments. However, these environments are often expensive to build and remain static, failing to adapt to an agent's progress or specific weaknesses. EnvHarness addresses this challenge by applying the "agent harness" concept to environments themselves. It wraps a frozen environment with its own plug-in components, making it dynamically controllable without requiring any changes to the environment's internal code.

This dynamic layer is built from three core plug-in components:

  • Setup: Reshapes the initial state of the environment.
  • Rule: Modifies the interaction, including allowed actions, their effects, and agent observations.
  • Link: Composes tasks from another environment into the current one.

These components operate strictly at the standard reset and step interface, ensuring that the original benchmark's trusted, human-built verifiers remain untouched. This benchmark-agnostic system works across various domains, enabling a designer agent to diagnose agent weaknesses, write components to target them, and iteratively improve the environment to teach what the agent lacks.

Why Use EnvHarness and Key Benefits

EnvHarness offers significant advantages for developing and training LLM agents:

Enhanced Agent Learning

Skills learned in EnvHarness-adapted environments consistently outperform both no-skill baselines and skills learned in original, static environments. Agents demonstrate increased effectiveness (up to +9 points on held-out tasks) and improved efficiency (~9.8% fewer interaction steps). The system also produces stronger policies under reinforcement learning, with gains compounding through repeated designer loops.

Key Features

  • Frozen Environments, No Internal Edits: The benchmark's task set, dynamics, and grading remain exactly as published. Only the layer through which the agent interacts changes.
  • Code as the EnvHarness: The designer agent generates real Python code, specifically a _Rules(Rules) subclass, rather than selecting from a fixed menu. This code is compiled and executed in an isolated subprocess, ensuring robustness.
  • Composable by Construction: An EnvHarness itself acts as an ActionableEnv that wraps another, allowing layers to stack arbitrarily. This ensures a single, consistent interface for any benchmark.
  • Benchmark-Agnostic: Integrating a new environment simply requires implementing one interface (ActionableEnv). The designer, components, learning loop, and evaluation stages require no further modifications.

Quickstart Guide

To get started with EnvHarness, you'll typically configure your LLM provider and then run one of the provided benchmarks.

LLM Configuration

EnvHarness supports various LLM providers. You'll need to set up your API keys or credentials:

  • GPT (OpenAI):
    export OPENAI_API_KEY="your-openai-api-key"
    
  • Claude (Vertex AI):
    gcloud auth application-default login
    export GOOGLE_CLOUD_PROJECT="your-project-id"
    pip install "google-cloud-aiplatform>=1.38"
    
  • Gemini:
    export GEMINI_API_KEY="your-gemini-api-key"
    

You can specify the model in your configuration YAML or via an environment variable:

policy:
  model: openai/gpt-4.1-mini
mutator:
  type: llm
  model: vertex_ai/claude-sonnet-4-6

Or, to override for a full run:

MODEL=openai/gpt-4.1 python experiments/swebench/reproduce.py

Run a Benchmark

Each benchmark has its own environment and a dedicated driver. For detailed setup and commands, refer to the README.md file within the specific experiment folder you wish to run.

Common commands include:

  • Preflight check:
    python scripts/check_env.py <benchmark>
    
  • Smoke test (fewer tasks):
    bash experiments/<benchmark>/reproduce_smoke.sh
    
  • Full protocol:
    python experiments/<benchmark>/reproduce.py
    

Benchmarks and Examples

EnvHarness has been tested across a range of benchmarks. You can find examples and reproduction scripts in the experiments/ directory:

For reinforcement learning training with policies directly inside EnvHarness environments, explore the rl/ directory.

Links

Related repositories

Similar repositories that may be relevant next.

Tau: A Minimalist Python Coding Agent for Your Terminal

Tau: A Minimalist Python Coding Agent for Your Terminal

September 8, 2026

Tau is a Python port of Pi's minimalist coding agent, designed to live in your terminal. It allows users to make requests like "explain this repo" or "add tests," and it can read files, edit code, and run commands. Beyond its utility, Tau also serves as a teaching project, demonstrating how coding agents are built with a small, readable codebase.

PythonAICoding Agent
Awesome Harness Engineering: Building Reliable AI Agent Systems

Awesome Harness Engineering: Building Reliable AI Agent Systems

September 7, 2026

Awesome Harness Engineering is a comprehensive curated list dedicated to the discipline of designing robust AI agent harnesses. It offers a wealth of resources, patterns, and templates essential for building reliable AI agent systems. Developers can explore tools, best practices, and foundational concepts across various critical areas of agent development.

agent-harnessai-agentsawesome-list
Best of Agent Harnesses: A Curated List for AI Agent Development

Best of Agent Harnesses: A Curated List for AI Agent Development

September 7, 2026

RyanAlberts' Best of Agent Harnesses is a comprehensive, curated, and ranked list of over 100 AI agent harnesses and orchestration frameworks. It provides valuable insights for building reliable agentic systems, offering both human-readable guides and machine-readable formats for agents themselves. The repository is rescored weekly to ensure up-to-date recommendations.

AI AgentsAgent HarnessesLLM Frameworks
Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly

Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly

September 3, 2026

Wasm Agents Blueprint is an innovative project from Mozilla AI that allows you to run Python-based AI agents directly in your web browser using WebAssembly (Wasm) and Pyodide. It bridges the gap between powerful Python AI frameworks, like the OpenAI Agents SDK, and browser-based applications. This blueprint eliminates the need for complex server setups or Docker containers, offering a streamlined way to experience AI agents.

PythonWebAssemblyAI Agents

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️