Skip to content

feat(agents): support SandboxProvider for standalone Hermes and OpenClaw harnesses #2669

Open

Description

@cwing-nvidia

Summary

The standalone Gym Hermes and OpenClaw harnesses execute their agent runtimes on the agent-server host and cannot select a Gym SandboxProvider. Gym can run both agents inside task containers through anyswe_agent, but that path is coupled to SWE-style datasets, images, patch extraction, and grading.

Add a provider-backed outer-sandbox mode suitable for general resources-server environments, including stateful MCP environments such as Workplace Assistant.

Current behavior

  • mini_swe_agent does not use nemo_gym.sandbox; it delegates Docker/Singularity execution to minisweagent.
  • mini_swe_agent_2 added Gym provider support through the synchronous Sandbox facade.
  • anyswe_agent uses AsyncSandbox and can run HermesAgent or OpenClawAgent inside SWE task containers.
  • Standalone hermes_agent runs upstream AIAgent in the Gym agent-server process. Its terminal_backend is Hermes's own backend selection, not a Gym SandboxProvider.
  • Standalone openclaw_agent launches openclaw agent --local as a host subprocess.

Thus Gym has the underlying provider abstraction and benchmark-specific wrappers, but no general way to run these standalone agent runtimes inside OpenShell, OpenSandbox, or another provider.

Expected behavior

A general agent configuration should be able to select sandbox_provider: sandbox and run one isolated agent runtime per rollout while preserving the existing resources-server lifecycle:

  1. Host calls /seed_session.
  2. Host creates a sandbox from the selected provider.
  3. A small in-sandbox runner receives the Responses API request, model endpoint, and any rollout-scoped MCP metadata.
  4. The agent runs locally inside that outer sandbox.
  5. Host retrieves the trajectory, calls /verify, and always destroys the sandbox.

Design considerations

  • Prefer a reusable outer-runner abstraction over separate copies in Hermes and OpenClaw if their lifecycle is sufficiently similar.
  • Keep model/provider credentials on the host where possible; pass only sandbox-reachable Gym service URLs and rollout-scoped credentials.
  • Avoid process-global agent configuration leaking between concurrent rollouts.
  • Preserve Responses API output and observation data.
  • Validate and document sandbox-to-host routing and provider egress policy.
  • Keep AnySWE's SWE-specific patch and grading behavior separate.

Dynamic Gym MCP handoff for Hermes is tracked in #2667. Client-independent tool-name normalization is tracked in #2668.

Acceptance criteria

  • At least Hermes can run a non-SWE resources-server rollout in a selected Gym SandboxProvider.
  • The design has a clear extension path for OpenClaw without duplicating provider lifecycle code.
  • Sandbox creation, execution, response retrieval, timeout handling, and cleanup are covered by tests.
  • A real OpenShell rollout validates that the runtime is inside the sandbox and is deleted after verification.
  • Existing unsandboxed Hermes/OpenClaw and AnySWE behavior remains unchanged.

Activity

  1. added
    needs-design
    on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Agentsneeds-designsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions