Skip to content

Reference

sandbox.run: Run code (no network)

Markdown version

Run the step's own code (reviewed with the agent's version) in an isolated sandbox with no network, without the model. The code defines main(input) and returns JSON.

  • Effect: reads
  • Through lg_propose: runs at once
  • Credential scope: agents:write to start a run with lg_propose

Inputs

FieldTypeRequiredNotes
language"python" | "javascript"yes
sourcestringyesCode defining main(input) that returns JSON
inputanyno
timeout_sintegerno
envobjectno

Example MCP call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_propose",
    "arguments": {
      "tool": "sandbox.run",
      "input": {
        "language": "python",
        "source": "…"
      }
    }
  }
}

Replace the placeholders in input with real values (the fields above). The answer has the run, its output, and anything waiting for a person.

All agent tools: agent tools.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.