Skip to content
DocsAll docs
Console

Agentic workflows – General

Let an AI agent operate your session, workspaces and environments through the Kloudlite tools.

Last updated

On this page

Description and operation

General

An AI agent works in a session. The session gives the agent its tools: one tool for each action on the session, its workspaces and its environment. An agent acts with the account, rights and limits of the developer it works for. A quota or a paused team access that stops you also stops your agent. See Limits.

This chapter covers only what is specific to an agent: how it connects, which tool does a job, and the exact call. Each page names the page of the platform chapter that explains the subject.

Three ways connect an agent to the tools. Each way is one page.

WayWhere the agent runsWhat the agent gets
Claude CodeOn your laptopThe tools of your session, and no access to the laptop.
MCPIn any client that speaks MCPThe same tools, from kloudlite mcp.
The Kloudlite harnessIn kl-tui, the harness that kloudlite opensThe same tools, in a session that you open.

The other pages describe the tools by subject.

PageSubject
WorkspacesCreate, start, stop and delete a workspace, and change its packages.
EnvironmentsCreate an environment, change its services, and intercept a service.
VolumesTake a snapshot, clone, restore, and delete snapshots and volumes.
Tool serverRead and run in one workspace over plain HTTP, from a program.
The kl commandManage packages, read the session environment and build an image from inside a workspace.

Tools

Each tool takes the workspace or the environment that it acts on, as an id. A workspace id starts with ws- and an environment id with env-. A name does not work. A tool that starts work returns 202 at once, and the agent polls the matching *_get tool or calls env_wait. See Agent tools for the arguments and the route of each tool.

AreaActs onTools
SessionThe session itselfsession_current, session_use, session_pick, session_connect, session_disconnect
Workspace lifecycleThe workspaces of the sessionworkspace_list, workspace_get, workspace_create, workspace_start, workspace_stop, workspace_delete, workspace_ask
Workspace codeA workspace of the sessionread, write, edit, patch, glob, grep, exec, process_*, watch*, worktree_add, worktree_drop
Packages and imagesA workspace and its builderpackages_list, packages_add, packages_remove, packages_update, container_build, container_push, builder_status
EnvironmentAn environmentenv_list, env_get, env_wait, env_create, env_start, env_stop, env_delete, service_add, service_update, service_remove, service_logs, intercept, release
VolumesA volumeworkspace_snapshot, env_snapshot, workspace_clone, env_clone, workspace_restore, env_restore, volume_list, volume_history, volume_refs, volume_delete, snapshot_delete
AccountThe quota and the requests of an ownerquota, regions, request_create, request_get, requests_list
WebThe internetweb_fetch, web_search
Work of the agentThe board and the scratch folder of the sessiontask_add, task_update, task_list, workspace_tasks, scratch_bash, scratch_read, scratch_write

The account tools call the routes that the tasks of Quota and requests and Regions describe.

Scopes

An agent does not hold every tool. The tools it holds depend on where it runs. Three scopes exist: the platform, the session and one workspace.

ScopeHeld byTools
PlatformEvery agent that reaches the APIThe account tools, the volume tools and web_fetch, web_search. They act on an owner or a volume, not on one workspace.
SessionClaude Code, an MCP client and the main session of the harnessThe session, workspace lifecycle, environment, volume and account tools, with the board and the scratch folder. The main session has no code tools.
WorkspaceThe session of one workspaceThe code tools and the packages, container and environment tools of its own workspace. They take no workspace argument. It also has main_tell and subagent.

Claude Code and an MCP client serve the tools of all three scopes in one list. Each tool then takes the workspace or env that it acts on. The harness splits them, so that a main session directs and a workspace session works:

  • The main session creates, starts, stops and deletes workspaces and environments. It holds packages_list but not packages_add, packages_remove or packages_update. It cannot intercept or release a service.
  • The session of a workspace holds the code tools, packages_add, packages_remove, packages_update, intercept, release, service_* and workspace_stop. It reports to the main session with main_tell.
  • A subagent runs in a clone of a workspace. It holds the tools of that workspace without workspace_stop, intercept, release, the board, workspace_ask, main_tell and subagent.

workspace_create and workspace_delete act through the session. A workspace that an agent creates belongs to the session, and the agent deletes it through the same session.