feat: add semantic Windows exec approval prompts#1027
Conversation
3b0c7fb to
48ece7e
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 10:22 AM ET / 14:22 UTC. ClawSweeper reviewWhat this changesThe PR carries OpenClaw's existing command-preview text through legacy and V2 Windows execution approval paths, then displays it as sanitized localized context after the exact command. Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain Keep this draft PR open. The prior contract and display-name findings appear addressed in the current head, but the PR itself confirms that it still lacks required current-head Windows and MXC real-behavior proof for an approval-security UI change. Priority: P2 Review scores
Verification
How this fits togetherWindows node command execution receives system.run requests from the gateway and applies policy before presenting an approval prompt to the local operator. This change carries optional agent context into that prompt while the exact command remains the execution and policy decision surface. flowchart LR
A[Gateway system.run request] --> B[Windows node command preparation]
B --> C[Approval policy and sandbox checks]
C --> D[Exact command approval target]
B --> E[Agent request context]
E --> F[Context sanitizer]
D --> G[Windows approval prompt]
F --> G
G --> H[Allow or deny execution]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Validate the rebased head on a capable Windows host, run the required MXC E2E path, and attach a redacted approval capture that visibly shows the exact command before localized agent context with Deny focused by default. Do we have a high-confidence way to reproduce the issue? Not applicable. This PR adds presentation of an existing command-preview field rather than reporting a failing current-main behavior; the important verification is an after-fix native Windows approval flow. Is this the best way to solve the issue? Yes, conditionally. Separating bounded, sanitized agent context from the canonical command is a maintainable approach, provided the required Windows and MXC runtime proof confirms the prompt preserves the intended security boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f50af187865c. LabelsLabel justifications:
EvidenceWhat 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 (1 earlier review cycle)
|
|
Windows CI is needed for the final WinUI validation because the relevant MakePri/XAML tooling is Windows-only. The focused approval tests and the Shared Release build pass locally; when convenient, please approve the fork workflow runs for this draft PR. |
48ece7e to
a3c3fba
Compare
|
Rebased onto current main and pushed a new head ( |
What changed
commandPreviewthroughsystem.run.prepare, the legacy approval path, and the current V2 approval pipelineCommand/DisplayCommandcontract as the exact authoritative commandWhy
The Windows approval prompt currently makes the raw command the operator's primary decision surface. OpenClaw already provides
commandPreviewas a human-readable explanation, but the Windows node did not preserve it through both approval pipelines.The preview must remain presentation-only. It can help the operator understand purpose, impact, risk, and the recommended decision, but it must never replace the exact command used for policy, audit, or execution. This revision therefore keeps the exact command contract unchanged and adds the preview as a separate field and UI block.
Security and compatibility
ExecApprovalPromptRequest.CommandDisplayCommandfrom canonical argvValidation
Passed locally on the rebased current head:
dotnet build src/OpenClaw.Shared/OpenClaw.Shared.csproj --no-restore -c Release— 0 warnings, 0 errorsReal behavior proof
Not verified yet on the rebased head. The Linux container cannot execute
MakePri.exeorXamlCompiler.exe, and the paired Windows validation node was offline during this revision.Still required before marking ready for review:
./build.ps1./scripts/validate-mxc-e2e.ps1