Repository navigation
feat(sandbox): add an Agent37 sandbox provider - #481
Merged
earakely-scale merged 3 commits intoNov 4, 2026
Merged
Conversation
Agent37 VMs (agent37-ubuntu, Docker and Compose inside) as the built-in agent37 provider, over Agent37's REST API with httpx, so no extra. Closes scaleapi#479
…led create's cleanup always finishes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds Agent37 as a built-in sandbox provider,
agent37. It needs no extra: it drives Agent37's public REST API withhttpx, which agent-env already depends on.Closes #479
vminstance of theagent37-ubuntutemplate, Ubuntu with its own kernel, Docker, Compose v2 and buildx,dockerdalready running. Commands run as root, so thesudoagent-env prefixes is dropped.create_vm(image=...)is refused andboot_modeis logged as ignored.timeoutis not enforced; the started log line says so, and the README covers finding a crashed run's VMs (namedagentenv-<random>, attribution in their metadata).https://<random>.agent37.app, created with the instance. They live on the instance record, soget_sandboxon a freshly built provider restores them.sandbox.agent37.app), with a random runnameon each command. Agent37 answers a resend under the same name with the first run's result, waiting for it if it is still running, so a dropped connection (including a TLS error httpx passes through unwrapped) and a refusal before the command started (503at the per-instance command cap) are resent without the command running twice. When no resend gets an answer, exec returns-1, whichexec_scriptretries. Agent37 stops a command at 15 minutes (exit 137).get_sandboxreports the instance's appliednetworkfield.*.agent37.appjoins the built-in egress floor, so an allowlisted workload on another provider can still reach an env hosted on Agent37.read_vm_filereads 4 MiB ranges as base64, so copying a file off the VM to a store that cannot sign URLs (the local stores) fails loudly with its truncation error rather than writing a short file; S3 and Cloud Storage are unaffected, since the VM uploads to the signed URL itself. The README says so._BUILTIN_SANDBOX_PROVIDERS, the CLI's--sandboxhelp, AGENTS.md andconfig.example.toml;remote_sandbox_is_available, the stamping and capability tables, and the pinned egress floor;agent37parameter of the gateway and task-step integration suites.Website
Supported sandboxes should get an Agent37 row, its logo, and a short section with the config above.
How it was tested
Against a funded Agent37 workspace, from a laptop:
agent-env run hello --sandbox agent37passes (about 5 s end to end) and tears its VM down.tst/integration/providers/sandbox_providers/agent37_sandbox_smoke_test.py: 3 passed (~18 s). It serves a container on 8080 through the public URL, writes and reads back a 1 MiB file, reads a 300 KB file, reconnects, runs 12 commands at once, and checks terminate is idempotent.tst/integration/env/gateway/gateway_test.py::test_gateway_with_multi_mcp_server[agent37]: a full gateway env deploy with docker compose, images pushed over exec from the local registry store, passed in 573 s.SSLV3_ALERT_BAD_RECORD_MAC, which httpx raises unwrapped); during the gateway deploy 45 of 6,847 execs were resent under their run name and all landed. The same rate shows up with curl from that machine and never from inside a VM, so it is that network, but the resend is why it costs nothing.Offline:
pytest tst/unit/providers/sandbox_providers/: 1666 passed, 7 skipped.ruff checkandruff format --checkclean.

Confidence Score: 5/5
The latest changes appear safe to merge and address the previous cleanup finding.Summary
Adds
agent37as a built-in Docker-capable VM provider, with public port URLs, reconnect support, configuration examples, and tests.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Create VM] --> B{Create succeeds?} B -->|Yes| C[Check Docker] C -->|Ready| D[Return sandbox] C -->|Fails| E[Wait for deletion] B -->|Fails or cancelled| F[Wait for create to settle] F --> G[Use returned ID or find unique name] G --> E E --> H[Raise original error]Reviews (3) · Last reviewed commit: "fix(sandbox): Agent37 instance calls giv..." · Reviewed by Greptile