Skip to content

fix(approval): harden YOLO mode env parsing against quoted-bool strings#18214

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c234d0c5
May 1, 2026
Merged

fix(approval): harden YOLO mode env parsing against quoted-bool strings#18214
teknium1 merged 1 commit into
mainfrom
hermes/hermes-c234d0c5

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 1, 2026

Salvage of #16339 by @hharry11 onto current main.

Summary

HERMES_YOLO_MODE=false (or 0/off/no) now correctly disables YOLO instead of bypassing dangerous-command approval — previously bool(os.getenv(...)) on any non-empty string evaluated truthy.

Changes

  • tools/approval.py: both read sites use shared is_truthy_value() helper
  • cli.py + tui_gateway/server.py: YOLO toggle state detection matches the same semantics
  • Regression tests for false-like strings in approval path, combined guard, and TUI gateway process-scope toggle

Validation

  • E2E: YOLO=false bypass confirmed on current main → blocked on this branch; YOLO=1 still bypasses (no regression)
  • 296/296 tests pass across tests/tools/test_yolo_mode.py, tests/test_tui_gateway_server.py, tests/tools/test_command_guards.py, tests/tools/test_hardline_blocklist.py

Closes #16339.

@teknium1 teknium1 merged commit 24130b7 into main May 1, 2026
9 of 10 checks passed
@teknium1 teknium1 deleted the hermes/hermes-c234d0c5 branch May 1, 2026 03:37
@alt-glitch alt-glitch added type/security Security vulnerability or hardening P1 High — major feature broken, no workaround comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent loop, run_agent.py, prompt builder labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/cli CLI entry point, hermes_cli/, setup wizard P1 High — major feature broken, no workaround type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants