A ready-to-run example is available here!A Sailbox is a hosted sandbox from Sail Research. This guide starts one from the agent-server image, starts the server in it, and connects to it with a remote
Workspace. The SDK has no workspace class for Sail: a Sailbox is only the place where the agent server runs, and the SDK talks to it like to any other remote agent server.
Prerequisites
- A Sail API key from app.sailresearch.com, exported as
SAIL_API_KEY - The Sail Python SDK:
pip install sail - An LLM API key, exported as
LLM_API_KEY
Key Concepts
Creating the Sandbox
The sandbox is created from a pre-built agent-server image, with the server’s port published:ingress_ports gives the port an HTTPS URL, and max_lifetime_seconds ends the sandbox even if your script is killed before it can terminate it.
Starting the Agent Server
A Sailbox does not run the image’sENTRYPOINT, so the server is started with an explicit command:
wait_for_listener returns once the server answers through the sandbox URL.
Connecting with a Remote Workspace
With the URL and the session key, the rest is the same as for any remote agent server:Conversation gives a RemoteConversation that streams events over a WebSocket.
Cleaning Up
Terminate the sandbox when you are done, in afinally block so it also happens on errors:
Ready-to-run Example
This example is available on GitHub: examples/02_remote_agent_server/18_convo_with_sail_sandboxed_server.py
examples/02_remote_agent_server/18_convo_with_sail_sandboxed_server.py
Running the Example
ACP Agent in a Sail Sandbox
The same sandbox can run anACPAgent. The only difference is the environment of the server process, which carries the variables the ACP CLI needs. See the ACP Agent guide for how ACP agents work.
This example is available on GitHub: examples/02_remote_agent_server/19_acp_agent_with_sail_sandbox.py
examples/02_remote_agent_server/19_acp_agent_with_sail_sandbox.py
Next Steps
- Docker Sandboxed Server - Run the agent server in a local container
- API-based Sandbox - Connect to a runtime API deployment
- Agent Server Overview - Architecture and implementation details

