Repository navigation
feat(external-agents): set uses. use .mode once per machine through userConfig - #18621
melodic-automation-lanes[bot] wants to merge 3 commits into
Conversation
Lane-Activity: work-resolve-issue/resolve-issue
|
Unattended merge: native auto-merge leaves this pull request unarmed at head |
|
claude-security-review reviewed Security review: PR #18621 (external-agents per-machine use-mode options)This review was blocking only: the prior-findings file says this lane already reviewed an earlier head ( What changed. At the base, the manifest already declares Trust boundary. I checked it and found nothing exploitable:
Manifest. The three added keys are guards, because each sets the default and the ceiling of a sandbox mode.
Not findings. The docs, ADR, contract, schema description, skill text and test changes widen no control. The skill still says "never set the key yourself". I found no embedded instructions in the PR context. critical-findings: 0 Manifest lines (3)
|
|
claude-review reviewed Code review: PR #18621, external-agents use modes set once per machine through userConfigThis lane already reviewed an earlier head ( The earlier finding is fixed. Last round's one finding was a closing-issue criterion that was not met: "no test reads the operator's real
Other checks, by reading the code:
Not verified by this lane (the author's claims, which I did not run):
Loosened checks would be marked: fail (default; the prompt carried no Advisory and manifest lines (4)
Verifier dropped 0 of 0 candidates. |
|
Held with the do-not-merge label for an owner decision: this adds user settings and managed settings as sources for the agy/Codex task and investigate mode ceilings, so one operator opt-in to write mode covers every repository on the machine, and merge-risk rates Impact HIGH on that (run 45299735532). That is a trust-boundary change with no owner-decisions row or owner quote behind it (#18573 was filed under the shared login). The owner's word releases it. Separately, pr-verify's two fail-notes (CLI tests read the real managed settings) still need a fix. |
|
Owner decision, 2026-11-24 ~03:08Z, in the PR lane session, verbatim: "go w/ recommenadtions". It accepts option (a): the machine-wide agy/Codex task and investigate mode opt-in from user and managed settings, as designed. The PR lane now fixes the two pr-verify fail-notes (CLI tests must not read the real managed settings) and the claude-security-review thread on the codex_uses_task_mode manifest default. It removes the do-not-merge label once those land. |
… settings Every test that spawns bin/external-agents (runner, update, usage, models and fence CLI tests) now runs it through world.mjs cli(), which starts node with --import tests/support/no-operator-settings.mjs. That module registers a module.registerHooks resolve hook that swaps lib/plugin-options.mjs for itself: managedSettingsFiles() returns [] and resolveInstall() returns no user settings location, while readOperatorOptions and OptionsError stay the real ones. The spawned CLI therefore reads neither the fixed managed settings path (/etc/claude-code and its Windows and macOS equivalents) nor any user settings.json, which closes #18573's "no test reads the operator's real settings.json or managed settings" item. The isolation lives in the tests, not in an env var the CLI reads: plugin-options.mjs reads no environment by design, since a repository's settings env block reaches every process a session starts, so an env var naming the managed directory would let a repository replace the operator's managed policy. A new test probes plugin-options.mjs in a child with and without the hook to show the swap takes effect. The manifest defaults stay: claude plugin validate rejects a userConfig field with options and no default ("a field with options needs a default among them, or required: true"), matching the plugins reference. A new test pins each of the four manifest defaults to the value the cascade resolves from defaults.json with the option unset, so a later change to defaults.json fails CI until the manifest default moves with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/contracts/hook-config-delivery/README.md # plugins/external-agents/.claude-plugin/plugin.json # plugins/external-agents/README.md # plugins/external-agents/scripts/lib/runner.mjs # plugins/external-agents/skills/antigravity/SKILL.md # plugins/external-agents/skills/antigravity/reference/run.md # plugins/external-agents/tests/fence.test.mjs # plugins/external-agents/tests/support/world.mjs
| "codex_uses_task_mode": { | ||
| "type": "string", | ||
| "title": "Codex task mode", | ||
| "description": "Default and ceiling for Codex task runs on this machine, in every repository. write (default) or read-only. A repository's team or personal external-agents.yaml overrides it.", | ||
| "default": "write", |
There was a problem hiding this comment.
manifest userConfig.codex_uses_task_mode: flag, an added guard key (the sandbox ceiling for Codex task runs) whose default is the permissive value write
This option sets the default and the ceiling for Codex task runs. USER_OPTIONS in config.mjs (line 11) lists it, and setup() in runner.mjs (lines 90-91) applies it as the cascade's userConfig layer. That makes it a guard, and its manifest default is the permissive value.
It widens nothing today.
- The default matches the bundled
defaults.json(line 6:"task": { "mode": "write" }), so users who never set the option keep the same Codex task mode as before. - The reader only takes values the operator actually stored under
pluginConfigsin user or managed settings. - A repository's team or personal file still overrides it.
Residual risk. If Claude Code writes this default into pluginConfigs when a user configures the plugin, write becomes an explicit userConfig value. A later change of defaults.json to read-only would then not reach those users. Choose this default deliberately, or confirm that only values the user explicitly set are saved.
severity: IMPORTANT
claude-lane: claude-security-review
There was a problem hiding this comment.
Accepted under the operator-only userConfig rule (owner-decisions Q261; D16/D22). Exposed surface: none outside the operator. The value is read only from the operator's own user or managed settings (pluginConfigs), the write default equals the bundled defaults.json task.mode today, so it widens nothing, and a repository team or personal file still overrides it. Condition that would make it matter: a change of defaults.json task.mode to read-only. That change must also flip this manifest default, or confirm that Claude Code stores only values the user explicitly set. Resolution goes through the hub on the owner's word.
Closes #18573
Summary
Opened by the work-resolve-issue lane. The run's own summary:
Not verified
node --test --test-concurrency=4over fence, foundations, runner and update tests ran 179 tests: 174 pass, 0 fail, 5 skipped.scripts/sync-plugin-options-docs.pyreports 0 READMEs changed at 0dc782f, andscripts/sync-shared-copies.sh --checkreports all registered copies match.Fix
Verification
The runner ran each check from the base copy against 5a684af:
The run reports:
Left out: the items under Not verified.
Related
#18573