Skip to content
Draft, pre-release documentation

A recipe is a named operation for one application, such as “save this graph as a file” or “read the metadata of this photo”. The agent that calls it supplies the inputs. The recipe does the work in the application, checks the result, and returns a receipt. Kasm Session Runtime works out the outcome from those checks, and the recipe cannot overrule it.

An agent that has to find a menu, click through a dialog and then check the result by looking at the screen spends model calls on every step, and can get any of them wrong. A recipe does the same job as a fixed procedure with a recorded check at the end. The agent starts with recipes for that reason, before it looks at the screen or tries a click.

Recipes work for any agent: the one in your workspace, or your own agent calling from outside. Running one needs no model in the runtime. A recipe that looks at the screen to judge something (screen.judge, screen.ground) needs a vision model or the signed-in Claude Code fallback described there. The agent that decides which recipe to call needs a model of its own.

Recipes are installed in packages, one per application. A package holds some or all of these.

Part What it is Who runs it
App guide A README of routes, traps and how to check each result. Every package has one. The agent reads it
Instructional recipe A Markdown file of numbered steps with the points where the agent must decide The agent follows it
Executable recipe An operation with typed inputs and outputs, checks before and after, and time and call limits The runtime
Composite An executable recipe that calls other recipes and asks questions when it cannot decide The runtime

Make a recipe shows how to write each of these.

Every run ends in one of four outcomes. Only verified is success.

Outcome Meaning What the caller does Exit code of recipes run
verified The result was checked and holds Relies on it 0
refused Nothing was changed Reads the reason, fixes the cause, tries again 3
unverified Something may have changed and the check could not confirm it Looks at the application’s state before doing anything else 1
needs_decision The recipe stopped at a question it will not guess Answers it and runs the same operation again 4

Exit code 2 means a usage error, or that no receipt came back and the outcome is unknown.

Neither refused nor unverified is a success, whatever the screen looks like.

The agent calls four recipe methods: recipes.index, recipes.guide, recipes.describe and recipes.run. An MCP client lists them with underscores (recipes_index), and over plain HTTP they are POST /v1/call/recipes.index and so on. Both are part of the same method set as everything else. In a terminal in the session, the same four are kasm-session-runtime recipes subcommands.

Terminal window
kasm-session-runtime recipes index
kasm-session-runtime recipes guide apps/exif
kasm-session-runtime recipes describe exif.read_metadata
printf '%s' '{"path": "/home/kasm-user/Pictures/example.jpg"}' | kasm-session-runtime recipes run exif.read_metadata

The four commands do this:

  • index lists every package, guide and operation that is installed. Each row has its level (1 to 3), its layer (bundled, image or user) and whether it is experimental, meaning no watched run on record. An operation whose application or tool is missing from the session shows as unavailable.
  • guide prints a package’s guide. The index gives the exact path to ask for.
  • describe prints what one operation takes and returns, what it changes and what it checks.
  • run takes the inputs as one JSON object on standard input, up to 64 KiB, and prints the receipt on standard output.

recipes run reads the session token from the environment (KASM_RUNTIME_SESSION_TOKEN), so it works in a terminal inside the session and needs no token on the command line. It talks to the runtime on KASM_SESSION_RUNTIME_PORT, which defaults to 9434.

An agent that has the MCP tools uses them instead of the command line. recipes.run takes operation and arguments, and returns a short receipt with the path to the full one.

Some questions are not the agent’s to answer: a sign-in, a licence agreement, a choice that belongs to the person. A recipe marks these for a person. The runtime then opens the question for the person in the sidebar. The agent tells the person it is waiting, and runs the operation again with the receipt’s resume token and no answer once the person has replied.

The receipt is the only evidence that a recipe ran. The CLI prints all of it. The MCP tool returns the main fields and the path of the full file under the run’s output directory, or the whole receipt when the call passes full: true.

Field What it says
outcome One of the four outcomes
reason Why a run was refused or left unverified
output What the recipe returned, in the shape describe promised
mutated Whether this recipe or one it called dispatched a change
pre_checks, post_checks Each condition checked and whether it held
frames One entry per recipe a composite called, in order, each with the same fields
host_calls Every call the recipe made to the runtime, with its outcome and duration
digest, layer Which package version ran and where it was installed from
decision On needs_decision: the question, the evidence, the answer format and a signed resume token

A step whose result already exists can skip itself. The frame then reads verified with already_satisfied: true and no calls.

A needs_decision receipt carries what the caller needs to answer. The caller runs the same operation with the same inputs, plus the resume token and its answer. A token goes stale if the window closed, the evidence changed or the runtime restarted, and the receipt then asks again under a new token. The CLI prints the exact command to copy on standard error, with the operation and inputs filled in.

Recipes come from three places. The runtime carries a bundled set. A workspace image can add packages under /usr/share/kasm-session-runtime/recipes. A person can add their own under ~/.local/share/kasm-session-runtime/recipes. When two packages define the same operation, the later layer wins: bundled, then image, then user. Removing a user package restores what was underneath.

Packages are trusted by where they are installed. Nothing asks anyone to approve a package, and a package in any of the three places runs. Install recipes and playbooks covers the image layer for administrators.

The bundled set has these packages.

Package Operations What it covers
exif 1 Reads the embedded metadata of any file ExifTool reads
libreoffice 1 Connects to a visible LibreOffice instance for scripted control
maltego 14 Views, graphs, imports, links and exports in Maltego
obsidian 1 Opens a note in Obsidian
slack 8 Lists, reads and replies to conversations in Slack

Two guides have no operations: a browser guide for one professional networking site, and a vault guide for Obsidian. The image or the user layer may add more.

To see what a particular workspace has, run kasm-session-runtime recipes index, or call recipes.index from your agent. The layer column says where each row came from.

A recipe’s helper programs, such as ExifTool in exif.read_metadata, run in a sandbox. The filter that limits the system calls they can make is always on, and filesystem rules are added where the kernel supports Landlock. The receipt records which tier applied. See what the runtime can reach.