Configure Sandboxed Gym for Evaluator
Sandboxed Gym runs NeMo Gym and environment code outside the trusted Evaluator task container. The Evaluator task keeps platform and OpenSandbox credentials, starts a per-run Gym host, sends rollout requests over HTTP, and destroys the host when the run ends.
This page is for platform operators. Job submitters cannot select the host provider, runtime image, PVC, or egress policy.
Prerequisites
- Complete the shared OpenSandbox platform setup. It configures the server connection, credentials, and top-level platform sandbox capability.
- A Kubernetes or Volcano Jobs execution profile with a shared job-storage PVC. The claim should
support
ReadWriteManywhen Jobs and OpenSandbox pods can run on different nodes. - Published
nmp-cpu-tasksandnmp-gym-hostimages for the platform release. - An allowlisted model endpoint reachable from the Gym host.
Execution topology
For a built-in environment, sandboxed execution runs one platform step:
For a custom environment FileSet, Evaluator runs two platform steps:
The Gym host mounts the environment read-only and a separate workspace path read-write.
Configure Evaluator
After completing the shared OpenSandbox setup, add the Evaluator-specific values. Replace the image, PVC, and model URL for your deployment:
The Evaluator-specific sandbox_cluster_capable flag is separate from the top-level
sandboxClusterCapable value configured in the shared setup. Both must be true: the top-level
value injects the OpenSandbox connection into Jobs pods, and the Evaluator flag makes its compiler
fail closed until the remaining Evaluator settings are configured.
sandbox_job_storage_pvc_claim must match the PVC configured on the Jobs execution profile.
Evaluator rejects a FileSet-backed job when staging writes to one claim and OpenSandbox would mount
another.
Configuration reference
Evaluator requires at least one entry across sandbox_policy_base_urls and
sandbox_egress_allow. The OpenSandbox provider applies a deny-by-default policy and adds the
trusted episode broker automatically.
Configure model egress
Use sandbox_policy_base_urls for model and inference endpoints:
Use sandbox_egress_allow for non-model dependencies:
Submitters cannot extend these lists from GymRunnerTarget. This prevents an environment from
widening its own network access.
Configure credentials
OpenSandbox credentials remain in the trusted Evaluator task. The Gym host receives only per-run tokens and the environment variables required by its selected Gym components.
For a job-specific model credential, create a NeMo Platform secret and reference it through
GymRunnerTarget.env_secrets:
Do not use env_vars for API keys, tokens, passwords, or other secrets. Evaluator rejects
credential-shaped env_vars for sandboxed jobs because environment code can read them.
Local Docker provider
Set sandbox_host_provider: docker only when debugging the runtime contract on a local deployment.
It runs the same nmp-gym-host image but does not enforce the OpenSandbox egress policy and is not
an isolation boundary.
The memory episode backend is also local-only. It requires both:
Ordinary evaluations do not create nested episode sandboxes. Environments that request them must
use the OpenSandbox episode backend and list every permitted image in sandbox_approved_images.
Verify the deployment
Before accepting custom environment jobs, verify:
- OpenSandbox is ready and reachable over the configured in-cluster protocol.
- The selected Jobs profile uses Kubernetes or Volcano and mounts the configured PVC.
nmp-cpu-tasksandnmp-gym-hostcan be pulled by pods in the platform namespace.- The Gym host can reach each configured model URL but cannot reach an unlisted destination.
- A completed and a failed run both destroy their Gym hosts.