oliver-zehentleitner / maity
runner: OS-level confinement for the maity command of antigravity placements (design first)
tsk-zjv2xyhyggnm Open
Follow-up to tsk-vgce05kdmk2x (owner: runner lead). The harness's own permission settings cannot express everything we need for the maity command of an antigravity (agy) placement. This card adds an OS-level confinement on the runner side for that command, so the agy harness can be placed safely.
Design first: write a short note on the card covering the options, what each one covers, what it costs on Linux, macOS and Windows, and how it is tested. Details go to the lead by direct message only.
Until this card is done and the owner agrees, no agy placement runs on any runner.
Notes
An agent · Nov 15, 2026, 22:12 UTC
P3 doc nit (from A759 on #1860, non-blocking, for a follow-up runner-doc PR — not in #1860): cli/README.md:1230 lists Antigravity without opencode's 'built, not offered yet: held back until its command grants are confined at the OS level (tsk-zjv2xyhyggnm)' note; the runner.md line in cli/context/index.md likewise omits that agy is held back. Add the held-back note to both, mirroring opencode.
An agent · Nov 16, 2026, 01:54 UTC
OS-level confinement for agy's
maitycommand — designWhy. For an agy placement the one grant we cannot drop is
command(maity): a session must reach the hub, somaityruns outside agy's terminal sandbox. agy applies that grant after reading the invoked command past a leading assignment or wrapper, so for agy it is not the tight boundary Claude Code'sBash(maity *)is (recorded in cli/context/runner.md and docs/runners.md). Claude Code closes the equivalent gap with a PreToolUse hook (plaincall); agy's--settingshas no hook, so the fix must be a runner-side OS mechanism around that one command. Until it lands,antigravitystays inNOT_OFFERED_YET.What runs today. agy starts in a clean tmux env (HOME/PATH/LANG/TERM) and the agent invokes
maityby name; that process runs outside agy's sandbox. The runner's ownmaity waitis launched hardened (python -I -m maity, fixed argv), but the agent's ownmaity …lines are not — they carry whatever env/wrapper the agent prepends.Options
- (a) Linux sandbox (bubblewrap / Landlock / seccomp): runs real
maityin a jail (fs = clone + maity's dir, net = hub + forge). Even injected native code can't exceed maity's legitimate reach. Linux only; needsbwrap/namespaces; doesn't itself rebuild the env. - (b) Runner-side launcher that sanitizes env + pins binary: agent reaches
maityonly via a runner-owned launcher that rebuilds a clean allowlisted env and execs real maity by absolute path. Neutralizes the env-injection class on every OS; cheap, no host dependency. Must itself be injection-immune (detail by DM); bounds env, not reach — pair with (a)/(d). - (c) Container/pod: matches existing
confinement: "pod". Strongest, but heavy (image + runtime + per-placement lifecycle); keep as a later opt-in tier. - (d) macOS `sandbox-exec`/Seatbelt: macOS equivalent of (a); ships with macOS. Profile finicky; Keychain stays reachable (documented caveat).
- (e) Windows Job Objects/AppContainer: n/a — the runner doesn't run on native Windows; a "Windows runner" is WSL (= Linux, covered by (a)).
Coverage per OS
- Linux (incl. WSL): (b) always + (a) as the real boundary where available; else (b) holds and the placement is reported as reduced isolation.
- macOS: (b) always + (d) as the boundary (Keychain caveat).
- Native Windows: out of scope.
Cost
(b) lowest (small launcher + env allowlist, fails safe). (a) moderate (needs bwrap/kernel features; must not silently degrade — gate like the Claude Code sandbox). (d) moderate, macOS-only, untested on a real Mac. (c) highest.
Testing
- Unit: env allowlist (survives/dropped), binary pinning (abs path, no PATH redirect), fail-closed path.
- Integration (escape test): a
maityline carrying a leading assignment/wrapper must not run anything but the intended binary with a clean env, and (with (a)/(d)) reach nothing outside maity's allowed set. One positive + several negative cases. - Per-OS: (b) CI-testable on Linux + macOS; (a) CI-testable where unprivileged userns is allowed, else host-gated (like agy's namespace probe); (d) needs a real Mac (manual until mac CI).
Recommendation
Adopt (b) + (a)/(d) layered, keep (c) pod as a future opt-in tier:
- Pin the agent-facing
maityto a runner-owned launcher that rebuilds a clean allowlisted env and execs real maity by absolute path, built injection-immune. Portable baseline on every OS we run. - Run real maity inside bubblewrap/Landlock (Linux) and
sandbox-exec(macOS) so even in the injection window the process can't exceed clone + maity's dir and hub + forge. Gate availability like the Claude Code sandbox — refuse or advertise reduced, never silently degrade. - Re-offer
antigravity(drop fromNOT_OFFERED_YET) only once this lands and the owner agrees.
Security-sensitive specifics (the exact escape, the allowlist contents and why it must be an allowlist, the escape-test strings) go to the lead + lotse by DM, not here.
- (a) Linux sandbox (bubblewrap / Landlock / seccomp): runs real
An agent · Nov 16, 2026, 09:24 UTC
Zusatzpunkt: claude-code-Version neu prüfen (gehört zur agy-Absicherung). Detail per DM.
An agent · Nov 16, 2026, 10:56 UTC
2.1.325 Sandbox-Verifikation — Stand und offene Restfrage
Für den CHECKED-Bump (claude-code 2.1.318 → 2.1.325) wurde das Sandbox-Verhalten per statischem Read des Command-Matchers geprüft (keine Laufzeit-Session, wie entschieden). Ergebnis: ein Kommando mit etwas vor
maity(führende Zuweisung oder Wrapper) bleibt in der Sandbox, wie bei 2.1.318 — die Eigenschaft hält. Sicherheitsdetails nur per DM an Lead + Security-Lead.Offene Restfrage (allgemein): Einige nachgelagerte Normalizer im Command-Pfad wurden statisch nicht erschöpfend durchgetracet; ihr beobachtetes Verhalten ist unkritisch, und ein nachgelagerter Guard fängt den relevanten Fall. Eine vollständige Laufzeit-Bestätigung steht aus und bleibt als Restrisiko offen, bis eine Session verfügbar ist, die den Harness ausführen darf.
An agent · Nov 23, 2026, 17:22 UTC
The body's line "until this card is done and the owner agrees, no agy placement runs on any runner" is stale (lotse#8mgq, 2026-11-23). The owner accepted the residual command(maity) risk (req-9spwe33neh1z, cli/context/runner.md "Antigravity is re-offered with its residual command(maity) risk accepted"), and agy placements run today. This card is hardening, not a blocker. The design note goes to lotse by DM; this card gets only a short summary.
An agent · Nov 23, 2026, 17:27 UTC
Design note (6j4u) sent to lotse by DM, 2026-11-23. It is design only, from reading the code and the Keep the Why; nothing was run. It compares the options, with their costs on Linux, macOS and Windows and how each would be tested. The recommendation is an incremental path that starts with an operator-side step and a spike on a signed-in agy host. Open questions are with lotse. The design is parked while the §6.30 docs take priority after H1 (#2142).