feat(tools): always gate managed config writes behind fresh approval / 受管配置文件写入始终需人工确认 - #9770
Open
BuGlessRB wants to merge 1 commit into
Open
feat(tools): always gate managed config writes behind fresh approval / 受管配置文件写入始终需人工确认#9770BuGlessRB wants to merge 1 commit into
BuGlessRB wants to merge 1 commit into
Conversation
BuGlessRB
force-pushed
the
pr/managed-config-always-ask
branch
4 times, most recently
from
September 7, 2026 11:17
cee0780 to
29fb1e8
Compare
confineWrite routed a managed config file (config.toml, legacy v0.x config.json) to the per-write fresh human approval only when the target sat outside the write roots; a root widened to cover the Reasonix home made the same files plain allowed writes, silently editable in YOLO. Those files configure providers, sandbox rules, and permissions for future sessions, so no posture and no widened root may write them unattended: check managed.Match(target) before root confinement and always consult the approver. The fail-closed message no longer points at allow_write, which no longer authorizes config edits.
BuGlessRB
force-pushed
the
pr/managed-config-always-ask
branch
from
September 7, 2026 22:47
29fb1e8 to
00a55b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Managed Reasonix config files (
config.toml, compatibility TOMLs, legacy v0.xconfig.json) are now gated behind the per-write fresh human approval (config_write) at any location. PreviouslyconfineWriteconsulted that approval only when the target sat outside the write roots, so a root widened to cover the Reasonix home (e.g.allow_write = ["/"]or["/home/u/.reasonix"]) turned config edits into plain allowed writes, silently editable even in YOLO.Why
These files configure providers, sandbox rules, permissions, and MCP servers for future sessions. No posture (YOLO included) and no widened root should let an agent rewrite them unattended - the write-access auto-allow and the managed-config questions are deliberately separate gates.
Behavior
confineWritenow checksmanaged.Match(target)before root confinement, so the approval fires whether or not the roots cover the file.[sandbox] allow_write, which no longer authorizes Reasonix config edits.settings.json, session stores stay hard-protected).Verification
TestManagedConfigWriteAsksEvenInsideRoots: in-root managed config write fails closed without an approver, consults the approver when one is present (approve/decline both covered), and a plain in-root file still writes silently.go test ./internal/tool/builtin/ ./internal/control/ ./internal/boot/go veton the touched packages,go run ./tools/repolintclean.Documentation-impact: none - internal approval-gate behavior; no docs describe the root-relative config_write trigger.
Cache-impact: none - the provider-visible prefix (base prompt + tool schemas + memory) stays byte-identical; the change is confined to write-tool runtime enforcement and one fail-closed error message, with no tool schema, prompt, or memory edits.
Cache-guard: go test ./internal/tool/builtin/ -run TestManagedConfigWriteAsksEvenInsideRoots (pins in-root managed-config writes still consult the approver); no tool schema changed, so the provider-visible tool surface is unchanged.
System-prompt-review: comment-only edit to internal/boot/boot.go (no code change); system prompt and tool schemas unchanged - reviewed by the PR author (BuGlessRB) and maintainer (SivanCola).