Islo sandbox integration for Deep Agents.
Islo provides long-running, reconnect-surviving AI sandboxes on real Linux VMs, with pause/resume, snapshots, and a gateway layer for secret isolation and egress policies.
uv add langchain-islo
# or: pip install langchain-isloSet your API key (keys look like ak_...):
export ISLO_API_KEY="ak_..."Sandbox image requirement. The inherited filesystem tools (
read,write,edit,ls,glob,grep) shell out topython3and GNUgrepinside the sandbox. Use an image that provides them (e.g.python:3.12-slim, orubuntu/debianwithpython3+grepinstalled). Alpine/BusyBoxgreplacks the flags these tools need.
Wrap an existing Islo sandbox and use it as a Deep Agents backend:
from islo import Islo
from langchain_islo import IsloSandbox
client = Islo() # reads ISLO_API_KEY
sandbox = client.sandboxes.create_sandbox(image="python:3.12-slim")
backend = IsloSandbox(client=client, sandbox=sandbox)
result = backend.execute("echo hello")
print(result.output) # "hello"
# Filesystem tools are inherited from BaseSandbox:
backend.write("/workspace/app.py", "print('hi')\n")
print(backend.read("/workspace/app.py").file_data["content"])IsloProvider creates, attaches to, and deletes sandboxes for you:
from langchain_islo import IsloProvider
provider = IsloProvider() # reads ISLO_API_KEY
backend = provider.get_or_create(image="python:3.12-slim")
try:
print(backend.execute("uname -a").output)
finally:
provider.delete(sandbox_id=backend.id)IsloSandbox subclasses deepagents.backends.sandbox.BaseSandbox, so it
implements the full SandboxBackendProtocol:
| Method | Backed by |
|---|---|
execute() |
Islo exec_in_sandbox + result polling (commands run via sh -c) |
upload_files() / download_files() |
Islo sandbox files endpoint (raw bytes) |
ls / read / write / edit / glob / grep |
Inherited from BaseSandbox |
id |
Islo sandbox id |
Async variants (aexecute, aupload_files, adownload_files, ...) are provided
by the base class via thread offloading.
| Env var | Default | Purpose |
|---|---|---|
ISLO_API_KEY |
— | Bearer token used to authenticate |
ISLO_BASE_URL |
https://api.islo.dev |
Control-plane base URL |
MIT