Skip to Content
AI

Agent sandbox connections

The agent CLIs connected in the caller's own Kenso sandbox. Connecting runs the CLI's own login in the box; the login stays on the box's disk and Kenso never reads or keeps it. A box belongs to one person across workspaces, so every route is the caller's own. Behind the agent_work and agent_sandboxes features, never open to a Client seat, and never to an API key held to a permission template (the agent in a box holds one). The login routes are the app's (internal); list and disconnect are public.

AI2 endpointsKen-Version: 2026-11-02AuthenticationWorkspacesErrors
MarkdownOpenAPI

Headers

The endpoints on this page take these headers. Each endpoint's curl shows the ones it sends.

NameInTypeRequiredDescription
Ken-Versionheaderstring, one of: 2026-11-02, 1.1optionalThe API version, a date in YYYY-MM-DD form. 1.1 is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and 404 where the path exists only in this version. A date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.
X-Ken-Workspace-Idheaderinteger (int64)optionalThe id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers 400 workspace_required. A workspace you are not a member of answers 404 not_found.

List your sandbox agent connections

GET/v1/agent-sandbox/connectionsagent-sandbox-connections.list
Permission
Any workspace member except a Network member
Rate limit
12,000 requests a minute per API key
Needs the agent_sandboxes feature on your workspace. Until it is on, calls answer 404. Needs the agent_work feature on your workspace. Until it is on, calls answer 404.

Try it on developer.ken.so

Always six entries in data, in this order: claude, codex, antigravity, opencode, grok, cursor, each with status (connected or not_connected), connectedAt and lastRunAt. pagination.hasMore is always false. Your box serves every workspace you work in, so the list is the same in each.

Errors:

  • 404 not_found: a feature is off, or the credential is not a person's.

Parameters

NameInTypeRequiredDescription
limitqueryinteger (int32)optionalItems per page, from 1 to 200. Omit limit and cursor to get every item in one response, as before; with only cursor, 50 per page.
cursorquerystringoptionalThe nextCursor of the previous page. Omit it for the first page.
Request
curl -X GET "https://api.ken.so/v1/agent-sandbox/connections?limit=1" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"

Response 200

data is a list of AgentSandboxConnection. Each item has these fields. The response also carries pagination.

Show the 4 response fields and an example

The fields and an example are also on this endpoint's Markdown page.

Disconnect an agent

DELETE/v1/agent-sandbox/connections/{agent}agent-sandbox-connections.disconnect
Permission
Any workspace member except a Network member
Rate limit
4,800 requests a minute per API key
Needs the agent_sandboxes feature on your workspace. Until it is on, calls answer 404. Needs the agent_work feature on your workspace. Until it is on, calls answer 404.

Try it on developer.ken.so

Logs the agent CLI out in your Kenso sandbox and answers { agent, status: "not_connected" }. With no agent left connected, the sandbox itself is deleted. Disconnecting an agent that is not connected answers the same.

Errors:

  • 400 validation_failed: an unknown agent.
  • 404 not_found: a feature is off, or the credential is not a person's.
  • 409 run_active: your sandbox is running a run. Stop it first.
  • 503 service_unavailable with Retry-After: the sandbox did not answer; try again.

Parameters

NameInTypeRequiredDescription
agentpathstringrequiredThe agent's id: claude, codex, antigravity, opencode, grok or cursor.
Request
curl -X DELETE "https://api.ken.so/v1/agent-sandbox/connections/claude" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"

Response 200

data is a AgentSandboxDisconnect.

Show the 2 response fields and an example

The fields and an example are also on this endpoint's Markdown page.


On this page