A harness is the container image and runtime that the platform launches inside a sandbox pod. It is the process that actually runs the coding agent — Claude Code, Codex, opencode, or the Claude Agent SDK. The harness handles cloning the repository, installing dependencies, loading the system prompt, and either exposing a JSON message API or a PTY over WebSocket depending on the harness type. You select a harness when you create an agent via theDocumentation Index
Fetch the complete documentation index at: https://docs.litellm-agent-platform.ai/llms.txt
Use this file to discover all available pages before exploring further.
harness_id field. The choice is permanent for the life of the agent; to switch harnesses, create a new agent.
Harness comparison
| Harness | harness_id | Interface | supports_tui | Best for |
|---|---|---|---|---|
| opencode | opencode | JSON message API | false | Programmatic automation, CI/CD pipelines |
| Claude Agent SDK | claude-agent-sdk | JSON message API | false | Programmatic automation using Anthropic’s agent SDK |
| Claude Code | claude-code | PTY over WebSocket | true | Interactive terminal use with the lap CLI or browser |
| Codex | codex | PTY over WebSocket | true | Interactive terminal use with the lap CLI or browser |
API harnesses
API harnesses expose the platform’s JSON message protocol. You interact with them by posting messages toPOST /sessions/{id}/message and reading the structured response. There is no terminal involved — the harness runs headlessly and returns a HarnessMessageResponse blob for every message.
opencode
harness_id: "opencode" is the default harness. It runs the opencode agent in API mode and communicates over a JSON message protocol. Use it when you want to drive an agent from code — a CI job, a webhook handler, a Slack bot — without attaching a terminal.
claude-agent-sdk
harness_id: "claude-agent-sdk" runs the Anthropic Claude Agent SDK inside the sandbox. Like opencode, it is API-driven — sessions accept messages and return structured responses. Use it when you want Anthropic’s official agent SDK driving the loop rather than opencode.
TUI harnesses
TUI harnesses expose a PTY (pseudo-terminal) over a WebSocket at/tty. Instead of a JSON message API, you get a live terminal session — the same experience as ssh but sandboxed. The lap CLI and the browser session view both attach to this WebSocket and stream raw terminal bytes.
The supports_tui field on an ApiAgent response is true for TUI harnesses, which lets the lap CLI filter the agent picker to only show harnesses you can attach to.
claude-code
harness_id: "claude-code" runs the real Claude Code CLI under node-pty. The working directory is /work/repo (cloned from the agent’s repo_url at boot). The harness accepts a TTY connection and renders the full Claude Code TUI — including ANSI formatting, interactive input, and real-time streaming — over the WebSocket.
codex
harness_id: "codex" runs the Codex CLI under the same PTY-over-WebSocket model. Attach and detach with lap the same way as with Claude Code.
Connecting to a TUI harness
Wait for status=ready
Poll
GET /sessions/{id} until status is ready. The tty_url and tty_token fields are populated at this point.tty_token must be sent as a bearer token on the WebSocket upgrade handshake. lap sends it as an Authorization: Bearer <token> header, which keeps the token out of proxy access logs that record the request URL.
Choosing a harness
Use an API harness
Choose
opencode or claude-agent-sdk when you are driving the agent programmatically — from a CI pipeline, a webhook, a Slack integration, or any other automated system that sends tasks and reads structured responses.Use a TUI harness
Choose
claude-code or codex when you want an interactive terminal session. Attach with lap, work in the sandbox the same way you would locally, and detach when you are done. The session stays alive.