Personas API
Read Personas first for the record-versus-binding model. This page focuses on the concrete HTTP and CLI surface.The two layers
- A persona record is a daemon-owned template stored under the state root and updated through
/v1/personas. - A session persona binding is one immutable snapshot copied into session metadata.
- updating a persona record does not retcon existing sessions
- each session keeps the exact persona snapshot it bound
- sidechains inherit the parent session’s current persona snapshot when they are spawned
Persona record endpoints
GET /v1/personasPOST /v1/personasGET /v1/personas/{persona_id}PUT /v1/personas/{persona_id}
GET /v1/personas accepts one optional query parameter that matches persona identifiers and display names by substring.
POST /v1/personas accepts:
persona_idoptional caller-selected identifierdisplay_namesoulcapability_scopeoptional capability baseline inherited by future bound sessionsdefault_skillsoptional inline skill assignments resolved and frozen into future session bindingsmetadataoptional JSON metadata
personas import reads the Markdown file as the persona soul.
Import rules and options:
- only
.mdand.markdownfiles are accepted --display-nameoverrides the derived name- otherwise the first Markdown heading becomes the display name
- if the file has no heading, the file stem is used
--capability-scope-jsonand--capability-scope-filecan attach one capability baseline at import time--default-skills-jsonand--default-skills-filecan attach persona default inline skills at import time--metadata-jsonand--metadata-filecan attach metadata at import time
PUT /v1/personas/{persona_id} can replace:
display_namesoulcapability_scopedefault_skillsmetadata
soul, the latest capability_scope, and the latest default_skills.
Session persona endpoints
POST /v1/sessions/{session_id}/personaPUT /v1/sessions/{session_id}/personaDELETE /v1/sessions/{session_id}/persona
POST and PUT both bind the specified persona to the session by copying the current persona snapshot into session metadata. DELETE clears the bound persona from the session.
These mutation endpoints are intentionally stricter than normal session input:
- they only succeed while the session is idle for topology mutation
- they are blocked by active or queued runs, pending approvals or questions, mailbox backlog, waiting agent states, or live descendants
- they do not mutate queued or suspended work in place
- they update the session snapshot returned by
GET /v1/sessions/{session_id} - they freeze the persona’s current
soul,capability_scope, and resolveddefault_skillsinto the session binding
Session creation and listing
POST /v1/sessions accepts one optional persona_id field:
session_id already exists, the daemon can reuse that existing session. In that case, a supplied persona_id must match the session’s existing bound persona or the request is rejected.
GET /v1/sessions accepts one optional persona_id query parameter:
Session persona summary shape
Session list and detail responses return only a compact persona summary:soul. Use GET /v1/personas/{persona_id} when you need the latest mutable persona record itself.
The corresponding session detail also exposes:
- the persisted session
capability_scope - the derived
effective_capability_scope
Runtime semantics
The bound session persona snapshot is injected into the runtime system prompt as a dedicatedpersona section when the binding has non-empty instructions and the daemon is not running with a global override_prompt.
That gives Kheish two stable properties:
- resumed runs and restored runtimes keep the same session persona after restart
- child sidechains inherit the parent snapshot that existed at spawn time rather than following later persona edits
- the persona capability baseline used to compute the session’s effective capability scope
- the persona default inline skills that seed the runtime’s active inline skill set
CLI equivalents
The daemon CLI exposes the same surface:kheish-daemon personas listkheish-daemon personas createkheish-daemon personas importkheish-daemon personas getkheish-daemon personas updatekheish-daemon sessions create --persona-id ...kheish-daemon sessions set-persona ...kheish-daemon sessions clear-persona ...
--capability-scope-jsonor--capability-scope-file--default-skills-jsonor--default-skills-file
