Repository navigation
Stop agent-forked workers from running with more permissions than their lead - #1612
Conversation
… Automations: natural-language authoring (describe it in chat
… P2: Replay-fixture provider harness: recorded CLI output thr
Solenta-Message-Id: 64326fd6-5881-4a5a-90b8-cb0c308d354c
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f3a5e04e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resolved && resolved.fromPool | ||
| ? poolFromStore(store).entries.find((e) => e.alias === resolved.alias) | ||
| : null; | ||
| assertWorkerNarrows(source, forkInput.provider, poolEntry); |
There was a problem hiding this comment.
Recheck permissions after applying a routed tier
When a default Claude lead calls thread_fork with a tier mapped to Grok or Kimi, this validates only the fork's initial inherited provider. thread_fork then attaches the requested route in electron/orchServer.js:461-470, and applyRoute switches providers during startRun; setProvider consequently snaps the worker to bypassPermissions without invoking this guard. An agent can therefore bypass the new restriction simply by selecting tier instead of provider; validate the routed profile against the lead before starting it, or enforce the invariant whenever an orchestration worker changes provider.
Useful? React with 👍 / 👎.
| : {}), | ||
| trigger: hasTrigger ? { type: "github", ...triggerRaw } : null, | ||
| tier: args && args.tier, | ||
| ...(args && args.memory != null ? { memory: args.memory } : {}), |
There was a problem hiding this comment.
Add
memory to the automation tool schema
When an agent tries to create an automation with memory, this new forwarding path is unreachable through the registered MCP tool: the automation_create input schema at electron/orchServer.js:1711-1739 declares the other arguments but omits memory, so tool clients neither expose nor accept the field. As a result, chat-authored automations cannot persist the optional memory promised by the accompanying design despite the handler appearing to support it; add an optional string field to the tool schema.
Useful? React with 👍 / 👎.
Store round-trip and automation_create assertions predate prLinks on threads and the Linear/Sentry trigger fields (#1588); main is red on both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ler-s-thread-id-at-the-mc-11d82e # Conflicts: # electron/test/automation-create-mcp.test.js
What
Workers that an agent forks can no longer run in a higher permission mode than the thread that forked them (#1425).
The escalation came from mode snapping. When a lead runs
defaulton Claude and forks a worker on Grok or Kimi, the worker snaps tobypassPermissions, because those headless CLIs only honour full access. Before this change, any agent could get a full-access worker that way, just by naming a provider or pool alias.Changes
assertWorkerNarrows(electron/services-threads.js): snaps the lead's mode on both the lead's provider and the worker's provider, then compares the two by rank (plan < default < acceptEdits < bypassPermissions). If the worker ranks higher, it throwsruntime_mode_escalation_denied. The error message tells the agent how to get unblocked: pick a worker that honours the lead's mode, or ask the user.forkWorkerThread: calls the check before it creates any thread. This covers both pool aliases and the legacyproviderargument. It skips the check whenuserPicked: true.@providercomposer turns (runner-turn-setup.js): these passuserPicked: true. The user typed the provider, so a mode jump is their decision, the same as a sidebar fork.subagentPool.js):startWithPoolFailoverruns the same check before it switches a worker onto the next pool entry, so failover can't escalate either.allowEscalationon pool entries: this optional boolean is the only override. It's validated as a boolean, kept through normalize, and added to theSubagentPoolEntryIPC type. Users can only set it in Settings; no tool argument can grant it.AgentsPane.tsx): the pool form gets an "Allow more permissions than the lead" checkbox with an explanatory note. Aliases that have it turned on are labelled "may exceed the lead's permissions" in the list.Known gap
The check ignores Teach caps. That's fine because Teach caps only ever lower a worker's mode (see the
ponytail:comment).Tests
worker privilege narrowing (#1425)suite insubagent-pool.test.js. It covers:provider: "grok"argument are both refused, and no worker thread is created;allowEscalationvalidation.services.test.jsandproject-thread-defaults.test.jsnow setallowEscalation: true, because Kimi only runs in bypass mode.🤖 Generated with Claude Code