feat: add structural input validation for system.run exec approvals#244
Conversation
|
Thanks Alex — I took a look through this slice and the direction looks good to me. Keeping this as structural validation only, with no production wiring yet, feels like the right incremental step for the exec approvals v2 work. One thing before merge: could you please rebase or merge current No code-level blocker from me after that refresh — this seems like a solid first slice to build on. |
10abdfc to
b0aa479
Compare
|
Hi @shanselman — thanks for the review and the feedback. I've rebased the branch on current |
Adds ExecApprovalV2InputValidator (phase 1 of the V2 exec approval pipeline) and its typed output ValidatedRunRequest. Validates argv, cwd, env, and timeout with fail-closed typed denials; no resolution, policy evaluation, or production wiring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 fork-internal entries (CLAUDE.md, AGENTS.md, .serena/, .claude/, etc.) accumulated during rebase and do not belong in upstream PR openclaw#244. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Heads up — I'm force-pushing this branch after rebasing onto current During the rebase/merge context, the branch picked up unrelated internal This update removes that spillover so the diff stays limited to the |
b0aa479 to
5cfbde9
Compare
|
Thanks again, @AlexAlves87. I took another pass now that the recent exec-approval hardening work has landed on Before merging, I’d like to tighten a few validator semantics since this will become foundational for later execution/policy phases:
The PR merges cleanly on current
Result: 49/49 passing. With those small changes, I think this is a good slice to take. |
…meout bound deferral - Remove .Trim() from argv[1+] elements (array and separate-args paths); arguments like " value " must reach the execution/policy phase unchanged. - argv[0] empty/whitespace detection now uses IsNullOrWhiteSpace instead of trim+IsNullOrEmpty. - A non-array "args" property when command is a string is now a protocol violation (malformed-command) instead of being silently ignored. - Add comment in timeout validation making explicit that upper-bound clamping is enforced in the execution/policy phase, not here. - Update and add tests: 52 passing (3 new: SeparateArgs_NotAnArray_*, LargeTimeout_*). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @shanselman — thanks for the second pass, I've addressed all three:
Tests: 49 → 52. |
|
Thanks @AlexAlves87 — this looks good now. I verified the updated branch and also tested the merge result over current master locally. The coverage is exactly what I wanted for this slice: structural validator success/failure paths, argv preservation, malformed args rejection, and timeout boundary semantics while keeping production system.run behavior unchanged. Merging this as the next exec-approvals V2 foundation piece. |
I have the next small, fully tested slice prepared for the exec approvals work. In practice, it adds structural input validation for
system.run, without introducing executable resolution, policy evaluation, prompting, or any production activation.The goal here is to keep moving this area forward through small, well-scoped changes that can be reviewed and merged independently while keeping the current legacy path unchanged by default.
What this PR includes
ExecApprovalV2InputValidatorValidatedRunRequestvalidation-failedoutcomes for malformed or invalid inputcwdenvWhat does not change
system.runstill uses the current legacy path by defaultValidation
./build.ps1dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore