Skip to content

fix(approval): catch hermes gateway stop/restart behind a profile flag - #55515

Merged
teknium1 merged 1 commit into
mainfrom
fix/approval-profile-flag-gateway-guard
Jun 30, 2026
Merged

fix(approval): catch hermes gateway stop/restart behind a profile flag#55515
teknium1 merged 1 commit into
mainfrom
fix/approval-profile-flag-gateway-guard

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

hermes -p <profile> gateway restart is now flagged by the approval layer — a profile flag between hermes and gateway no longer slips the agent past the gateway-lifecycle guard. That gap is the exact form from the 2026-04-11 ade-profile self-kill loop.

Root cause: the guard's hermes-CLI pattern required hermes and gateway to be adjacent (\bhermes\s+gateway\s+(stop|restart)\b), so any global flag in between defeated it.

Changes

  • tools/approval.py: allow an optional run of global flags (-p ade, --profile ade, multiple flags) between hermes and the gateway stop|restart subcommand.
  • tests/tools/test_approval.py: +7 tests covering the profile-flag forms and the still-safe start/status negatives.

Validation

Command Before After
hermes gateway stop flagged flagged
hermes -p ade gateway restart not flagged flagged
hermes --profile ade gateway stop not flagged flagged
hermes -p cocoa --verbose gateway restart not flagged flagged
hermes -p ade gateway status not flagged not flagged
hermes gateway start not flagged not flagged

scripts/run_tests.sh tests/tools/test_approval.py → 252 passed, 0 failed.

Relationship to #7817

Supersedes #7817 (@BrownBear127). That PR proposed adding a separate launchctl block + a hermes … gateway (restart|stop|kill) pattern. The launchctl half is already fully covered on main by #33071 (launchctl (stop|kickstart|bootout|unload|kill|disable|remove) … hermes), and gateway kill is not a real subcommand. This change narrows the one genuine residual gap — the profile-flag adjacency — without redundant patterns.

Infographic

infographic

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by #33071; this
narrows the only remaining real gap.
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/tools Tool registry, model_tools, toolsets tool/terminal Terminal execution and process management sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data P2 Medium — degraded but workaround exists labels Jun 30, 2026
@teknium1
teknium1 merged commit b03635d into main Jun 30, 2026
31 checks passed
@teknium1
teknium1 deleted the fix/approval-profile-flag-gateway-guard branch June 30, 2026 09:48
dtera pushed a commit to dtera/hermes-agent that referenced this pull request Jul 1, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
Jasper6439 pushed a commit to Jasper6439/hermes-agent that referenced this pull request Jul 5, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
NousResearch#55515)

The gateway-lifecycle guard's hermes-CLI pattern required `hermes`
and `gateway` to be adjacent, so a profile flag slipped the agent
past it: `hermes -p ade gateway restart` was not flagged. That is the
exact form from the 2026-04-11 ade-profile self-kill loop. Allow an
optional run of global flags (`-p ade`, `--profile ade`, multiple
flags) between `hermes` and the gateway subcommand.

launchctl self-termination is already covered on main by NousResearch#33071; this
narrows the only remaining real gap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/terminal Terminal execution and process management type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants