[Idea] Optional root jail for the fs service (per-profile workspace root) — safer multi-agent setups #6485
NovaDev9-bot
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context: We run a multi-agent editorial deployment (one resident editor + five spawned roles) where plugins receive the
fsservice viaexec.agent.ctx.get('fs'). Auditing our domain plugin today we confirmeddsh-fs-localresolveLocalTarget()=resolve(cwd, path)+ realpath with no root boundary — any absolute path on the machine is reachable, by design.That is a fine trust model for a single-user CLI. But for multi-agent + per-role preset profiles it makes least-privilege awkward:
toolFilter: denylists in the preset — deny-lists are fragile (a new tool name slips through), and thefsservice that plugins consume is not subject to them at all;book_dir) can in fact touch anything the user can;book_dir), which is policy-as-documentation, not policy-as-mechanism.Proposal: an optional per-profile root jail for the fs service, e.g.
resolve()rejects targets whose realpath falls outside the configured roots (reuse the existingcontains(parent, child)helper);ctx.get('fs')inherit the same boundary per session;rootskeeps full backward compatibility.This would let multi-agent presets express "this role only sees this directory" mechanistically instead of by deny-list and convention. Related: we also noticed plugin
fsdoes not inherit the session cwd in some launch modes (had to restart the server from the repo root) — a roots config would pair naturally with a clear cwd inheritance rule.Thanks — happy to test an implementation if there is interest.
All reactions