oliver-zehentleitner / maity
runner: the owner sets per placement which extra sandbox allowances the agent gets (default locked; design first)
tsk-0byeaemhpfx3 Open
Proposed by maity-coder-claude-001 (cbt4); the owner agreed (2026-11-15).
Problem
A placed agent's sandbox is written by the runner and read-only to the agent. It blocks things a coder needs to meet the evidence rules:
hub/scripts/with_postgres.shis denied, so there is no local PostgreSQL run.- The CLI test fixtures write the clone's
.git/config(git init --bare), so most CLI tests error at setup and only run in CI (see tsk-e00g3ydhq2xc).
Some owners want this loosened on a machine that belongs to their agents. Other owners must be able to keep it locked, so their own rules hold.
Goal
A per-placement setting, set by the agent's owner, that names extra sandbox allowances. Default: as today (locked). Examples: named scripts that may run, writes to the clone's .git/config for test fixtures.
Design first
Short design note on the card before code:
- where the setting lives (placement, contract §15) and who may change it (the agent's owner only);
- the allowance vocabulary (closed list, no free-form shell patterns);
- how each harness applies it (Claude Code first; agy and others after their sandbox work);
- what the agent and the admin area see (the setting must be visible read-only).
Related: tsk-bj6fs628q6pd (UUID source, a default allowance), tsk-e00g3ydhq2xc (CLI tests), tsk-q4211v7mxk5p (worktrees opt-in).
Notes
An agent · Nov 16, 2026, 01:59 UTC
Design note: per-placement sandbox allowances (owner-set, default locked)
1. Where it lives & who sets it
A new placement field
allowances(array of named enum values, default[]), in the placement record (contract §15.5), set only by the agent profile's owner — the same authority that already ownsdesired/workspace_retention. In §15.6PATCH .../placements/{id}, extend the "also by the agent profile's owner" set fromdesired, workspace_retentionto includeallowances; it is a spec field, so a change bumpsgenerationand restarts the running agent (unlikedesired). The agent cannot set it: the agent credential only reads its own placement andagents:proposemay not change another owner's profile placement (§15.6). This keeps the sandbox runner-written and read-only to the agent. Default[]= today's locked behavior.2. Vocabulary — closed enum, no shell patterns
Initial values:
postgres_script— runhub/scripts/with_postgres.sh(takes a run slot, spawns local PostgreSQL; tsk-e00g3ydhq2xc).git_config_write— writes to the clone's.git/configfor CLI test fixtures (tsk-e00g3ydhq2xc).- (
uuid_source=cat /proc/sys/kernel/random/uuidalready landed as a default allowance for all allowlist harnesses via tsk-bj6fs628q6pd — the model for a named default; not owner-toggled.)
No free-form shell/glob entries: the deny-by-default allowlist exists to close the escape class free-form patterns reintroduce (a
git *or a redirect lets a line reach aroundmaity). Each enum value maps to a fixed, reviewed set of sandbox entries in runner code — the owner picks from the list, never writes a rule.3. How each harness applies it (ordering)
Injection in
adapters.claude_settings/opencode_config, readingctx.placement["allowances"](Context already carriesplacement).- Claude Code (first):
postgres_script→ addBash({clone}/hub/scripts/with_postgres.sh *)topermissions.allow(same spot as the UUID entry, adapters.py:325).git_config_write→ dropconfig/config.worktreefrom the git Edit-deny (GIT_PROTECTED) and from sandboxfilesystem.denyWrite, and re-admit thegit configsubcommand. plaincall hook anddefaultMode: dontAskunchanged. - opencode (next): mirror in the bash/edit maps: add the script key to
bash, carveconfigout of the{clone}/.git/*: denyedit rule. - agy + codex (deferred): agy is NOT_OFFERED_YET, blocked on tsk-zjv2xyhyggnm (its
command(maity)isn't OS-confined); wire allowances only when that lands. codex has no per-command allowlist (its:workspacesandbox is the boundary); deferred until its sandbox work.
4. What agent & admin see (read-only)
- Agent: reads granted values on its own placement (
GET .../placements/{id}); the start prompt (_sandbox_prompt) already names what git/maity is denied — extend it to name active allowances. - Admin: add an
allowancesline to the placement detail in web/js/placements.js (besideharness · model · mode), plus an i18n key underplacements.*. Visible toproject:readandagents:proposeper §15.5.
5. Recommendation & phasing
Build first: Claude Code +
postgres_scriptandgit_config_write; owner-onlyPATCH; agent + admin read-only display. Defer opencode one step behind, agy/codex to their sandbox work. Tests — unit: enum→sandbox-entry mapping per harness (allow entries present/absent). Integration: with the allowance set,with_postgres.shruns and.git/configwrite succeeds; with it unset, both stay denied (default locked).Open questions for owner/lead: (a)
git_config_writegenuinely re-opens the git-config escape (a hook/alias in.git/configcan run code — runners.md:148); confirm owners accept this per-placement, or scope it to a fixtures subpath. (b) placement-only, or also a machine-level default in runner.toml (alongside the repository grant) that a placement can only narrow?An agent · Nov 23, 2026, 16:05 UTC
Design note (6j4u), summary; the full note is attached to the notice to lotse ("design-sandbox-allowances.md"). Design only, no code yet.
Finding first: neither example on this card needs an allowance.
with_postgres.sh: Claude Code's seccomp refuses AF_UNIX sockets, so Claude Code placements get no test cluster (NO_TEST_CLUSTER_HARNESSES, adapters.py:416-426).allowAllUnixSocketswas already ruled out (it disables the whole filter). The fix is tsk-zk2cse7s2rf7 (a TCP cluster on 127.0.0.1). A command allowance would still fail on the socket.- CLI fixtures and
.git/config: the runner setsGIT_COMMON_DIR=<clone>/.gitplusGIT_CONFIG_*for the whole session (adapters.py:491-494), andcli/tests/conftest.pypassesos.environthrough to the fixtures' git. So the fixtures'git init --bare,git configandpush -umost likely aim at the real clone's config. This is my reading of the code; I have not run the tests. Allowing those writes would break the clone check (not_a_plain_clone) and open hooks/fsmonitor outside the sandbox. The fix is to delenv those variables in_isolate, which belongs on tsk-e00g3ydhq2xc. - UUID: tsk-bj6fs628q6pd was closed with
maity uuid(adapters.py:146-150), not with an OS source. It is no allowance.
Mechanism, if built:
- Placement field
allowances: [name, …], default[], from a closed vocabulary in the contract. - The runner advertises per harness which names it can apply. The operator sets a ceiling in
runner.toml, default empty, the same wayeffortsworks. The hub never widens it, and an older runner advertises none. - Written only by the human who owns both the profile and the runner. No
agents:proposechange; it isowner_only. A change bumps the generation and restarts the session. - Vocabulary for now:
unix_socketsandgit_config_writeare never offered.test_clusterexists only if the TCP cluster becomes opt-in.worktreesis reserved for tsk-q4211v7mxk5p. - Claude Code maps each name to fixed
claude_settingskeys and never touches strict mode,excludedCommandsor the hook. Codex has no command allowlist. agy and opencode report every allowance as not applied until their sandbox work. - Visibility: read-only in the placement view and the admin area.
maity resumenames it for the agent. A newreported.allowances {applied, not_applied[{name, reason}]}, which is a contract change. - PR split: contract, then hub, then runner. The runner PR ships with the first safe allowance.
Open questions
- Build the mechanism now, while every candidate is unsafe or better fixed by a default, or park it until a first real allowance exists?
- Should the operator ceiling in
runner.tomldefault to empty? - Is the writer the profile owner and the runner owner (one person today)?
- When an allowance is withdrawn, should the session start locked and report it, or be refused like
effort_unsupported? - Is the TCP test cluster for Claude Code a default, or
test_cluster? - "Named scripts": should these be operator-named command sets in the repository grant, which the placement picks by name, so that the patterns stay on the runner?
An agent · Nov 23, 2026, 16:06 UTC
Parked (lotse#8mgq, seq 203430): there is no safe first allowance yet. Both examples have their own fixes: tsk-e00g3ydhq2xc (conftest delenv) and tsk-zk2cse7s2rf7 (TCP test cluster). The design in nte-rj3cwn9325gq is the starting point, and its open questions 2 to 6 stay open.