Documentation Index
Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Runloop provides disposable devboxes for running code in isolated environments. 参见 Runloop docs 了解注册、认证和平台详情。
pip install langchain-runloop
创建沙箱后端
In Python, you create the devbox using the provider SDK, then wrap it with the deepagents backend.
from runloop_api_client import RunloopSDK
from langchain_runloop import RunloopSandbox
api_key = "..."
client = RunloopSDK(bearer_token=api_key)
devbox = client.devbox.create()
backend = RunloopSandbox(devbox=devbox)
try:
result = backend.execute("echo hello")
print(result.output)
finally:
devbox.shutdown()
Use with Deep Agents
from runloop_api_client import RunloopSDK
from langchain_anthropic import ChatAnthropic
from deepagents import create_deep_agent
from langchain_runloop import RunloopSandbox
api_key = "..."
client = RunloopSDK(bearer_token=api_key)
devbox = client.devbox.create()
backend = RunloopSandbox(devbox=devbox)
agent = create_deep_agent(
model=ChatAnthropic(model="claude-sonnet-4-20250514"),
system_prompt="You are a coding assistant with sandbox access.",
backend=backend,
)
try:
result = agent.invoke(
{"messages": [{"role": "user", "content": "Create a small Python project and run tests"}]}
)
finally:
devbox.shutdown()
Cleanup
Always shut down devboxes when you are done to avoid ongoing resource usage.
See also: Sandboxes.