Repository navigation
Description
Why this work is needed
Several resources servers execute model-controlled Python, shell commands, SQL, compilers, or document parsers directly on the resources-server or Ray-worker host. Process timeouts, Ray placement, language-level deny lists, and restricted builtins limit failures, but they do not provide an operating-system isolation boundary.
Other resources servers already use Docker, Singularity, or a separate NeMo Skills sandbox service. Those paths are isolated, but they duplicate lifecycle, configuration, file transfer, timeout, and cleanup behavior that the provider-neutral nemo_gym.sandbox API is intended to standardize.
This issue tracks the resources servers that should migrate. It complements #2763, which defines canonical sandbox architecture and reusable patterns. This issue owns the environment-by-environment adoption work identified by the repository audit.
Scope criteria
A resources server is in scope when either condition applies:
- model-controlled content reaches a host or Ray-worker code runtime, shell, compiler, writable database, or unsafe document parser during rollout or verification; or
- runtime execution is already isolated through benchmark-specific infrastructure that should converge on
nemo_gym.sandbox.
Setup scripts, data-preparation commands, test-only subprocesses, trusted parser workers, and benchmark-native simulators are not migration work unless their runtime capabilities change.
Wave 1: remove direct host execution
-
math_with_code— move persistent model Python into per-session sandboxes; preserve scientific libraries and interpreter state. -
browsecomp_advanced_harness— movebash_commandinto a per-session sandbox while keeping search and judge calls server-side. -
code_gen— replace Ray-worker execution of LiveCodeBench solutions with stateless sandbox verification. -
bigcodebench— replace the mutable host Python 3.10 virtual environment and runner subprocess with a versioned sandbox image. -
code_fim— run reconstructed HumanEval-Infilling programs in stateless sandboxes. -
evalplus— run HumanEval+ and MBPP+ solutions in stateless sandboxes with the dataset cache baked into the image. -
scicode— move scientific code execution into sandboxes without uploading the large HDF5 corpus for every verification. -
newton_bench— replace the regex deny list and persistent host child with per-session sandboxes. -
nvarc— run inductivetransform()implementations in a stateless Python/NumPy sandbox. -
bird_sql— execute generated SQL against a sandbox-local database copy and prevent timed-out work from continuing on the host.
Wave 2: consolidate benchmark-specific isolation
-
gdpval— move ZIP extraction and LibreOffice parsing of model deliverables into a prebuilt sandbox image. -
competitive_coding_challenges— replace the custom NeMo SkillsLocalSandboxclient after grader metadata and cache staging are redesigned. -
swerl_gen— migrate the outer Singularity execution boundary to the common Apptainer provider; keep nested evaluator commands inside that boundary. -
math_formal_lean— replace the bespoke NeMo Skills HTTP client with direct Lean execution throughAsyncSandbox. -
ns_tools— replace the NeMo Skills Python sidecar/client lifecycle with the common sandbox facade while preserving request-scoped state and cleanup.
Wave 3: add the required adapter
-
aviary— add an Aviary environment adapter before migrating the Docker/Enroot-backed BixBench notebook variants.
Audited and excluded from this migration
These servers contained execution-like code and were reviewed explicitly, but they are not deferred migration tasks:
toolsandboxexecutes an allowlisted tool-call representation inside a benchmark-native state machine. It does not accept arbitrary Python or expose host-capable tools today.spider2_liteexecutes SQL against an in-memory copy of the benchmark database. It may later use sandboxes for resource fairness, but it does not have the writable host-database exposure present inbird_sql.math_with_judgeandmath_with_autograderrun trusted SymPy/math-verification parsing in killable child processes. They do not execute model-provided code.vlm_eval_kitruns a fixed trusted setup script at server startup. This should move to a prebuilt resources-server image rather than a per-rollout sandbox.
cvdp, litmus_agent, and swebench already use nemo_gym.sandbox and are not migration targets. The remaining audited resources servers do not execute model-controlled content through a host runtime during rollout or verification.
Common migration requirements
- Use a prebuilt, versioned image. Do not install benchmark dependencies when each sandbox starts.
- Disable runtime network access unless the benchmark explicitly requires it. Keep search, judge, and credential-bearing API calls in trusted server code where possible.
- Apply enforceable CPU, memory, wall-time, output-size, and lifecycle limits appropriate to the selected provider.
- Treat provider selection as part of the threat model. The common API does not make every provider an equivalent hostile-code boundary.
- Use one of the established lifecycle shapes: stateless verification, Litmus-style per-session state, or SWE-bench-style separate agent and verification sandboxes.
- Avoid per-rollout transfer of large immutable assets such as SciCode's HDF5 corpus and competitive-coding grader caches. Bake, mount, or fetch them through a trusted artifact path.
- Add fake-provider contract tests and at least one opt-in real-provider test for each new image/runtime family.
- Preserve benchmark result details, timeout classification, session cleanup, and verifier behavior.
Provider and API gaps that may block individual migrations
- The neutral API has single-file transfer but no directory/archive primitive.
- Endpoint support is limited to Docker and OpenSandbox; PTY and reconnection support are narrower still.
- Neutral TTL and resource fields are not enforced uniformly by every provider.
- The API does not declare an isolation-strength contract. Container providers normally share the host kernel.
- SWE-bench currently catches
TimeoutError, while providers commonly returnSandboxExecResult.error_type == "timeout"; timeout handling should be made consistent as related cleanup.
Acceptance criteria
- Each in-scope resources server has a linked implementation issue or pull request and an identified owner.
- Every Wave 1 server no longer executes model-controlled code, shell, SQL, or compiler input directly on a resources-server or Ray-worker host.
- Every Wave 2 server uses the common facade or has a documented unresolved platform blocker with an owner.
- Aviary's adapter decision and ownership are recorded.
- Migration tests cover execution results, timeout classification, cancellation, state where applicable, and cleanup.
- At least one real rollout is inspected for each migrated benchmark, as required by the repository quality bar.
- Sandbox images and large immutable assets have reproducible build or publication paths.
- The resources-server inventory in this issue remains current as child work lands.
Activity
jimmy-holdout commentedon Oct 27, 2026
Some measurements for the
bird_sqlitem: besides host isolation, the writable database also affects rewards.At 85b42ba,
execute_sqliteopens the per-db_idfile read/write insidewith sqlite3.connect(...), which commits on exit (eval_utils.py#L29-L41). Gold and model SQL run against that same file (app.py#L127-L128, eval_utils.py#L84-L98), so a write in model SQL carries over to later rollouts on thatdb_id. All 11 BIRD dev databases go through this path. Measured throughverify()on a copy ofcalifornia_schools:DELETE FROM frpm WHERE CDSCode = (<top Alameda row>) RETURNING <its rate>returns the gold value, scores 1.0, and deletes the row. Task 0's gold result then changes from1.0to0.9833….DELETE FROM frpmscores 0 but empties the table. After it, the constant answerSELECT 1 WHERE 0scores 1.0 on 33 of the 89california_schoolstasks (0 before).The changes stay on disk across restarts, since
ensure_bird_sqlreuses the extracted files (setup_bird_sql.py#L29-L31).Reproduction (save as
repro.pyin the repo root after BIRD dev has been extracted to the defaultresources_servers/bird_sql/.bird_sql/directory)#4898 also reworks
execute_sqlite. Its version closes the connection without committing, which rolls back a plainDELETE/UPDATE/INSERT. ADELETE … RETURNINGstill returns the gold rows, though, so it still scores 1.0, and DDL such asDROP TABLEstill persists under Python's default transaction handling.Until the sandbox migration lands, opening the file read-only closes this with one line.
sec_local_indexalready opens its index read-only (local_edgar_search.py#L382-L384), andspider2_literuns queries on an in-memory copy instead (eval_utils.py#L46-L65):With it, a write fails as a query error (reward 0) and the file is unchanged. Scoring all 1534 BIRD dev tasks with their reference SQL as the answer gave identical per-task results with and without the change, and the WAL-mode
card_games.sqlitestill reads fine. The same change fits theconnectcall in #4898's version. I'm happy to send it as a small PR with tests if that's useful, or to leave it to #4898 or the sandbox work.