hermes-agent/tools
Rowland O'Connor ca076eef8a fix(approval): apply noninteractive_mode in the consolidated guard
Review found the knob had no effect on real terminal calls: terminal_tool
routes through check_all_command_guards, whose non-interactive early
return approves non-cron commands regardless of the setting. Only the
direct check_dangerous_command entry point was covered.

Applies the policy in the consolidated guard before that return, mirroring
the cron branch beside it — dangerous-pattern detection first, then the
tirith content check, including the tirith_fail_open handling so an
operator who opted into fail-closed is not silently allowed here either.

Also adds the two things the review asked for alongside it:

- approvals.noninteractive_mode in DEFAULT_CONFIG, so it participates in
  the documented deep-merge contract rather than existing only as a
  cfg_get default. New tests exercise the real config path (writing a
  config.yaml under HERMES_HOME) instead of mocking load_config, and
  assert sibling keys survive the merge.
- The key documented in website/docs/user-guide/configuration.md, which
  the first pass missed; security.md and the configuration reference in
  the skills tree were already updated.

Verified against a live install: with noninteractive_mode: deny and no
human present, `git reset --hard HEAD~3` now blocks through
check_all_command_guards where it was previously approved. A profile on
the default is unchanged. 24 tests in the new file, 105 across the
approval suite plus the config-contract tests.
2026-08-02 07:24:46 +01:00
..
computer_use
…
environments
…
neutts_samples
…
wakewords
…
__init__.py
…
ansi_strip.py
…
approval.py fix(approval): apply noninteractive_mode in the consolidated guard 2026-08-02 07:24:46 +01:00
async_delegation.py
…
audio_container.py
…
binary_extensions.py
…
blueprints.py
…
browser_camofox.py
…
browser_camofox_state.py
…
browser_cdp_tool.py
…
browser_dialog_tool.py
…
browser_supervisor.py
…
browser_tool.py
…
budget_config.py
…
checkpoint_manager.py
…
clarify_gateway.py
…
clarify_tool.py
…
close_terminal_tool.py
…
code_execution_tool.py
…
computer_use_tool.py
…
credential_files.py
…
cronjob_tools.py
…
daemon_pool.py
…
debug_helpers.py
…
delegate_tool.py
…
delegation_live_log.py
…
desktop_ui.py
…
discord_tool.py
…
env_passthrough.py
…
env_probe.py
…
fal_common.py
…
feishu_doc_tool.py
…
feishu_drive_tool.py
…
file_operations.py
…
file_state.py
…
file_tools.py
…
flux3_video_tool.py
…
focus_pane_tool.py
…
fuzzy_match.py
…
homeassistant_tool.py
…
hook_output_spill.py
…
image_generation_tool.py
…
image_source.py
…
interrupt.py
…
kanban_tools.py
…
lazy_deps.py
…
managed_tool_gateway.py
…
mcp_dashboard_oauth.py
…
mcp_oauth.py
…
mcp_oauth_manager.py
…
mcp_stdio_watchdog.py
…
mcp_tool.py
…
memory_tool.py
…
microsoft_graph_auth.py
…
microsoft_graph_client.py
…
neutts_synth.py
…
open_preview_tool.py
…
openrouter_client.py
…
osv_check.py
…
patch_parser.py
…
path_security.py
…
process_registry.py
…
project_tools.py
…
react_to_message_tool.py
…
read_extract.py
…
read_terminal_tool.py
…
registry.py
…
schema_sanitizer.py
…
send_message_tool.py
…
session_search_tool.py
…
skill_manager_tool.py
…
skill_provenance.py
…
skill_usage.py
…
skills_ast_audit.py
…
skills_guard.py
…
skills_hub.py
…
skills_sync.py
…
skills_sync_client.py
…
skills_tool.py
…
slash_confirm.py
…
terminal_tool.py
…
thread_context.py
…
threat_patterns.py
…
tirith_security.py
…
todo_tool.py
…
tool_backend_helpers.py
…
tool_output_limits.py
…
tool_result_storage.py
…
tool_search.py
…
transcription_tools.py
…
tts_streaming.py
…
tts_text_normalize.py
…
tts_tool.py
…
url_safety.py
…
video_generation_tool.py
…
vision_tools.py
…
voice_mode.py
…
wake_word.py
…
web_tools.py
…
website_policy.py
…
working_diff.py
…
write_approval.py
…
x_search_tool.py
…
xai_http.py
…
xai_video_tools.py
…
yuanbao_tools.py
…