Repository navigation
fix(security): cap delegated session tools - #150705
vincentkoc wants to merge 4 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 17, 2026, 4:07 AM ET / 08:07 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR carries a sending session’s exact tool permissions into receiving turns and rejects handoffs that cannot retain live sender authority. Merge readiness⛔ Blocked before merge - 7 items remain This maintainer-owned security repair remains necessary on current main. The prior fixes improve enforcement, but a worker-receiver gap and an inconsistent advertised contract still block readiness. Priority: P1 Review scores
Verification
How this fits togetherSession-send tools ask the Gateway to run another session. The Gateway selects the receiving runtime, whose tool assembly must intersect the sender’s permissions with the receiver’s own policy. flowchart TD
A[Sending session tools] --> B[Capture exact permissions]
B --> C[Trusted Gateway handoff]
C --> D[Check live sender authority]
D --> E[Receiver policy and runtime]
E --> F[Local or CLI tools]
E --> G[Worker tool grant]
F --> H[Allowed tool effects]
G --> H
Before merge
Findings
Agent review detailsSecurityNeeds attention: Worker authority projection leaves the new exact delegation ceiling unenforced; no unrelated supply-chain changes were found. PR surfaceSource +116, Tests +62. Total +178 across 21 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use the existing worker authority owner to enforce the exact ceiling, publish an accurate capped-send contract, and establish fresh and upgrade behavior through final-effect proof. Do we have a high-confidence way to reproduce the issue? Yes, from source: send from a session allowing write but excluding apply_patch to a worker receiver whose policy permits both; worker projection expands the transferred list. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? No, not yet: the local and CLI repairs use appropriate existing owners, but the worker grant must also consume the exact ceiling and the model-facing contract must reflect the restricted operations. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 08c998f90b26. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
330a2ba to
971b785
Compare
5aa9c71 to
806b162
Compare
806b162 to
1e25a3d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5fb4368 to
2344ee6
Compare
|
Addressed all exact-head findings narrowly: outgoing session/spawn caps are intersected with the run execution ceiling after refresh, exact CLI handoffs use exact grant projection instead of policy aliases, and capped ACP handoffs fail before backend execution. @clawsweeper re-review |
60c87d8 to
448c7d5
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
448c7d5 to
d4960e1
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing rather than landing: closure-bound sender authority cannot preserve the existing post-return |
What Problem This Solves
sessions_sendcurrently starts receiving turns from the target's normal tool policy, so cross-agent, worker, CLI/MCP, and chained sends can gain tools absent from the sender.Scope
toolsAllow; the target's own policy can only narrow it.This is the second and final slice replacing #144269, based on the original diagnosis by @pgondhi987. It is stacked on #150702 because delegated restart recovery must stop when the process-bound cap is lost.
Production LOC: +84 net; tests: +45 net.
Verification
pnpm dlx [email protected] --checkon all changed filesgit diff --checkopenai/codexcurrentorigin/main: MCP server allow/deny shape is distinct from the native app-tool surface (codex-rs/config/src/mcp_types.rs), so OpenClaw's existing exact CLI availability gate remains the enforcement owner.Scoped Vitest and structured autoreview await the same exact-head environment gate recorded on #150702.