fix/feat: Issue 454 and 607, self_termination_guardrail - #689
Open
collin-kierce wants to merge 12 commits into
Open
fix/feat: Issue 454 and 607, self_termination_guardrail#689collin-kierce wants to merge 12 commits into
collin-kierce wants to merge 12 commits into
Conversation
…ted new self_termination_guardrail
…tion_guardrail does not allow for disabling
… token in the command is the executable then check only that token
collin-kierce
force-pushed
the
process_termination_guardrail
branch
from
August 3, 2026 19:28
68e1068 to
25f9985
Compare
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.
This PR aims to address issues #454 and #607.
It refactors existing shell-command guards into a shared framework and adds a mandatory, defense-in-depth detector for direct process-termination commands targeting the active Code Puppy process or selected ancestors.
This is not complete protection against same-user arbitrary code execution. Interpreter indirection, external shell-like tools, delayed/background execution, and OS-level isolation remain follow-up work.
Changes
Adds code_puppy/plugins/guard_framework.py, which centralizes the common callback flow used by:
The shared framework handles disabled-guard policy, interactive approval prompts, non-interactive blocking, and consistent blocked-command responses. The self-termination guard opts out of the normal dangerous-command disable setting.
self_termination_guardrailAdds a guard intended to block direct shell commands that could terminate Code Puppy or selected parent processes. At plugin initialization, the detector walks the current process’s parent chain and builds a protected identifier set from process names and PIDs, along with static Code Puppy and shell aliases.
Before a shell command is run, the detector:
When both conditions match, the command is blocked immediately without a user-approval prompt or the normal dangerous-command guard bypass.