Frontier coding agents in NetHack and Caves of Qud

A sandboxed, fully logged harness for evaluating frontier coding agents in long-horizon games (PhD work in progress)

Work in progress (PhD thesis, Chapter 4). Results are forthcoming and not reported here yet.

Frontier coding agents have been reported to play NetHack with a harness they write themselves. Such one-off runs are hard to interpret: did the agent succeed because of game knowledge it memorised, because it could search the web, because of its harness, or something else?

To answer this in a controlled way, I built a reproducible evaluation setup:

  • Sandboxed Docker harness: an orchestrator plus three containers: the agent (running OpenAI Codex as a non-root user), a logging relay that is the agent’s only route to the internet, and the game.
  • Open-book vs closed-book: the relay allows or blocks web search, separating what the agent knows from what it can look up.
  • Two games: NetHack 3.6.7 (over SSH with ttyrec recording) and Caves of Qud, which is less documented and is played through a custom TCP text-interface plugin. Caves of Qud helps separate memorised knowledge from reasoning.
  • Full logging and budgets: time-aligned logs, environment snapshots and a fixed token budget per campaign.
Experiment setup: an orchestrator drives an agent container inside a Docker sandbox; the agent reaches the game over SSH (NetHack) or TCP (Caves of Qud via a forwarder) and the internet only through a logging relay; all logs are aligned in time.
Experiment setup. The orchestrator starts each campaign with a closed-book or open-book prompt, sends "continue" whenever the agent stops, and ends the campaign at its token budget. The agent can reach only the game and a relay; the relay logs all model traffic and forwards web search only in open-book campaigns. The timeline on the right is an illustrative example.

Design

A campaign starts from a clean slate: the agent gets a coding-agent loop, a shell and an empty home folder, but no game files, screen parser or memory, so everything game-specific (scripts, tools, notes) is something it builds itself. Routing all traffic through a single logging relay makes internet access a controlled variable: closed-book and open-book campaigns use identical prompts apart from whether the web may be used. Caves of Qud plays similarly to NetHack but is less documented and its source code is not available to the agent, which helps separate memorised game knowledge from reasoning. Time-aligned logs and periodic snapshots of the agent’s environment make it possible to match each model output to the game screens around it and to follow how the agent’s own harness evolves, and a fixed token budget keeps campaigns comparable. The setup is built to ask how much of an agent’s play comes from what it already knows versus what it can look up, and what agents actually build and do over a long campaign.

I have run 18 campaigns: 5 open-book and 5 closed-book in NetHack, and 4 of each in Caves of Qud. The trajectory analysis is ongoing.