For the complete documentation index, see llms.txt. A markdown version of this page is at /reference/resources/agentsession/index.md.

AgentSession and AgentSessionConfig

An AgentSession is one run of a coding agent on a workstation, and an AgentSessionConfig is a reusable layer of settings that Ringleader folds into sessions.

An AgentSession is one run of a coding agent on a workstation: which agent, which prompt, which limits. An AgentSessionConfig is a reusable layer of settings that Ringleader folds into the sessions it matches. Both kinds are namespaced, in workstations.ringleader.dev/v1. This page lists the fields of both. Agent sessions explains how a session works and how to use one. Agent session commands lists the commands.

Agent sessions are hidden until the agent-sessions.visible setting is on for you, as Agent session visibility says. The kinds and their commands work either way.

AgentSession

The smallest session names a workstation and a prompt:

apiVersion: workstations.ringleader.dev/v1
kind: AgentSession
metadata:
  name: fix-login
  namespace: local
spec:
  workstationRef:
    name: my-agent-box
  prompt:
    inline: Fix the failing login test.

A session with an agent, limits and a transcript store looks like this:

apiVersion: workstations.ringleader.dev/v1
kind: AgentSession
metadata:
  name: fix-login
  namespace: local
spec:
  workstationRef:
    name: my-agent-box
  prompt:
    inline: Fix the failing login test.
  agent: claude
  lifecycle:
    maxCost: 5
    idleTimeout: 2h
    transcriptStore: daemon

You own every session you create. Nobody else can author one in your name. The schema is closed, so an unknown key is refused. A name is a lowercase DNS subdomain name of up to 253 characters.

Placement and prompt

Give exactly one of workstationRef and workstationPoolRef.

FieldTypeDescription
workstationRef.namestringThe workstation that runs the agent. workstationRef.uid is optional, and Ringleader fills it in.
workstationPoolRef.namestringA WorkstationPool that lends the session a workstation.
prompt.inlinestringThe prompt. It cannot change once the session exists. A running agent is never re-prompted.

What to run

FieldTypeDescription
agentstringclaude, codex, agy, pi or opencode. Any other value is refused.
modelstringThe model, as the agent’s own catalog spells it.
modelProviderstringThe provider that serves the model. It must be a known provider name. pi and opencode need it with model.
modelParams.effortstringOne word of up to 64 bytes, with no spaces and no leading -. The values low, medium, high, xhigh, max and ultra are known. Another value reaches the agent with a warning.
modelParams.extraArgs.<agent>[]stringExtra arguments for that agent, each one argument. A plain string is refused.
workdirstringWhere the agent runs. A relative path resolves against the login user’s home. Without one, the session uses a configuration layer’s workdir, else the workstation’s first source checkout, else the home directory.
envmapEnvironment variables for the agent. Layers merge them key by key.
worktreeSetRefobjectA WorktreeSet on the workstation for the agent to work in.
announceSpeakerboolTells the agent who sent each turn in a shared session.
configs[]objectAgentSessionConfig layers to fold in, each {name, priority}. name is required.

Permissions and identity

FieldTypeDescription
permissions.modestringask, acceptEdits or unattended. Unset leaves the agent’s own default.
permissions.allow[]stringTool patterns, such as Bash(go test:*). Ringleader enforces the list, and a blank entry is refused. A list on the session replaces a layer’s list.
identity.secrets[]stringNames of Secrets that become the session’s identity.

Lifecycle

Every lifecycle field is optional. A duration takes the Go form (90m, 2h) or whole days (7d), and must be positive.

FieldTypeDescription
idleTimeoutstringStops the session after this long with no activity. No default: a session that waits rests indefinitely.
maxDurationstringStops the session after this much agent run time. Time spent waiting for a workstation or stopped does not count.
maxCostnumberStops the session once it has spent this many US dollars. It must be above 0. A provider that reports no cost never trips it.
startDeadlinestringA timestamp by which the agent must have started.
endOnFirstIdleboolEnds the session at the agent’s first turn boundary: Done, or Failed if that turn failed. Default false.
endWhen.done, endWhen.failedstringA pattern for a line the agent writes when it has finished or failed. It matches a whole line, holds up to 256 bytes and must not match an empty line.
maxAutoResumesintHow many times autoResumePrompt may resume the session. Default 5, and 0 never resumes.
autoResumeProgressstringHow long a resumed session must run to count as productive, which restarts the count. Default 1m.
continueInterruptedTurn, interruptedTurnTextContinue a turn that a restart or crash interrupted, and what to say. Off by default.
transcriptStorestringbox, daemon or plane. Without it, Ringleader chooses one when it creates the session and records the choice and the reason in status.transcript.
transcriptStorageRefstringThe name of a Storage in the namespace that a plane transcript is sealed into. Refused unless the store is plane. Default: the namespace’s default Storage.
transcriptRetentionstringHow long sealed transcript segments stay in the Storage. Default 90 days.
transcriptHotWindowstringThe time a recent transcript stays in a cache in front of sealed storage. plane only. Default 30m.
transcriptFreezestringHow long a session may rest before its transcript stops changing. Default: never.
rawTranscriptstringoff, box, daemon or plane. Also keep the agent’s own raw record. It cannot exceed the transcript store. Default off.
retentionstringHow long a session that can no longer be resumed is kept after its last activity. Default 90 days.
resumeWindowstringHow long after a limit ended a session it can still be resumed. No default for a session you start.
poolReleasestringFor a pool session: Done deletes the workstation, and Recycle returns it to the pool. Default Done.
startWorkstationstringNever or IfIdleStopped. Whether the session starts its workstation when the workstation’s idle policy stopped it. Never a workstation a person or a run limit stopped. Default Never.

Naming transcriptHotWindow or transcriptStorageRef with a store other than plane is refused. A transcript store that the workstation cannot reach is refused when you create the session. Transcript storage and retention says how long each store keeps a transcript.

Fields only a session carries

A configuration layer cannot set these, so a layer cannot stop or speak for another person’s session.

FieldTypeDescription
stopped, stopReasonbool, stringStops the session, with a reason of up to 1024 bytes. rl agentsession stop writes them.
done, doneReasonbool, stringMarks the session done, with a reason of up to 1024 bytes.
takesTurnsboolfalse means nobody will send a turn: Ringleader refuses every input and the session ends at the agent’s first turn boundary. It cannot be combined with autoResumePrompt.
autoResumePromptstringThe text sent as the first input after each resume.
displayNamestringA label of up to 64 characters, with no control characters and no space at either end. The owner or an administrator sets it.
restartNoncestringrl agentsession restart writes it.
inputobjectThe input the commands send, approve, deny and interrupt write. Leave it to them.

Phases

PhaseMeaning
PendingThe session waits to start. status.startWait says what it waits on.
StartingThe agent is starting.
RunningThe agent is working.
WaitingForInputThe agent is blocked on a person, for a permission answer or the next turn.
StoppedA person stopped the session, or its workstation stopped. You can resume it.
FailedThe agent failed, an endWhen.failed line matched, or a one-shot session’s last turn failed.
DoneThe agent finished, or a person marked the session done. You can resume it.

A workstation that stops always yields Stopped, never Failed.

Status fields

A session reports a message and no conditions. rl agentsession describe prints the spec, the status and the events.

FieldTypeDescription
phasestringOne of the phases above.
messagestringThe one-line headline.
endedBystringThe declared limit that ended the session: endOnFirstIdle, endWhen, idleTimeout, maxDuration, maxCost, startDeadline or maxAutoResumes. Empty when a person ended it.
stoppedBy, doneBy, resumedByobjectWho did it, when and why.
pendingRequestobjectWhat the agent waits for, a turn or a permission answer.
workstation, agentSessionIDstringThe workstation that runs the session, and the agent’s own conversation id.
cost, usageobjectSpend in US dollars, and token use.
startedAt, lastActivitystringWhen the agent started, and when it last did something.
transcriptobjectThe store in use, the reason Ringleader chose it, the storage it seals into, and keptUntil.
startWait, startWaitReasonstringWhy a Pending session has not started.
appliedConfigs[]objectThe configuration layers that reached the session.
permissions, effort, modelobjectWhat the agent honored, ignored or refused.
steps, autoResume, notesThe session’s runs, its auto-resume count and its notes.

rl agentsession get prints the namespace, name, owner, display name, phase, what the session waits for, the workstation and the age. rl agentsession wait takes a phase name for --for, such as Running or WaitingForInput.

AgentSessionConfig

A configuration layer sets defaults for the sessions it matches. This one gives every session labeled team: platform in the dev namespace the same agent, model and limits:

apiVersion: workstations.ringleader.dev/v1
kind: AgentSessionConfig
metadata:
  name: team-defaults
  namespace: dev
spec:
  selector:
    matchLabels:
      team: platform
  priority: 10
  agent: claude
  model: sonnet
  permissions:
    mode: acceptEdits
  lifecycle:
    idleTimeout: 30m
    maxCost: 5

A member authors a layer for their own sessions, and an administrator authors a shared layer for a team. A session gets a layer when its labels match the selector, or when spec.configs names the layer. rl agentsession create -l team=platform puts a label on a session.

A configuration layer takes every field of the sections “What to run” (except configs and worktreeSetRef), “Permissions and identity” and “Lifecycle”, plus these:

FieldTypeDescription
selector.matchLabelsmapSessions that receive the layer automatically.
selector.workstationLabelsmapSessions whose workstation carries these labels.
selector.ownerScopeboolOnly sessions that the layer’s owner owns.
selector.matchOwners[]objectOnly sessions these owners own. Each entry is {kind, name, namespace}, where kind is a user, a service account or a group.
priorityintThe layer’s place in the order. A lower number applies first.

A selector reaches only sessions that its author has the reach to affect. A layer that a session names in spec.configs always applies. rl agentsessionconfig has no verbs in its help. Create and read a layer with rl apply -f and rl get agentsessionconfig.

How layers merge

Ringleader folds the layers into the session in priority order, and the session’s own fields win:

FieldHow layers combine
Scalars such as agent and modelThe last layer by priority wins. The session’s own value wins over every layer.
envMerged key by key.
permissions.allow, identity and modelParams.extraArgs.<agent>Taken whole, and the session’s own value replaces a layer’s.

rl agentsession get-resolved-configuration fix-login prints the merged result. It lists the layers that reached the session, including those that Ringleader refused and why.

Limits

WhatLimit
NameUp to 253 characters, lowercase letters, digits, - and ..
Display name64 characters.
Stop or done reason1024 bytes.
effortOne word, 64 bytes.
endWhen pattern256 bytes.
maxCostAbove 0, in US dollars.
maxAutoResumes0 or more. Default 5.
MoveA conversation file up to 64 MiB, for claude, codex and pi.

Next steps