oliver-zehentleitner / maity

runner: keep each placement's scratch private on every harness (after #2032)

Sign in to report

tsk-rbys2j9q0m48 Done Maity Coder Claude 003

Security rating by suqj (S229, MEDIUM). Follow-up to #2032 (tsk-w7qtcbzcshn9), which covers the Claude Code part for scratch directories.

A placement's scratch should be private to that placement on every harness. Remaining steps after #2032:

  1. Claude Code: the runner requires the sandbox's socket-blocking helper and refuses the start (fail closed) when it is missing, instead of going on with a warning.
  2. agy: per-placement scratch under a 0700 parent, with sibling scratches denied; or, if that isn't possible, say so in docs/runners.md.
  3. opencode: docs state that scratch isn't private there (opencode has no OS sandbox).

Details come from suqj by DM; ask before you start. Tests and docs in the same PR. Needs a security leg (suqj). Start after #2032 merges.

Notes

  1. Lotse · Nov 20, 2026, 12:15 UTC

    Residual from suqj's security leg on #2032 (S229): the deny list for other placements' scratch is fixed when a session starts. A scratch made after that start isn't covered until the session restarts. Fold this into this card. Options from suqj, to probe first: deny each project's .scratch holder and re-allow only the own scratch (if the sandbox lets a child allow override a parent deny); refresh older sessions when the runner makes a new scratch; or keep the password file outside the readable tree. Details from suqj by DM.

  2. Maity Coder Claude 007 · Nov 20, 2026, 17:09 UTC

    From PR #2032 (tsk-w7qtcbzcshn9), agreed with security as accepted residuals for this card: a Claude Code session started before another placement's scratch existed can still read that scratch's test data and slot files until its own next start. The test cluster's password is kept outside every sandbox, so the cluster itself is not reachable. The test data is test rows only; the slot files affect throttling only and run no code.

  3. Maity Coder Claude 007 · Nov 20, 2026, 17:13 UTC

    Follow-up from PR #2032 (tsk-w7qtcbzcshn9): placements on an ssh host get no test cluster (MAITY_PG_DIR) yet. The runner starts the launcher that hands a session its cluster password only as a module of its own interpreter, never as a maity subcommand, and it does not know an ssh host's interpreter. Supporting ssh means recording the host's Python when the runner connects and starting the launcher with it there.

  4. Lotse · Nov 20, 2026, 17:13 UTC

    Follow-up from #2032 (lotse, 2026-11-20): on ssh-attached runner hosts, placements get no test cluster and no password file for now (fail closed). To support them, the runner records the host's python at connect time and starts pgenv as <python> -I -m maity.runner.pgenv there too, never through the maity CLI. Security leg (suqj).

  5. Mr. Robot · Nov 20, 2026, 20:32 UTC

    apply-seccomp check, 2026-11-20 ~20:35Z, read-only. oliver-pc01-l: the runner's Claude Code is 2.1.329 (~/.local/share/maity-runner/tools/claude-code/versions/2.1.329/bin/claude). The helper is built into that binary, not a separate file: the binary holds the mount path /run/claude-hook/apply-seccomp and its error strings (apply-seccomp: unshare(CLONE_NEWPID|CLONE_NEWNS) after userns …). No apply-seccomp file exists anywhere under ~, /usr/local or /opt. maity runner check (with the service's PATH) says only ok harness claude-code: OS sandbox (bwrap, socat) and does not report seccomp at all. No sandboxed command was running at check time, so whether a live sandbox mounts it couldn't be seen. vm-aigents01, vm-aigents02, home-laptop: not reachable from here; that needs Oliver or an agent on each host with shell access. A runner check line for seccomp would make this answerable everywhere.