Skip to main content

World Model Harness

wmh is an open-source project for running and building continuously improving agents. It includes a flexible agent runtime, a world model that simulates tool calls, and an optimizer that builds task-specific harnesses for stronger performance at lower cost.

World model, runtime agent, and optimizer connected in a continuous improvement loop

🌐 Platform | 📚 Docs | Discord

Getting started

Local setup

Install WMH, choose the model provider for the built-in runtime agent, and start a local run:

pip install world-model-harness
wmh providers set
wmh run --task "Inspect this repository and explain it"

Build a named world model from collected traces:

wmh build --file traces.jsonl --name my-environment

Then optimize an agent harness against that model and a set of tasks:

wmh optimize my-agent my-environment --tasks tasks.jsonl

Hosted platform

Create an account at platform.experientiallabs.ai, then authenticate the CLI:

wmh login

Copy an agent ID from the platform and run its current champion harness:

wmh run <agent-id>

E2B backend

Hosted agents already run in platform-managed E2B sandboxes. To evaluate a local optimization in E2B, install the extra and provide an E2B key:

pip install "world-model-harness[e2b]"
export E2B_API_KEY=...
wmh optimize my-agent my-environment --tasks tasks.jsonl --backend e2b

Use a world model as an API

from wmh import Action, ActionKind
from wmh.config.store import WorldModelStore
from wmh.engine.loader import load_world_model

model_dir = WorldModelStore(".wmh").resolve("airline")
wm, _provider = load_world_model(model_dir)

session = wm.new_session(task="check out the cart")
obs = wm.step(session.id, Action(kind=ActionKind.TOOL_CALL, name="add_to_cart",
                                 arguments={"sku": "A1"}))
print(obs.content)

Or over HTTP (same code path), namespaced by model name: GET /world_models, then POST /world_models/{name}/sessions and POST /world_models/{name}/sessions/{id}/step.

Run after platform login

After wmh login, the same wmh run command can open a hosted world model or run an agent's current champion harness in E2B. The platform manages model and sandbox credentials, so hosted runs do not need local API keys.

wmh login
wmh run <world-model-or-agent-id>
wmh run <agent-id> -u . --task "fix the failing tests"

Workspace upload is opt-in with -u: WMH live-syncs changes and preserves concurrent local edits. Long-running agents can detach, continue in the platform, and be messaged or reattached later.

wmh run <agent-id> -u . --detach
wmh run --send "Now run the full test suite"
wmh run --attach
wmh run --end

Runtime agents and optimizers in E2B sandboxes

WMH can run the real pi worker inside isolated E2B sandboxes while the world model supplies the environment. Optimization and evaluation rollouts run in parallel, and model credentials stay outside the sandbox.

wmh optimize my-agent my-environment --tasks tasks.jsonl --backend e2b
wmh eval tasks.jsonl --mode closed-loop --harness my-agent --harness-backend e2b

The optimizer can change prompts, tools, policies, skills, and runtime code. Every candidate is measured against the same simulated tasks, and only changes that pass the evaluation gates become the new versioned champion harness.

Development

Managed with uv; linting/formatting with ruff; type checking with ty. Conventions live in AGENTS.md.

uv sync --extra dev      # env + dev tools
uv run ruff check .      # lint
uv run ruff format .     # format
uv run ty check          # type check
uv run pytest -q         # tests

Usage telemetry

wmh uses anonymous usage telemetry to track the volume of usage. Telemetry is strictly metadata. It never includes prompts, traces, actions, observations, file paths, model names, provider credentials, or raw user content.

Telemetry is enabled by default. To opt out for a project:

uv run wmh config telemetry disable

This writes .wmh/settings.toml. You can re-enable it with uv run wmh config telemetry enable, check the current setting with uv run wmh config telemetry status, or disable it for a process with DO_NOT_TRACK=1 or WMH_TELEMETRY=0.

Metadata

Release files for world-model-harness 0.1.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 world-model-harness 0.1.0
File Size Uploaded Provenance Actions
world_model_harness-0.1.0.tar.gz 980.1 kB Without provenance Details for world_model_harness-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for world-model-harness 0.1.0
File Interpreter ABI Platform Actions
world_model_harness-0.1.0-py3-none-any.whl Python 3 none any Details for world_model_harness-0.1.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / world_model_harness-0.1.0.tar.gz

Download URL world_model_harness-0.1.0.tar.gz
Size 980.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b52250b9929019898c8fdd2125c033b3f51e6351775c6e361937be9241122b21
BLAKE2b-256 checksum
How to use checksums
4eb622076894bb48567cced93862c44196f83c8bf3bfc2db51435c87e5269782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / world_model_harness-0.1.0-py3-none-any.whl

Download URL world_model_harness-0.1.0-py3-none-any.whl
Size 831.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05f82bbe3450c1ae139096d7130cbb997cfc7aa33b01d1d616e73dbe481d16ae
BLAKE2b-256 checksum
How to use checksums
47bde868511a7719a25dfb83898f458955ae2c5c97cdd5711e5f0ff7656b1cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for world-model-harness 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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