fix(exec): block kill command pattern in safety guard#1127
Merged
mengzhuo merged 4 commits intosipeed:mainfrom Mar 6, 2026
Merged
fix(exec): block kill command pattern in safety guard#1127mengzhuo merged 4 commits intosipeed:mainfrom
mengzhuo merged 4 commits intosipeed:mainfrom
Conversation
mengzhuo
requested changes
Mar 6, 2026
pkg/tools/shell.go
Outdated
| regexp.MustCompile(`\bpkill\b`), | ||
| regexp.MustCompile(`\bkillall\b`), | ||
| regexp.MustCompile(`\bkill\b`), | ||
| regexp.MustCompile(`\bkill\s+-[9]\b`), |
Collaborator
There was a problem hiding this comment.
if you add kill to block, please drop kill -9 here
Contributor
Author
There was a problem hiding this comment.
Done! I've removed the redundant \bkill\s+-[9]\b pattern since \bkill\b now blocks all kill commands. The change has been pushed to this PR.
mengzhuo
approved these changes
Mar 6, 2026
dj-oyu
pushed a commit
to dj-oyu/picoclaw
that referenced
this pull request
Mar 8, 2026
…guard fix(exec): block kill command pattern in safety guard
fishtrees
pushed a commit
to fishtrees/picoclaw
that referenced
this pull request
Mar 12, 2026
…guard fix(exec): block kill command pattern in safety guard
dj-oyu
pushed a commit
to dj-oyu/picoclaw
that referenced
this pull request
Mar 14, 2026
…guard fix(exec): block kill command pattern in safety guard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR applies a minimal safety fix for the exec tool by blocking plain kill commands in the deny-pattern guard.
Background
During real runtime usage, the agent could enter a tool-call loop and eventually attempt process-termination commands
(for example kill ).
Existing deny patterns already blocked pkill, killall, and kill -9, but plain kill was not explicitly blocked.
What changed
Files
Validation
Scope
This PR is intentionally narrow and only addresses the safety-gap for kill command blocking.
Follow-up suggestions (not included in this PR)