Skip to main content

OpenEnv: Agentic Execution Environments

An end-to-end framework for creating, deploying and using isolated execution environments for agentic RL, with a simple Gymnasium-style API.

PyPI License Docs Hugging Face Discord Open In Colab

What you get

  • One API for every environment. reset(), step() and state(), sync or async, over a WebSocket.
  • Isolated, deployable environments. Each environment is a Docker image that runs locally, on a cloud sandbox, or as a Hugging Face Space.
  • 40+ ready-to-use environments, from games and coding sandboxes to browsers, finance and simulators, in the environment catalog.
  • Train with your framework. TRL, Unsloth, SkyRL, ART, Oumi, torchforge, Miles and more (see Integrations).
  • Train real coding agents. The Harbor integration runs Claude Code, Codex, OpenCode, mini-swe-agent and other harnesses on Harbor tasks, and captures the exact tokens for RL.
  • Serve tools to agents. MCP environments expose their tools to agents over /mcp in production mode, while training keeps using step() and rewards.
  • Rewards and evals built in. Compose rewards with rubrics and evaluate with Inspect AI.

Quick Start

Install the OpenEnv package:

pip install openenv

Install an environment client (e.g., Echo):

pip install git+https://huggingface.co/spaces/openenv/echo_env

Then use the environment:

import asyncio
from echo_env import CallToolAction, EchoEnv

async def main():
    # Connect to a running Space (async context manager)
    async with EchoEnv(base_url="https://openenv-echo-env.hf.space") as client:
        # Reset the environment
        result = await client.reset()
        print(result.observation.metadata["message"])  # "Echo environment ready!"

        # Send messages
        result = await client.step(
            CallToolAction(
                tool_name="echo_message",
                arguments={"message": "Hello, World!"},
            )
        )
        print(result.observation.result["data"])  # "Hello, World!"
        print(result.reward)

asyncio.run(main())

Synchronous usage is also supported via the .sync() wrapper:

from echo_env import CallToolAction, EchoEnv

# Use .sync() for synchronous context manager
with EchoEnv(base_url="https://openenv-echo-env.hf.space").sync() as client:
    result = client.reset()
    result = client.step(
        CallToolAction(
            tool_name="echo_message",
            arguments={"message": "Hello, World!"},
        )
    )
    print(result.observation.result["data"])

For a detailed quick start, check out the docs page.

Train an agent

Any training framework that can call an environment can train on it. Training with OpenEnv maps the ways to train and the frameworks that support each one.

Build your own environment

openenv init my_env       # scaffold an environment
openenv validate my_env --level static --skip-build   # quick check against the OpenEnv contract
openenv push my_env       # deploy it to Hugging Face Spaces

See Your First Environment and Deploying an Environment. openenv import wraps an existing environment from ORS/OpenReward or Verifiers.

Environments

A few to start with:

Environment What it is
Echo Minimal MCP environment, for learning the API and testing a deployment
Coding Sandboxed Python execution with stdout, stderr and exit codes
TextArena (Wordle and more) Text games for multi-turn RL
OpenSpiel Board and card games from DeepMind's OpenSpiel
BrowserGym Web navigation tasks (MiniWoB++, WebArena, ...)
Harbor Harbor task datasets through coding-agent harnesses, with token capture for training

Browse all of them in the environment catalog, or on the OpenEnv Hub organization.

Integrations

OpenEnv works with a growing ecosystem of RL frameworks and platforms. If your project supports OpenEnv, open a PR to add it here.

Framework Example
ART ART integration
Lightning AI Templates
Miles Terminal-Bench-2 GRPO
Oumi GRPO notebook
SkyRL SkyRL example
torchforge GRPO BlackJack
TorchTitan-RL (TitanRL) OpenEnv bridge and Muse Glimmer 30B chess recipe for GRPO/DAPO, with a CPU demo and tests
TRL OpenEnv guide (GRPO with environment_factory, and harness training)
Unsloth 2048 with gpt-oss

Learn more

Community Support & Acknowledgments

OpenEnv is governed by a technical committee that coordinates project direction, major technical decisions, RFCs, and release planning through the public issue tracker, pull requests, and RFC process. Current committee members: Meta-PyTorch, Reflection, Unsloth, Modal, Prime Intellect, Nvidia, Mercor, Fleet AI, Microsoft, Hugging Face, RadixArk, and Nebius.

The project is also supported by a broader community of organizations. If you would like to add your project or organization here, please open a pull request for maintainer review.

Supporters include: Meta-PyTorch, Hugging Face, Scaler AI Labs, Patronus AI, Surge AI, LastMile AI, Unsloth, Reflection, vLLM, SkyRL (UC-Berkeley), Lightning AI, Axolotl AI, Stanford Scaling Intelligence Lab, Mithril, OpenMined, Fleet AI, Halluminate, Turing, Scale AI, Scorecard, Snorkel AI, SGLang, Miles, Nebius

And we'd also like to acknowledge the team at Farama Foundation as the OpenEnv API was heavily inspired by the work you all have done on Gymnasium. Cheers!

License

BSD 3-Clause License (see LICENSE file)

Metadata

Release files for openenv 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openenv 0.9.0
File Size Uploaded
openenv-0.9.0.tar.gz 616.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openenv 0.9.0
File Interpreter ABI Platform
openenv-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / openenv-0.9.0.tar.gz

Download URL openenv-0.9.0.tar.gz
Size 616.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dad69535ce5d2c4b48197ec111941f8660bd383e28e6f028bd6ccc21d535e6d3
BLAKE2b-256 checksum
How to use checksums
11b3aec319abadaa67ba22ac28ce422b29a10e0b1d3307e127e9e28bd6bc31e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / openenv-0.9.0-py3-none-any.whl

Download URL openenv-0.9.0-py3-none-any.whl
Size 722.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63cdc977c0dab9a799c9a03e7616dcf09dc8811ede97904895a665d722e708b6
BLAKE2b-256 checksum
How to use checksums
146a36378e67feb598697530c46a1c8d5620b24f3a907cac213449f76812461a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page