hermes-agent/gateway
Teknium 7b6d14e62a
fix(gateway): replace bare text approval with /approve and /deny commands (#2002)
The gateway approval system previously intercepted bare 'yes'/'no' text
from the user's next message to approve/deny dangerous commands. This was
fragile and dangerous — if the agent asked a clarify question and the user
said 'yes' to answer it, the gateway would execute the pending dangerous
command instead. (Fixes #1888)

Changes:
- Remove bare text matching ('yes', 'y', 'approve', 'ok', etc.) from
  _handle_message approval check
- Add /approve and /deny as gateway-only slash commands in the command
  registry
- /approve supports scoping: /approve (one-time), /approve session,
  /approve always (permanent)
- Add 5-minute timeout for stale approvals
- Gateway appends structured instructions to the agent response when a
  dangerous command is pending, telling the user exactly how to respond
- 9 tests covering approve, deny, timeout, scoping, and verification
  that bare 'yes' no longer triggers execution

Credit to @solo386 and @FlyByNight69420 for identifying and reporting
this security issue in PR #1971 and issue #1888.

Co-authored-by: Test <test@test.com>
2026-03-18 16:58:20 -07:00
..
platforms fix: send error details to user in gateway outer exception handler 2026-03-18 10:42:43 -07:00
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
channel_directory.py feat: add SMS (Twilio) platform adapter 2026-03-17 03:14:53 -07:00
config.py fix: whatsapp reply_prefix config.yaml bridging was dead code (#1923) 2026-03-18 04:18:33 -07:00
delivery.py Merge origin/main into hermes/hermes-5d160594 2026-03-14 19:34:05 -07:00
hooks.py feat(hooks): emit session:end lifecycle event (#1725) 2026-03-17 04:17:44 -07:00
mirror.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
pairing.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
run.py fix(gateway): replace bare text approval with /approve and /deny commands (#2002) 2026-03-18 16:58:20 -07:00
session.py fix(session): skip corrupt lines in load_transcript instead of crashing (#1744) 2026-03-17 05:18:12 -07:00
status.py fix(gateway): detect script-style gateway processes for --replace 2026-03-18 03:12:59 -07:00
sticker_cache.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
stream_consumer.py fix: handle message length overflow in streaming mode (#1783) 2026-03-17 11:00:52 -07:00