# Boujot isolation service

Status: implemented Linux service; release and installation procedure in
[isolator/README.md](../isolator/README.md). Written in Simplified Technical English.

## 1. Purpose

Boujot installed from npm runs each runtime (Codex or Claude, plus its model) as the
daemon's own OS user. A hijacked runtime can then read that user's files: the machine
credential (`~/.boujot/access.key`), SSH keys, other conversations.

The isolation service removes this caveat. It runs each runtime under its own OS
identity, with access to its own files only. Boujot works without it. When it is
installed and configured, the daemon uses it and never falls back to the direct launcher.

## 2. Trust model

| Component | Runs as | Trusted for |
|---|---|---|
| Isolation service (`boujot-isolator`, Rust) | root | Creating identities and environments; starting, signalling and observing runtimes |
| Boujot daemon | the machine owner (for example `g`) | The user's credentials, the conduit proxy, slot ownership |
| Runtime | a per-runtime identity | Nothing |

The service does not trust the daemon. The daemon asks; the service applies fixed rules:

1. It starts only the configured Boujot runtime command. The daemon cannot choose the program.
2. The daemon cannot choose the identity or the paths that are shared with the runtime.
3. Environment variables pass only through an allow-list.
4. Every file operation stays inside the runtime's own folders.

## 3. Transport and protocol

- Unix socket, owned `root:<owner's primary group>`, mode `0660`. The installer refuses a
  group that contains another user, so only the owner's daemon can connect. Runtimes are
  not in that group.
- One JSON object per line, request and response. Each request has an `id`.
- The service identifies the caller with `SO_PEERCRED` (Linux) or `getpeereid` (macOS) and logs it.
- One environment per conversation: its persistent state. A conversation has any number of
  runtimes over time and at most one live runtime (the service refuses a second launch).

| Operation | Request | Response |
|---|---|---|
| `hello` | `{}` | `{protocolVersion: 1, version, backend, stateViewRoot, envAllowList, reservedEnv, daemonSharedDir, codexHomeManagedFiles, claudeHomeManagedFiles, claudeProgramMounted, agentFolderWritesNamed, homeStartFilesReset, homePerRuntime, codexHomeResetTrees, runtimesListed}` |
| `create_environment` | `{conversationKey}` | `{workspace, contextRoot, outboxRoot, codexHome, claudeHome, daemonStateFile}` (paths as the runtime sees them; `claudeHome` since 0.4.0; `home` only before 0.4.2, which gives each runtime its own) |
| `write_files` | `{conversationKey, target: "workspace"\|"codex_home"\|"claude_home", files: [{path, contentBase64, mode}], forRuntime?}` | `{written}`; for `codex_home` and `claude_home` also `{removed}`. Since 0.3.0, of `auth.json`, `config.toml`, `models_cache.json` in `codex_home`, those not written are removed, without following a link, so a reopened conversation keeps no earlier login; the daemon refuses Codex starts on a service whose `hello` does not name `codexHomeManagedFiles`. Since 0.4.2 also `.env` and `environments.toml`, which the daemon never writes (nor copies from its own Codex home): Codex loads `.env` into the environment of every command it runs and, at a thread's start, starts the program of the default environment `environments.toml` names or connects to its address (probed with Codex 0.154.0, 22 October 2026); the daemon refuses Codex starts on a service that does not name both. Since 0.4.2 a managed name is cleared with the bounded tree removal that follows no link, also when a runtime left a folder in its place (unlinked as a file, a folder had made every later write fail), and a folder where a managed file is written is removed before the write. Since 0.4.0 the same for `.credentials.json` (Claude's login file), `settings.json` and `settings.local.json` in `claude_home`: the daemon writes only the login, so a hook or helper an earlier runtime left in the settings never runs in the next one; Claude's own files there (conversations) stay; the daemon refuses Claude starts on a service whose `hello` does not name `claudeHomeManagedFiles` or says `claudeProgramMounted: false`, and writes to `claude_home` while the runtime runs (item 7). Since 0.4.0 a write to `codex_home` or `claude_home` is refused (`runtime_slot_occupied`) while a runtime of the conversation is live, unless `forRuntime` names that runtime (a renewed login), so a start the service would refuse changes nothing; `hello` says `agentFolderWritesNamed` |
| `launch` | `{conversationKey, agent, env, networkRequired?}` | `{runtimeId, status}`; `networkRequired: true` refuses before mutation when owner-configured network enforcement is unavailable |
| `network_evidence` | `{runtimeId}` | Live root-observed process, cgroup, network namespace, pinned policy and probe hashes, or refusal. See [project-operation network enforcement](project-operations-network.md). `hello.networkEvidenceVersion: 1` advertises this API; it is not evidence of a protected runtime. |
| `signal` | `{runtimeId, signal: "SIGTERM"\|"SIGKILL"}` | `{sent}` |
| `status` | `{runtimeId}` | `{state: "running", pid}` \| `{state: "stopping"}` \| `{state: "exited", code, signal}` |
| `read_diagnostics` | `{runtimeId, stream: "stdout"\|"stderr"\|"fatal", tailBytes}` | `{contentBase64}` |
| `list_environments` | `{}` | `{conversationKeys}` |
| `read_outbox` | `{conversationKey}` | `{files: [{path, sha256, contentBase64}]}`: at most 1,000 files of at most 1 MB, in name order. Since 0.4.2 at most 10,000 names are read, counted as they are read; an outbox with more is listed in part, as one with more than 1,000 files always was. A name that is not UTF-8 is skipped with all it holds (it cannot be named to the daemon), after the sort and without taking a file's place, so the other files keep their order. A name gone since its folder was read (the runtime's writer renames its `.pending` files) is skipped; it had failed the whole read. The daemon mirrors each conversation's outbox on its own, so one that fails is logged and read again at the next sync |
| `remove_outbox_files` | `{conversationKey, files: [{path, sha256}]}` | `{removed}` (only files that are unchanged) |
| `find_runtime` | `{pid}` | `{runtimeId, conversationKey}` or `{runtimeId: null}` |
| `list_runtimes` | `{}` | `{runtimes: [{runtimeId, conversationKey}]}`: every runtime not yet forgotten (since 0.4.2, `hello` says `runtimesListed`), for the daemon's cleanup round (§7) |
| `forget_runtime` | `{runtimeId}` | `{forgotten}` (exited runtimes only; the conversation state stays). Since 0.4.2 it first removes the runtime's own home, bounded and without following a link, and answers `homeRemoved`. A home past the entry bound refuses the request and the runtime stays known (each try removes up to the bound, so a later one finishes); a home no try can remove (a link or a file in place of a folder on its path, a chain deeper than the bound) is left in place, inert, and the runtime is forgotten (`homeRemoved: false`) |

Fixed rules:

- `runtimeId` is generated by the service (128 random bits). `conversationKey` is
  `[A-Za-z0-9_-]{1,120}`. Relative paths have plain segments only (no `..`, `.`, empty
  segment, absolute path).
- `launch` starts only `runtimeCommand + [agent, --happy-starting-mode, remote, --started-by,
  daemon]`, with `agent` in `claude`, `codex`, `gemini`. Unknown request fields are refused.
- Environment: names must match the allow-list; the service sets `HOME`, `PATH`, `TMPDIR`,
  `HAPPY_HOME_DIR`, `CODEX_HOME`, `CLAUDE_CONFIG_DIR` (since 0.4.0), `HAPPY_SESSION_OUTBOX_ROOT`,
  `HAPPY_DAEMON_RUNTIME_STATE_FILE`, `BOUJOT_CHILD_DIAGNOSTICS_DIR` and `GIT_CEILING_DIRECTORIES`
  (since 0.4.2) itself (a request that sets one is refused). Values with control characters are refused. Secrets reach systemd
  in a root-only environment file that is deleted after the start, never on a command line
  or in a unit property.
- Files in runtime-owned folders are written and read with `O_NOFOLLOW` on every path
  component and replaced by `renameat`: a link planted by a runtime is never followed.
- Every runtime has a new, empty home of its own (since 0.4.2, `hello` says `homePerRuntime`):
  `HOME` is `runtimes/<runtimeId>/home` in the conversation's state, made by the launch (owned by the
  conversation's identity, mode `0700`; anything already in its place refuses the launch) and removed
  when the runtime is forgotten. Before, all runtimes of a conversation had its `home/`, so what one
  runtime left there was read or run by the next one, which holds that start's login and Agent Plane
  capability: shell startup files (Claude Code's Bash tool sources the rc file into its shell snapshot,
  Codex runs commands with `bash -lc`), git's `~/.gitconfig` and `~/.config/git/config`, Python's user
  site, npm's `~/.npmrc`, and Node's legacy global folders `~/.node_modules/` and `~/.node_libraries/`
  (the runtime's own Node process falls back to them for a module it requires optionally). Nothing
  needs a home that lasts: Claude keeps its state in `CLAUDE_CONFIG_DIR` (`claude-home/`), Codex in
  `CODEX_HOME` (`codex-home/`), Boujot in `HAPPY_HOME_DIR` (per runtime). The service makes no `home/`
  any more and does not reset one: no runtime it starts has it, a runtime of an older service holds the
  conversation's slot until it ends, and the daemon refuses starts on a service without
  `homePerRuntime`. A `home/` an older service made stays as it was; no runtime has it as its home.
- Every `launch` first removes, in the conversation's Claude folder only and without following a link
  at any level, its `session-env/` and `shell-snapshots/` trees (since 0.4.2, `hello` says
  `homeStartFilesReset`): Claude Code runs the scripts and snapshots there ahead of Bash commands, so a
  runtime could leave startup code there for the next one. It also removes `rules/` in the Codex folder
  (since 0.4.2, `hello` names it in `codexHomeResetTrees`): Codex loads the execpolicy rules there at a
  session's start, and one rule lets a command run without asking (`codex execpolicy check`, 22 October
  2026). Codex writes there only for an "always allow" amendment, which Boujot never asks for. Checked
  and not removed: `hooks.json` (its hooks run only with a `trusted_hash` in `config.toml`, which is
  managed), plugin manifests in the Codex folder (they started nothing) and the plugin marketplace
  (synced into a new folder of a random name).
- The conversation's state root, the workspace's parent, belongs to the runtime as well, so a runtime
  could leave a `.git` there. Git run in the workspace when the workspace holds no repository of its own
  (the usual case) finds that one and uses its settings, among them `core.fsmonitor`, a program that
  `git status` starts (shown with git 2.43 by the fourth review of 22 October 2026). Since 0.4.2 the
  launch sets `GIT_CEILING_DIRECTORIES` to the state root (`<stateViewRoot>/<conversationKey>`), so git
  does not go up into it from the workspace, and every `launch` sets a `.git` it finds in the state root
  aside (one rename whatever it is, never walked), for programs that look for a repository on their own.
  Not covered: Claude Code also reads `CLAUDE.md` files from the workspace's parent folders, the state
  root among them, so a runtime can leave instructions there for the next one. That is text in the
  model's context, nothing that runs: a prompt-level risk, accepted as such (fourth review of
  22 October 2026).
- Not reset by the service: the workspace's own Git repository (`workspace/.git`, its configuration and
  the filters and helpers it names). Git reads it whenever something runs Git in the workspace, also
  Claude Code's `git status` at its start, so what one runtime writes there runs in the next one. The
  workspace is the conversation's work and persists by design. Boujot's own Git use and fsmonitor are
  covered by the owner's decision 142 b in a separate change; filters in the agent's own repository are an
  accepted risk under that decision (second review of 22 October 2026). It runs only when no runtime of the
  conversation is live (the launch is refused first) and after it, so a start the launch would refuse
  changes nothing. `projects/` (needed to resume a Claude session by id) and Claude's other files are
  not touched. `BASH_ENV`, `ENV` and `ZDOTDIR` are environment, not files, and the daemon's allow-list
  cannot set them.
- These removals (the reset and a forgotten runtime's home) are bounded: at most 64 levels deep and
  100,000 entries, counted while each folder is read, and names are handled as bytes (a name that is
  not UTF-8 is removed like any other). A tree past the entry bound refuses the request after removing
  at most that many entries, rather than stalling the service under its lock; the next request goes on
  from there. A tree deeper than the bound, which no removal ever gets through, is set aside instead: one
  rename in its own folder to a name starting with `.boujot-isolator-set-aside-`, which no agent reads,
  and the request goes on (it had refused every later start of the conversation; third review of
  22 October 2026). Likewise `create_environment` and every `launch` make the state's own folders
  (`workspace/`, `outbox/`, `codex-home/`, `claude-home/`, `contexts/`, and `runtimes/` at a launch)
  folders again, setting aside a link or a file a runtime left in place of one; the service never
  follows it.

## 4. Shared items between daemon and runtime

| # | Item | Channel under isolation |
|---|---|---|
| 1 | Daemon control port (`daemon.state.json`) | The daemon publishes a copy into `daemonSharedDir`; the service mounts that folder read-only at `/run/boujot`. The copy holds the port and no secret: the daemon's control token stays in its own 0600 file |
| 2 | Session message outbox | Inside the runtime state. The daemon mirrors it into its own outbox folder (`read_outbox`) before every outbox gate and replay pass; files the daemon delivered are removed with `remove_outbox_files`. One mirror run per conversation at a time, each file through a temporary name of its own. Since 0.4.2 a conversation's outbox is mirrored only for its own sessions: the daemon binds each session to its runtime's conversation when the runtime reports it (the session webhook, after the process identity check; again from the daemon's registry when it re-adopts the session after a restart), the first binding wins, and the bindings are kept in the record of isolated conversations. A folder of any other session, or a file outside a session folder, is not mirrored and is reported once: before, one runtime could place records (a session end too) under another conversation's session, which the daemon then replayed as that session's (third review of 22 October 2026). A session that exited before this version and was never bound stays unmirrored; its records stay in its conversation's outbox |
| 3 | Prepared workspace files | `prepare-agent-plane-session` goes to the launcher: `create_environment` + `write_files` (target `workspace`); the returned workspace path is the spawn directory |
| 4 | Codex context (thread history, `writer.lock`) | Inside the runtime state, private |
| 5 | Codex model configuration | `auth.json`, `config.toml`, `models_cache.json` from the daemon's Codex home, `write_files` (target `codex_home`) at each launch; the daemon's own `.env` and `environments.toml` are never copied, and the service removes any in the conversation's folder (§3). A ChatGPT login arrives without its refresh token, renewed first in the daemon's home when over a day old (`src/daemon/sandboxCodexAuth.ts`) |
| 6 | Runtime home, logs, stdout and stderr | Each runtime's own home inside the state (`runtimes/<runtimeId>/home`, new and empty at its launch, removed when it is forgotten; since 0.4.2), Boujot's folder beside it (`happy-home/`); stdout and stderr in service-owned files. After the exit, the daemon copies them (and `fatal-error.json`) into its diagnostics folder, so `boujot daemon session-logs` works unchanged. Nothing one runtime leaves in its home (shell startup files, git's configuration, Python's user site, Node's legacy global folders) reaches the next one, and every launch first removes Claude's `session-env` and `shell-snapshots` trees (§3 fixed rules), so startup code one runtime leaves never runs in the next one with its token |
| 7 | Claude's login | `.credentials.json` in the conversation's Claude folder (`claude-home/`, Claude's `CLAUDE_CONFIG_DIR`), `write_files` (target `claude_home`): at each launch, and again into every running Claude runtime each time the daemon renews the login. It holds the access token only, never the refresh token. The login lives in the daemon's own Claude folder, outside every sandbox; Claude renews it there in its last 5 minutes, and a renewal revokes the previous access token at once, so the new one is written right away; a running Claude reads the changed file before its next request (`src/daemon/sandboxClaudeLogin.ts`, measured with Claude Code 2.1.289). A start that sends Claude elsewhere (a gateway address, Claude's own proxy settings, a Unix socket, its certificate store) writes no login file, and every start of another agent removes it, as every non-Codex start removes the Codex login. All writes into Claude folders go through one queue; each round (30 s while a Claude session runs) writes the current token into every running conversation that does not have it, so a failed write or a login made again while the daemon was stopped is set right at the next round |

Network: the default file/process contract does not restrict network access. The optional
owner-configured [project-operation gate](project-operations-network.md) permits only exact
loopback relays to the daemon control server, Conduit and approved gateways; direct external,
host-service and Unix-socket access is denied.
On the control server its capability opens the `/runtime-*` endpoints and the
two session reports, for its own process only. It cannot list, start, stop or
prune sessions, or stop the daemon (`src/daemon/controlAccess.ts`).

## 5. Linux backend (systemd `DynamicUser`)

Each runtime is a transient unit `boujot-rt-<runtimeId>.service`, started with
`systemd-run` (systemd 247 or newer). Each conversation has a stable identity name
(`bjrt-<random>`), so its state keeps one owner and is not re-owned at each launch.

| Property | Effect |
|---|---|
| `DynamicUser=yes`, `User=bjrt-…` | An unprivileged UID and GID for the conversation |
| `StateDirectory=<name>/<conversationKey>` | Persistent private state: `workspace/`, `contexts/`, `outbox/`, `codex-home/`, `claude-home/`, `runtimes/<runtimeId>/` (`home/` until the runtime is forgotten, `happy-home/`, `diagnostics/`, `tmp/`) |
| `WorkingDirectory=/var/lib/<name>/<key>/workspace` | The workspace |
| `ProtectHome=yes`, `ProtectSystem=strict` | `/home` is not visible; the file system is read-only except the state |
| `PrivateTmp=yes`, `PrivateDevices=yes` | Private `/tmp`; no devices |
| `NoNewPrivileges=yes`, `CapabilityBoundingSet=`, `RestrictSUIDSGID=yes` | No privilege gain |
| `ProtectKernel*`, `ProtectControlGroups`, `ProtectClock`, `LockPersonality`, `RestrictRealtime`, `RemoveIPC` | Kernel surfaces closed |
| `RestrictNamespaces=user mnt pid net ipc uts`, `SystemCallFilter=@system-service @mount seccomp`, `RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK` | Normal sockets and system calls, plus what the Codex command sandbox (bubblewrap) needs: nested namespaces, its own seccomp filter, netlink for loopback. Nested namespaces cannot unlock the locked mounts (`ProtectHome`, read-only system); the suite checks this |
| `BindReadOnlyPaths=<daemonSharedDir>:/run/boujot` | Item 1 |
| `BindReadOnlyPaths=<resolved source>:/opt/boujot/…` | Programs (`runtimeMounts`): the Boujot package, Node, Codex, Claude. Sources are resolved at each launch, so upgrades need no reinstall |
| `InaccessiblePaths=<privateRunDir>` | Environment files of other launches |
| `StandardOutput=append:…`, `StandardError=append:…` | Diagnostics in `<diagnosticsRoot>/<runtimeId>/` |
| `KillMode=control-group`, `TimeoutStopSec=5` | A stop ends every process of the runtime |
| `MemoryMax=`, `TasksMax=` | Resource limits from the configuration |
| `ExecStopPost=+boujot-isolator record-exit …` | Exit record, written as root after every runtime process is gone |
| `EnvironmentFile=-<privateRunDir>/<runtimeId>.env` | Secrets for the start; deleted right after it (systemd reads the file for every command, so a missing file is ignored after the start) |

Stop: `SIGTERM` goes to the main process (the runtime ends its own children; when it exits,
systemd ends the rest of the control group). `SIGKILL` goes to every process.
Exit proof: the unit is inactive (its control group is gone) and the exit record exists.

Install: `isolator/install/linux/install.sh` (root). It installs the binary, the
configuration `/etc/boujot-isolator/config.json` and the unit `boujot-isolator.service`,
and with `--security-test` a second instance whose runtime command is the probe.
Since 0.5.0, the installer requires both root services stopped and no live runtime unit. It preserves
existing configurations and units; an explicit `--network-policy` changes only the main policy and
its exact gateway-token environment permission. Build as an ordinary user, drain chats before
maintenance, and use `--no-start` to leave the installed services stopped until the CLI is updated.
Codex is mounted as its whole folder (`--codex-dir`, at `/opt/boujot/codex`, first on the
runtime `PATH`): Codex runs commands through `codex-code-mode-host` beside it. For the
standalone Codex the folder is `<home>/.codex/packages/standalone/current/bin`, a link that
each launch resolves again, so a Codex update needs no reinstall.
Claude is given as `--claude <program>` or left out with `--without-claude` (one of the two is
required). Claude's native install is one file; the stable link `<home>/.local/bin/claude` is
mounted at `/opt/boujot/claude/claude` as the version it points to at each launch. A Claude
installed with npm is a script that needs its package folder, and is refused.

## 6. macOS: not isolated (decision 2026-09-25)

macOS runs Boujot with the direct launcher only. Reason: macOS does not allow a Seatbelt
sandbox inside another one (`sandbox_apply: Operation not permitted`, even with an
allow-all profile). A Seatbelt-sandboxed runtime would therefore switch off Codex's own
command sandbox, and separate users without Seatbelt depend on file permissions across the
whole disk (a home folder is world-readable by default). The known caveat of the direct
launcher stays on Macs.

## 7. Daemon integration

- `BOUJOT_RUNTIME_LAUNCHER=isolated` with `BOUJOT_ISOLATOR_SOCKET=<path>` selects the
  isolated launcher (`src/daemon/isolatedRuntimeLauncher.ts`, kept by
  `src/daemon/contractKeepingIsolatedLauncher.ts`). The daemon asks `hello` at start, before
  each start of a runtime and every 5 seconds. While the service does not answer, the daemon
  runs, starts no runtime and reports `refusing` with `isolator_unavailable`. It never falls
  back to the direct launcher. Unset (or `direct`) is the npm-only install.
- Execution contract (since 19 October 2026, `src/daemon/executionContract.ts`): v1 is this
  service's file and process isolation; it makes no claim about the network. A daemon without
  the service starts no runtime unless the machine's user ran
  `boujot machine-settings run-sessions-here on` on the machine (a supported choice: "Use my Mac").
  The machine-wide shell, files and SSH have their own switches (`shell-and-files`, `ssh`), off by
  default; turning sessions on does not turn them on. While `shell-and-files` is off, a
  session's shell and file handlers answer only the app's Git views (its fixed commands, run without a
  shell and without the repository's own helper programs), file reads and file search inside the
  session's folder (`src/modules/common/sessionAppViews.ts`, step 131 c). A runtime of this
  service reads the settings in its own home: the machine's switch does not reach it, and what
  the session may write there opens nothing outside the service. Also while it is off, a start
  that brings its own MCP servers (`codexMcpServers`) is refused, and a session preparation may
  give Claude only http tool servers with literal settings (step 132 a).
  The daemon publishes what it
  actually does in the machine's metadata, key `executionContract`:
  `{version: 1 | null, mode: "isolated" | "without_contract_by_local_choice" | "refusing",
  isolatorVersion, cliVersion, reason: "no_isolator_configured" | "isolator_unavailable" | null}`.
  A reader relies on it only while `cliVersion` equals `happyCliVersion`. A refused start is a
  `spawn_rejected` with `execution_contract_not_met` (not retryable) or
  `isolation_service_unavailable` (retryable).
- `hello` carries the service's own `version` (since isolator 0.2.0); a service without it is
  reported with `isolatorVersion: null`.
- Under isolation the daemon accepts Agent Plane spawns only into service-owned workspaces
  (`<stateViewRoot>/<conversationKey>/workspace`); other folders are refused.
- Off-login history (owner's decision 139 C, 22 October 2026; `src/daemon/offLoginHistory.ts`): a
  runtime off this machine's logins marks its conversation with its kinds (`gemini`, `proxy`,
  `local_model` for a model address on loopback or a private network, written as an address, not
  resolved; `gateway` for any other, and for Claude's provider switches without an address: Bedrock,
  Vertex, Foundry and its resource name, Anthropic on AWS or Google Cloud, Mantle, a gateway; a plain
  provider key is not one) and the time of the first mark, in the daemon's record of isolated
  conversations. A start on the owner's login there (Claude on the machine's Claude login, Codex staging
  the machine's own `auth.json`) is refused before anything runs, as the spawn failure
  `{code: "off_login_history", retryable: false, offLoginHistory: {kinds, since}}`; Agent Plane shows its
  card, and on Continue sends `offLoginAcknowledgement: {conversationId, kinds, since}` with the spawn.
  The start that names exactly the current mark runs, and is recorded; a run off the logins after it
  marks the conversation anew, so a new card is needed. Codex starts on the login were allowed until
  this version: in a conversation marked before it, the next one gets the card too. A record written
  before this version marks its conversations as `gateway`, since they are first read. Until Agent Plane's card is live
  (agreed with its maintainer, 22 October 2026), all this applies only to a spawn that says
  `offLoginAware: true` (`true` or absent, nothing else); any other start meets the rule as before:
  Claude on the login in a marked conversation is refused with the old plain failure ("Start a new
  conversation for Claude"), Codex is not checked, an acknowledgement is ignored, and the mark is kept.
- The daemon's slot ownership, exit proof, typed failures and diagnostics are the same for
  both launchers: they use the launcher interface only (`src/daemon/runtimeLauncher.ts`).
- Cleanup round (since 0.4.2, every 30 seconds, `src/daemon/isolatedRuntimeLauncher.ts`): the daemon
  asks `list_runtimes` and forgets each exited runtime it does not watch itself, with the same steps as
  its own (diagnostics copied into the session's folder once, the outbox mirrored, then
  `forget_runtime`, which removes the runtime's home): one a previous daemon started (after a restart
  the daemon only re-tracks it by pid), one that exited while no daemon ran, one whose forget failed (a
  home past the bound, removed in parts at each try). Before, nothing forgot them, so their records and
  homes stayed. The launch writes `isolated-runtime.json` (runtime id, whether its diagnostics were
  copied) into the session's diagnostics folder, so the round of a later daemon finds that folder. The
  round runs in the background, one at a time, and holds only the lock of the conversation it looks at.

## 8. Security test suite

The suite runs a real runtime under the service. From inside the runtime, each attempt
below must fail:

1. Read any file under the daemon user's home (`~/.boujot/access.key`, `~/.ssh`).
2. Read or signal another runtime, or read its state.
3. Signal the daemon or read its memory.
4. Connect to the service socket.
5. Gain privileges (`sudo`, setuid programs).
6. Survive a stop: no process is left after `signal SIGKILL` and `status exited`.
7. Make the service start another program, by a changed request from a `boujot` group member.

It also checks the required channels (workspace writes, the `/run/boujot` mount, loopback
connections), that a second live runtime per conversation is refused, and that links planted
by a runtime are never followed by the service. Every planted link points at a folder the suite
makes for the test, never at a system folder. One runtime plants shell, git, Node and Python files
(and links) in its home and files (and links in their place) in Claude's `session-env` and
`shell-snapshots` folders; after it is forgotten, the next runtime must have a new, empty, private
home of its own, find the previous home and Claude's two trees gone and `projects/` kept, and the
suite's folder must be unchanged. Another plants `.env`, `environments.toml` (a link) and execpolicy
rules in Codex's folder; after the next start's write of that folder and its launch they must be gone
and Codex's sessions kept. The first one also leaves a Git repository in the state root: the next
runtime must find it set aside, have `GIT_CEILING_DIRECTORIES` set to the state root, and get no
repository from `git rev-parse` in the workspace for one it plants there itself, which git finds once
the variable is unset.
`list_runtimes` must name a runtime until it is forgotten.

Run: `node isolator/tests/security-suite.mjs --socket /run/boujot-isolator-sectest.sock
--state-name boujot-sectest` as the owner, against the security test instance.

The Path B conduit is checked end to end with the real daemon: an Agent Plane turn on an
isolated runtime calls an allowed tool through the proxy, and a disallowed tool is refused.
