Skip to main content
A custom Sandbox Agent must declare the CLI’s name, version, and installation method. NiceEval first checks the CLI in the Sandbox. When its version does not match, NiceEval installs the requested version and checks it again.

Declare the CLI identity and installation method

For a Node.js CLI, use createNpmCliInstaller. This example connects the npm package my-agent@1.0.0 through a custom Adapter:
This example defines my-agent run --json to print one OpenAI Responses-compatible JSON object. turnFromResponses converts its output items and usage into NiceEval’s Turn; if your CLI emits another schema, replace that line with an explicit mapping to events, status, and usage. identity.version is the CLI’s exact version. When the installation steps for that version change, update identity.revision too. Do not use latest here. setup writes only authentication and runtime configuration. The installer owns CLI installation, so every Attempt first completes a version check.

Run it in an Experiment

Put the Agent and Sandbox Provider in an Experiment:
For an ordinary npm package, the Sandbox must provide Node.js and npm. createNpmCliInstaller packs and uploads the package from the host, then runs npm install -g inside the Sandbox. If the Sandbox already has the correct version, NiceEval uses it directly. Only a real self-contained platformPackage can omit this runtime requirement.

Inspect installation failures

When installation or the recheck fails, the Attempt becomes errored during agent.ensure. The terminal prints an Attempt locator.
First check the package name, version, and target platform in the error. After correcting the identity, npm package, or installation steps, rerun the original command.

Choose another installation mode

AgentInstaller also supports two modes:
  • sandbox-network lets the Sandbox use its own network to install the CLI. Use it only when the task explicitly permits that network access.
  • verify-only accepts only a preinstalled exact version. If the check fails, the Attempt errors immediately.
For either mode, provide your own AgentInstaller. See all fields in the defineSandboxAgent reference.