Skip to main content
Each sandbox tracks a set of agent sessions. The full session CRUD surface is SDK-only today; from the CLI you select sessions through agent-send flags.

Prerequisites

A sandbox in the active / running / started state. See Create a sandbox.

CLI: pick or start a session at agent-send time

The CLI doesn’t expose session CRUD directly. To control which session a prompt runs in, use the flags on agent-send.
To get a list of sessions, use the SDK or call the HTTP API directly. See CLI reference — agent-send for the full flag table.

SDK: full session lifecycle

The SDK exposes create / list / get / get-latest / update on sessions.

Create a session

List or fetch sessions

getLatestSession is the only call where a 404 from the server is normal — it means “no session yet” and the SDK returns null rather than throwing. You don’t need an error handler for this case.

Use a session in agentSend

Update a session

End-to-end example

Session shape

Next steps

Send a message to an agent

TypeScript SDK reference