Skip to content
Draft, pre-release documentation

Recipes are checked operations an agent can call, and playbooks are task briefs a person starts from the sidebar. The runtime ships a small set of both. You can add your own for everyone who uses a workspace by putting them in the image.

Recipes and playbooks load from three places. A later layer replaces an earlier one that has the same ID.

Layer Location Who puts it there
Bundled Inside the runtime Kasm
Image /usr/share/kasm-session-runtime/recipes and /usr/share/kasm-session-runtime/playbooks You, at image build, for every user of the workspace
User ~/.local/share/kasm-session-runtime/recipes and .../playbooks A person, for themselves, usually by asking their agent

Removing a replacement shows the layer beneath it again. A recipe’s receipt and the recipe index report which layer an operation came from (bundled, image or user). kasm-session-runtime recipes check names each bundled operation a user package replaces.

The user layer is in the session user’s home. It survives between sessions only with a Kasm persistent profile.

Nothing is approved before it runs. A package or playbook is trusted because of where it is installed: the image layer carries your decision as the image’s owner, and the user layer carries the person’s.

What applies to all three layers:

  • Programs a recipe starts as helpers run in a sandbox: seccomp always, and Landlock filesystem rules where the kernel supports them.
  • Every run produces a receipt, and only a verified outcome is success.
  • Sign-in, licence and consent screens stay with the person.

A user-layer package can do whatever the session user can do. The session container is the isolation boundary (What the runtime can reach).

To see what a host gives helpers, run this in a session of the image:

Terminal window
kasm-session-runtime sandbox probe --json

It reports tier as full (Landlock ABI 6 or later), partial (ABI 1 to 5) or none (no Landlock), and helpers as isolation_unavailable when not even seccomp can be installed. It always exits 0. Recipes whose helpers need isolation the host cannot give are unavailable, and the sidebar hides the playbooks that use them.

Recipe bodies run in a separate worker program. Without it, recipes that have a body are refused. Install it once, as root, in the image build, after the runtime binary is in place:

Terminal window
kasm-session-runtime recipe-worker install

This writes the worker and its library to /usr/local/libexec/kasm-session-runtime, verifies both against the runtime, and runs the worker’s own check. The stock-image layer does this for you.

Command Use
recipe-worker install [--dir DIR] Install into DIR, default /usr/local/libexec/kasm-session-runtime
recipe-worker --check [--dir DIR] Verify an installed worker without writing

Install exits 3 when the image lacks the glibc loader the worker needs. KASM_RUNTIME_RECIPE_WORKER takes an absolute path to use a worker installed somewhere else.

An image layer for recipes has the layout of a recipe package catalogue: a catalogue.json with a revision, and one directory per application holding recipe.json, operations.py and a README.md guide. Make a recipe for your application produces this layout.

{ "revision": "1.0.0" }

A playbook is <id>.json for its metadata, with its steps in <id>.md beside it. Write a playbook describes the fields.

Copy both into the image:

COPY my-recipes/ /usr/share/kasm-session-runtime/recipes/
COPY my-playbooks/ /usr/share/kasm-session-runtime/playbooks/

Keep both folders owned by root. An invalid entry stops the catalogue loading, so check them in the build.

Run recipes check on the image layer’s folder. It prints a JSON report with "ok": true and exits 0 when the packages load, and exits 1 when it finds problems:

Terminal window
kasm-session-runtime recipes check /usr/share/kasm-session-runtime/recipes

With no folder it checks the user layer. To see the brief an agent receives for a playbook:

Terminal window
kasm-session-runtime playbooks brief <id>

The sidebar lists a playbook only when the workspace has what it needs. Each playbook names the applications it requires and the recipes it uses, and one with an unmet need stays hidden. An image with only a browser offers only the playbooks a browser satisfies.