NousResearch/hermes-agent
Guard against agent self-termination via pkill/killall
Cluster 3397 · agent. Data as of
Nothing open on GitHub. Fix merged in #3593 on 28 Mar 2026. Check it covers your case.
The short answer
0open issues
0open PRs
4items grouped
- Known?
- Yes. 4 related items grouped here, 1 issue already closed.
- Fix event
- A fix was merged to main in PR #3593. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
unresolved. That is separate from the fix event. - Still open
- Nothing open on GitHub.
These issues and PRs address a bug where an agent could terminate its own process using pkill or killall targeting hermes, gateway, or cli.py, which was not caught by existing dangerous pattern checks. The fixes add self-termination guards to cover these cases.
Open issues0
Open PRs0
Fixes on record
-
#3593 fix: add self-termination guard for pkill/killall targeting hermes/gateway
files:
tests/tools/test_approval.py,tools/approval.pyShow the diff
-
tests/tools/test_approval.py@@ -512,6 +512,30 @@ def test_systemctl_restart_not_flagged(self): dangerous, key, desc = detect_dangerous_command(cmd) assert dangerous is False + def test_pkill_hermes_detected(self): + """pkill targeting hermes/gateway processes must be caught.""" + cmd = 'pkill -f "cli.py --gateway"' + dangerous, key, desc = detect_dangerous_command(cmd) + assert dangerous is True + assert "self-termination" in desc + + def test_killall_hermes_detected(self): + cmd = "killall hermes" + dangerous, key, desc = detect_dangerous_command(cmd) + assert dangerous is True + assert "self-termination" in desc + + def test_pkill_gateway_detected(self): + cmd = "pkill -f gateway" + dangerous, key, desc = detect_dangerous_command(cmd) + assert dangerous is True + + def test_pkill_unrelated_not_flagged(self): + """pkill targeting unrelated processes should not be flagged.""" + cmd = "pkill -f nginx" + dangerous, key, desc = detect_dangerous_command(cmd) + assert dangerous is False + class TestNormalizationBypass: """Obfuscation techniques must not bypass dangerous command detection.""" -
tools/approval.py@@ -53,6 +53,8 @@ # Gateway protection: never start gateway outside systemd management (r'gateway\s+run\b.*(&\s*$|&\s*;|\bdisown\b|\bsetsid\b)', "start gateway outside systemd (use 'systemctl --user restart hermes-gateway')"), (r'\bnohup\b.*gateway\s+run\b', "start gateway outside systemd (use 'systemctl --user restart hermes-gateway')"), + # Self-termination protection: prevent agent from killing its own process + (r'\b(pkill|killall)\b.*\b(hermes|gateway|cli\.py)\b', "kill hermes/gateway process (self-termination)"), ]
-
2 PRs closed without merging
From the close comments: merged via another change 2
Closed issues · 1
- Closed#3397[Bug]: agent self-terminates via `pkill -f "cli.py --gateway"` — not caught by DANGEROUS_PATTERNS
How this cluster was grouped
-
Link evidence (
structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference. -
Pairwise link density
0.50: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- agent
- Merged PRs
- #3593
- Closed issues
- 1
- Attempts
- 2 PRs closed without merging
- Fix link checked
- 28 Mar 2026. This confirmation is old and may be out of date (a revert or reopen would not have invalidated it here); re-verify.