Skip to content

approval: add docker restart/stop/kill to DANGEROUS_PATTERNS#33438

Merged
benbarclay merged 1 commit into
NousResearch:mainfrom
Sarbai:fix/docker-approval-patterns
May 29, 2026
Merged

approval: add docker restart/stop/kill to DANGEROUS_PATTERNS#33438
benbarclay merged 1 commit into
NousResearch:mainfrom
Sarbai:fix/docker-approval-patterns

Conversation

@Sarbai

@Sarbai Sarbai commented May 27, 2026

Copy link
Copy Markdown
Contributor

When docker.sock is mounted (standard Docker Compose setup), the agent can run docker restart/stop/kill without approval. hermes gateway restart was already protected, but Docker equivalents were missing. This caused a self-termination loop. Fix: added docker restart/stop/kill and docker compose restart/stop/kill/down to DANGEROUS_PATTERNS. +7 lines in tools/approval.py.

When docker.sock is mounted (common Docker Compose pattern), the agent
can restart/stop/kill containers without user approval. hermes gateway
restart is already protected, but docker restart, docker stop,
docker kill, and their docker compose equivalents were not.

This caused repeated self-termination: the agent ran docker restart
hermes, killed its own container, Docker restarted it (restart policy),
and the agent resumed the same session — creating a restart loop.

Added patterns mirror the existing gateway lifecycle protection:
- docker compose restart/stop/kill/down
- docker restart/stop/kill
@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder area/docker Docker image, Compose, packaging labels May 27, 2026
@benbarclay benbarclay merged commit 54bf798 into NousResearch:main May 29, 2026
davidgut1982 added a commit to davidgut1982/hermes-agent that referenced this pull request May 31, 2026
…heck-attribution gate

- batosk2@gmail.com → Sarbai (identified via PR NousResearch#33438 author)
- ilonagaja509-glitch@users.noreply.github.com → ilonagaja509-glitch (bare noreply, no numeric prefix → fails CI auto-skip regex)
- redpiggy-cyber@users.noreply.github.com → redpiggy-cyber (bare noreply, no numeric prefix → fails CI auto-skip regex)
- sohyuanchin@gmail.com → wysie (confirmed same author as wysie@users.noreply.github.com via git log)
KKT-OPT pushed a commit to KKT-OPT/hermes-agent that referenced this pull request May 31, 2026
…earch#33438)

When docker.sock is mounted (common Docker Compose pattern), the agent
can restart/stop/kill containers without user approval. hermes gateway
restart is already protected, but docker restart, docker stop,
docker kill, and their docker compose equivalents were not.

This caused repeated self-termination: the agent ran docker restart
hermes, killed its own container, Docker restarted it (restart policy),
and the agent resumed the same session — creating a restart loop.

Added patterns mirror the existing gateway lifecycle protection:
- docker compose restart/stop/kill/down
- docker restart/stop/kill

Co-authored-by: Sarbai <sarbai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants