- A conversation is the session shown in the OpenHands application. It has its own messages, events, agent state, repository selection, and usage metrics.
- A sandbox is the execution environment. It provides the filesystem, processes, credentials, tools, and compute used by one or more conversations.
- An Agent Server runs inside the sandbox and executes the OpenHands coding agent for each conversation attached to that sandbox.
How The Components Relate
The Enterprise V1 API creates and manages the user-visible conversations. A sandbox can contain one conversation or several, depending on placement. Two conversations in the same sandbox keep separate conversation histories, but they share the sandbox’s filesystem, credentials, compute limits, and failure domain.Choose The Sandbox Boundary
Use separate sandboxes when conversations cross a security, trust, repository, or failure boundary. Use a shared sandbox when the conversations are trusted to share the same environment and reducing startup time or sandbox count is more important than isolation.Configure Automatic Placement
The user’sSandbox Grouping Strategy application setting controls automatic
placement:
To change the setting:
- Navigate to
Settings > Application. - Select a value under
Sandbox Grouping Strategy. - Click
Save Changes.
Manage Conversations With V1
The V1 API uses the Enterprise base URL and Bearer authentication:Start A Conversation
READY and returns app_conversation_id and
sandbox_id.
Pass Secrets At Conversation Start
For credentials needed by only one conversation, include asecrets map in
the start request:
plugins. Secrets present at startup can fill
${NAME} placeholders in an attached plugin’s MCP configuration before the
MCP connection opens. Pass both secrets and plugins in the start request
when a plugin requires a conversation-specific credential.
For tested implementations, see the
per-conversation secrets
and
service-account GitHub PAT
examples.
Select An Existing Sandbox
For explicit placement:- Create a sandbox with
POST /api/v1/sandboxes. - Wait until its status is
RUNNING. - Include its ID as
sandbox_idwhen starting the conversation. - Verify that the completed start task returns the expected sandbox ID.
Inspect Work Through V1
Enterprise exposes application-level endpoints for reviewing work without connecting directly to the Agent Server:
The app-conversation record also includes sandbox status, agent execution
status, and model usage metrics.
Use the events endpoint for messages, tool actions, tool observations, state
changes, and errors. Use the current app-conversation record to reconcile
status after a process restart or missed event.
Manage Sandbox Lifecycle
The V1 sandbox endpoints include:
Pause retains the conversation and recoverable workspace while releasing
active runtime capacity. Delete only after required results and artifacts are
stored elsewhere.
Before pausing or deleting a shared sandbox, check every conversation attached
to it. The operation affects all of them.
Deleting the last conversation can also remove its sandbox. After deleting a
conversation, check whether the sandbox still exists before sending a separate
sandbox delete request.

