Repository navigation
Description
Use cases, pain points, and background
#5222 deprecates the /run path of pi_sandboxed_agent, opencode_sandboxed_agent and hermes_sandboxed_agent. It names the session harnesses as their replacements. Evaluation frameworks that run benchmarks without task sandboxes, such as HLE with and without search, compose these agents into their own configs. An internal reasoning-evaluation framework does this for Nemotron reasoning evaluations, and it cannot move to the session harnesses yet.
Running HLE and HLE Diamond through all six session harnesses (pi_agent, opencode_agent, codex_agent, openclaw_agent, hermes_agent, claude_code_agent) surfaced these gaps:
- No benchmark profile. The deprecated agents ship
configs/benchmark.yaml, which composes the agent onto a benchmark with its Resources Server left unset. The session harnesses have none. - No search. The Environment Server grants only the episode Resources Server's tools. The deprecated agents seed their
tool_servers(Tavily, for the HLE search presets) themselves on/run. - No egress control. The deprecated agents' profiles set
network_access: model_only. The session harnesses have nonetwork_access, so a sandbox they create gets the provider's default network. On our OpenSandbox cell that default reached GitHub, Hugging Face and package registries. - Bugs found along the way:
- Claude Code turns are empty (Anthropic Messages calls are not read into turns).
- OpenCode answers start with the reasoning that Gym's chat endpoint puts in
<think>tags, a regression from the deprecated agent. - Claude Code rollouts stay open after the final answer when the model backgrounds Bash commands.
Description:
Close these gaps so the session harnesses can replace the deprecated agents for these evaluations:
- fix(rollouts): build turns from Anthropic Messages model calls #5547: build turns from Anthropic Messages model calls
- feat(agents): add swappable benchmark profiles for the session harnesses #5550: swappable benchmark profiles for the six session harnesses
- fix(configs): grant no tools from judge servers that serve none #5590: judge servers that serve no tools grant none, so the profiles run HLE, HLE Diamond, GPQA and APEX Shortlist without an override (stacked on feat(agents): add swappable benchmark profiles for the session harnesses #5550)
- feat(env): grant MCP tools of extra tool servers to session agents #5551: the Environment Server grants MCP tools of extra tool servers (
tool_servers) - fix(opencode): keep a Gym reply's reasoning out of OpenCode's answer #5548: keep a Gym reply's reasoning out of OpenCode's answer
- token capture: terminal attribution misses OpenCode answers split from a Gym reply's reasoning block #5609: token capture's terminal attribution misses OpenCode answers split by fix(opencode): keep a Gym reply's reasoning out of OpenCode's answer #5548 (follow-up, capture only)
- fix(claude-code): keep Bash commands in the foreground in headless runs #5549: keep Claude Code's Bash commands in the foreground in headless runs
- claude_code_agent: eval output folds the model's thinking into the graded answer #5565: Claude Code's eval output folds the model's thinking into the graded answer (fix ready; PR to follow)
- feat(pi): restrict the egress of agent-created sandboxes #5554: the shared egress helper, plus
network_accessandsandbox_runtime_dirforpi_agent - feat(opencode): restrict the egress of agent-created sandboxes #5555:
network_accessforopencode_agent(stacked on feat(pi): restrict the egress of agent-created sandboxes #5554) - feat(codex): restrict the egress of agent-created sandboxes #5556:
network_accessandsandbox_runtime_dirforcodex_agent(stacked on feat(pi): restrict the egress of agent-created sandboxes #5554) - feat(openclaw): restrict the egress of agent-created sandboxes #5557:
network_accessandsandbox_runtime_dirforopenclaw_agent(stacked on feat(pi): restrict the egress of agent-created sandboxes #5554) - feat(hermes): restrict the egress of agent-created sandboxes #5558:
network_accessforhermes_agent(stacked on feat(pi): restrict the egress of agent-created sandboxes #5554) - feat(claude-code): restrict the egress of agent-created sandboxes #5559:
network_accessforclaude_code_agent(stacked on feat(pi): restrict the egress of agent-created sandboxes #5554) - Each egress PR (feat(pi): restrict the egress of agent-created sandboxes #5554-feat(claude-code): restrict the egress of agent-created sandboxes #5559) sets
network_access: model_onlyin its own harness's benchmark profile (all merged 2026-11-05) - fix(agents): follow-ups to the session-harness egress controls #5718: egress follow-ups: a sandbox-unreachable model URL is a final 422 everywhere, each restriction is logged, the six harness configs reject undeclared keys, OpenCode's host-run presets deny webfetch, and
pi_sandboxed_agent's notice points atnetwork_access - Follow-up (from feat(pi): restrict the egress of agent-created sandboxes #5554 review): collapse
model_only/model_and_toolsinto one restricted mode for agent sessions, or refuse a required MCP grant whose hostmodel_onlyblocks - Follow-up (from feat(pi): restrict the egress of agent-created sandboxes #5554 review): let
SandboxAccesscarry the owner's egress posture, or let the agent add its endpoints to a borrowed sandbox's policy (patch_egress_rules, feat(sandbox): add per-sandbox egress policies and live E2B updates #5363'supdate_egress_rules) - Follow-up: move
restrict_sandbox_networkonto feat(sandbox): add per-sandbox egress policies and live E2B updates #5363'sSandboxSpec.egress_rulesand provider capabilities once it lands - Follow-up (from feat(pi): restrict the egress of agent-created sandboxes #5554 review): agents outside the six session harnesses that create sandboxes or run on the Gym host have no
network_access:kilocode_agent,stirrup_agent,harness_agent,anyswe_agent(ownagent_network_policy),anyterminal_agent,harbor_agent, and host-runcline_agent,terminus_2_agent,swe_agents;vibench_agentacceptsnetwork_accessbut never applies it - (in fix(agents): follow-ups to the session-harness egress controls #5718) Follow-up (from feat(pi): restrict the egress of agent-created sandboxes #5554 review): the session-harness config classes ignore unknown keys, so a misspelled
network_accesssilently stays open; reject unknown keys on these six configs - Follow-up (from feat(pi): restrict the egress of agent-created sandboxes #5554 review): record the restriction: the INFO line is in fix(agents): follow-ups to the session-harness egress controls #5718; the mode on the sandbox observation still needs a schema change
- (in fix(agents): follow-ups to the session-harness egress controls #5718) Follow-up (from feat(opencode): restrict the egress of agent-created sandboxes #5555 review): the local
environments/opencode_mathandenvironments/opencode_reasoning_gympresets run OpenCode on the Gym host withpermission.webfetch: allow
Design:
Each item is a separate PR with its own tests. The egress PRs reuse the existing restricted_network_policy helper. Once #5363 (SandboxSpec.egress_rules) lands, they can map onto it instead of OpenSandbox's network_policy.
Out of scope:
- Changing the deprecated sandboxed agents.
- Returning reasoning in a separate field from the model server's chat completions endpoint instead of
<think>tags. - Pairing configs under
benchmarks/for the session harnesses.
Acceptance Criteria:
- All six session harnesses run HLE through the benchmark profiles, with healthy rollouts.
- HLE with search runs through
tool_serversfor the harnesses that consume MCP grants. - Sandboxes created by session harnesses can be limited to the model server, or the model and tool servers, as the deprecated agents' are.
Activity