Remove skill prelude exec allowlist#84570
Conversation
|
Codex review: passed. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Current-main source and tests show the old PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow deletion through the existing maintainer/automerge gate if maintainers accept the compatibility break, preserving direct wrapper trust and the focused regression tests. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source and tests show the old Is this the best way to solve the issue? Yes, if maintainers accept the compatibility tradeoff. The PR removes the legacy special case, keeps direct wrapper execution covered, and aligns with the read-tool-first skill contract without adding another config path. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b79effefee92. |
There was a problem hiding this comment.
Pull request overview
This PR tightens exec approval security semantics by removing the legacy “skill prelude” allowlist compatibility path (the cat SKILL.md && printf ... && <skill-wrapper> shell chain) while improving approval UX and hardening durable approval binding across gateway/node/macOS implementations.
Changes:
- Remove the skill-prelude allowlist compatibility behavior; only direct trusted skill wrapper execution is treated as trusted.
- Add request-scoped approval decisions and command-span highlighting in exec approval prompts (UI + gateway + macOS).
- Harden durable
allow-alwaysbehavior by restricting when it can be offered/persisted and by incorporating additional binding context (cwd/env) plus safer shell-wrapper parsing.
Reviewed changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/ui/views/exec-approval.ts | Render command spans + honor request-scoped allowed decisions |
| ui/src/ui/views/exec-approval.test.ts | UI unit coverage for spans + decision visibility |
| ui/src/ui/views/exec-approval.browser.test.ts | Browser coverage for span rendering |
| ui/src/ui/controllers/exec-approval.ts | Parse commandSpans + allowedDecisions from events |
| ui/src/ui/controllers/exec-approval.test.ts | Controller parsing tests for spans/decisions |
| ui/src/ui/app-gateway.node.test.ts | Gateway event routing coverage for commandSpans |
| ui/src/styles/components.css | Styling for highlighted command spans |
| src/node-host/invoke-system-run.ts | Gate durable exact approvals on allowlist analysis + bind persistence context |
| src/node-host/invoke-system-run-plan.ts | Safer shell/script operand detection (startup options, +o, clustered flags) |
| src/node-host/invoke-system-run-plan.test.ts | Coverage for new POSIX/fish startup/cluster parsing behaviors |
| src/node-host/invoke-system-run-allowlist.ts | Block exact durable approvals for unsafe wrapper/carrier contexts |
| src/node-host/exec-policy.ts | Update transport wrapper comment (/bin/sh -c) |
| src/infra/system-run-command.ts | Improved inline-command extraction for PowerShell/POSIX wrappers |
| src/infra/system-run-command.test.ts | Tests for inline-command extraction edge-cases |
| src/infra/shell-wrapper-resolution.ts | Wrapper resolution through carriers + safer PowerShell inline extraction |
| src/infra/shell-inline-command.ts | Expand inline-flag parsing (equals, clustered flags, stopAtFirstOperand) |
| src/infra/shell-inline-command.test.ts | Tests for new inline parsing behavior |
| src/infra/powershell-options.ts | Central PowerShell option/token helpers |
| src/infra/posix-shell-options.ts | Central POSIX shell startup/inline parsing helpers |
| src/infra/posix-shell-options.test.ts | Tests for POSIX shell option parsing helpers |
| src/infra/node-shell.ts | Use /bin/sh -c transport for non-Windows |
| src/infra/node-shell.test.ts | Update tests for /bin/sh -c |
| src/infra/fish-shell-options.ts | Fish startup/inline option detection helper |
| src/infra/fish-shell-options.test.ts | Tests for fish startup/inline detection |
| src/infra/exec-wrapper-resolution.ts | Re-export new wrapper/carrier helper APIs |
| src/infra/exec-wrapper-resolution.test.ts | Tests for new carrier/wrapper detection functions |
| src/infra/exec-command-resolution.test.ts | Update allowlist expectations for busybox login-shell case |
| src/infra/exec-approvals.ts | Durable approval binding changes + allowed decision resolution changes |
| src/infra/exec-approvals-store.test.ts | Tests for durable approvals bound to cwd/env + normalization behavior |
| src/infra/exec-approvals-policy.test.ts | Update durable pattern tests to new hashing scheme |
| src/infra/exec-approvals-analysis.ts | Remove skillPrelude from satisfaction types + tag analysis sources |
| src/infra/exec-approvals-analysis.test.ts | Remove skill prelude allowlist path + expand safe wrapper fixtures |
| src/infra/exec-approval-forwarder.test.ts | Extend forwarded approval text helper to allow request overrides |
| src/infra/command-explainer/types.ts | Add executableSpan for command steps |
| src/infra/command-explainer/index.ts | Export formatCommandSpans |
| src/infra/command-explainer/format.ts | Convert explainer executable spans into exec approval spans |
| src/infra/command-explainer/format.test.ts | Tests for span formatting behavior |
| src/infra/command-explainer/extract.ts | Populate executableSpan + detect shared carrier inline-eval |
| src/infra/command-explainer/extract.test.ts | Update tests for attached inline flags parsing behavior |
| src/infra/command-carriers.ts | Track sudo/doas/env/exec metadata for safer wrapper detection |
| src/infra/approval-view-model.test.ts | Coverage for approval view commandAnalysis pass-through |
| src/gateway/server-methods/server-methods.test.ts | Validation + allowedDecisions/commandSpans behavior coverage |
| src/gateway/server-methods/exec-approval.ts | Propagate allowedDecisions + commandSpans; improved unavailable-decision errors |
| src/gateway/protocol/schema/exec-approvals.ts | Add commandSpans + allowedDecisions to request schema |
| src/agents/bash-tools.exec.approval-id.test.ts | Update tests for durable approval patterns + skill prelude behavior |
| src/agents/bash-tools.exec-host-shared.ts | Helper for persistence-scoped allowed decisions |
| src/agents/bash-tools.exec-host-shared.test.ts | Tests for persistence-scoped decisions helper |
| src/agents/bash-tools.exec-host-node.ts | Advertise allowedDecisions based on durable persistence availability |
| src/agents/bash-tools.exec-host-node.test.ts | Node-host tests updated for new decisions + durable binding |
| src/agents/bash-tools.exec-host-node-phases.ts | Derive allowAlwaysAvailable + bind durable checks to sanitized env/cwd |
| src/agents/bash-tools.exec-host-gateway.ts | Disable allow-always when persistence unavailable; bind durable persistence context |
| src/agents/bash-tools.exec-host-gateway.test.ts | Gateway-host tests for allowAlwaysAvailable + unsafe startup shells |
| src/agents/bash-tools.exec-approval-request.ts | Send commandSpans + allowedDecisions; lazy-load explainer runtime |
| src/agents/bash-tools.exec-approval-request.test.ts | Tests for lazy import + spans + allowedDecisions propagation |
| src/agents/bash-tools.exec-approval-request.runtime.ts | Runtime span resolution via command explainer |
| extensions/canvas/src/host/a2ui/.bundle.hash | Bundle hash update |
| docs/tools/exec.md | Document autoAllowSkills applies to real executables only |
| docs/tools/exec-approvals.md | Document no special-casing of skill file preambles |
| docs/.generated/plugin-sdk-api-baseline.sha256 | Plugin SDK API baseline hash update |
| CHANGELOG.md | Changelog entries for skill prelude removal + UI highlighting |
| apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift | Swift protocol model includes commandSpans |
| apps/macos/Tests/OpenClawIPCTests/ExecHostRequestEvaluatorTests.swift | Tests for unavailable allow-always + exact durable allow-always |
| apps/macos/Tests/OpenClawIPCTests/ExecApprovalPromptLayoutTests.swift | Tests for request-scoped decisions + deny preservation |
| apps/macos/Tests/OpenClawIPCTests/ExecAllowlistTests.swift | Durable pattern binding tests + unsafe wrapper rejection tests |
| apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntime.swift | Persist durable approvals with cwd/env + enforce allowed decisions |
| apps/macos/Sources/OpenClaw/HostEnvSanitizer.swift | Add env sanitizer for durable-binding context |
| apps/macos/Sources/OpenClaw/ExecShellWrapperParser.swift | Safer POSIX inline extraction (no -lc shortcut) |
| apps/macos/Sources/OpenClaw/ExecHostRequestEvaluator.swift | Deny unavailable decisions (e.g., allow-always when not available) |
| apps/macos/Sources/OpenClaw/ExecApprovalsSocket.swift | Request-scoped decisions in native prompt + mapping to buttons |
| apps/macos/Sources/OpenClaw/ExecApprovals.swift | Durable command approval helper + allowlist entry source support |
| apps/macos/Sources/OpenClaw/ExecApprovalEvaluation.swift | Durable exact approvals + binding env/cwd incorporated in evaluation |
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Gilded Patch Peep Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
9648320 to
7c49b07
Compare
7c49b07 to
329ee9d
Compare
2e03eda to
95cd4bf
Compare
|
/clawsweeper automerge |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
95cd4bf to
0ca7f3e
Compare
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary: - The PR removes the legacy `cat SKILL.md && printf ... && <skill-wrapper>` exec-approval allowlist path, updates focused exec-approval tests, and adds a changelog entry. - Reproducibility: yes. Current-main source and tests show the old `cat SKILL.md && printf ... && <wrapper>` c ... ed this by source and test inspection rather than executing tests because the checkout review is read-only. Automerge notes: - PR branch already contained follow-up commit before automerge: Remove skill prelude exec allowlist Validation: - ClawSweeper review passed for head 0ca7f3e. - Required merge gates passed before the squash merge. Prepared head SHA: 0ca7f3e Review: openclaw#84570 (comment) Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: jesse-merhi
Summary
skillPreludeexec allowlist compatibility path forcat SKILL.md && printf ... && <skill-wrapper>chains.This removes behavior introduced by #57839.
Why
The old compatibility path existed for agents that displayed a skill file through shell before running the skill wrapper, for example:
That pattern is no longer the contract. Current skill instructions tell agents to load
SKILL.mdwith the read tool, then run the actual skill executable. Keeping an exec-approval exception for the display prelude means allowlist evaluation has to recognize adjacentcat/printfcommands and prove they reach a later trusted wrapper. That is extra command-chain policy for a legacy presentation pattern, not trust in the executable itself.After this change,
autoAllowSkillsand explicit allowlist entries apply to the real skill command only. If an agent still emits the old prelude chain, the prelude commands are evaluated like any other shell commands instead of inheriting trust from the wrapper.Verification
pnpm docs:listTMPDIR="$(realpath "${TMPDIR:-/tmp}")" pnpm test -- src/infra/exec-approvals-analysis.test.ts src/agents/bash-tools.exec.approval-id.test.ts src/agents/system-prompt.test.tspnpm tsgo:corepnpm tsgo:core:testpnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/bash-tools.exec.approval-id.test.ts src/infra/exec-approvals-allowlist.ts src/infra/exec-approvals-analysis.test.ts src/infra/exec-approvals-analysis.tsgit diff --checkpnpm changed:lanes --jsonTMPDIR="$(realpath "${TMPDIR:-/tmp}")" pnpm check:changed