Skip to main content
Two halves of the same package: defineAgent() describes an agent in a file you deploy, and rt.agent runs agents and works with their threads. (For the tools an agent can call, see Tools.)

Define Agents

agents/code-assistant.ts
Deploy with runtools deploy.

Execution Modes

Supported modes are in_sandbox, managed, and local-mac. local-mac agents require a targetDeviceId from RunMesh:

Persistent Files

For in_sandbox agents, mount a workspace on the linked sandbox. The agent works through the sandbox, and files under the mount path persist as the agent’s filesystem memory.
sandboxes/dev-env.ts
agents/code-assistant.ts
Threads preserve conversation context. Workspaces preserve files, generated artifacts, and repo state.

Run Agents

Manage runs

Inspect or stop runs after they start:

Threads

Threaded runs can return THREAD_BUSY if another run is active on the same thread.

Attachments

Manage Agents

The create/update/delete agent definition lifecycle is usually handled by runtools deploy or the dashboard. Direct REST endpoints are documented in Create Agent.

Types