hermes-agent/tools
Scott Gabel 4a7a6fd401 fix(approval): redact secrets in user-facing approval prompts
The dangerous-command approval prompt renders the flagged command so the
user can decide whether to approve. If the agent constructed it with a
credential (curl -H 'Authorization: Bearer sk-...', psql postgres://user:pw@host,
an execute_code script with api_key = 'sk-...'), that secret hit stdout and,
via the gateway notify payload, Discord/Slack messages — which are
screenshottable and forwardable.

Apply the existing agent.redact.redact_sensitive_text() to every user-facing
approval surface. Redaction is display-only: the raw command still executes
after approval, and approval persistence keys off pattern_key (not the command
text), so the allowlist is unaffected. Decision context (URL, flags, command
structure) is preserved; only the secret value masks.

Covers all surfaces, including the execute_code path the original PR missed:
- prompt_dangerous_approval(): callback + stdout fallback
- check_all_command_guards(): gateway approval_data + cron/batch pending fallback
- check_execute_code_guard(): gateway approval_data + no-notifier pending fallback
  (script body can embed credentials)

Adds TestApprovalPromptRedaction covering callback redaction, no-over-redaction
of clean commands, and the execute_code pending fallback.

Salvaged from PR #13139 by @sgabel; extended to the execute_code surface.
2026-06-30 17:29:11 -07:00
..
computer_use revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
environments fix(terminal): prevent corrupted session snapshots during init 2026-06-30 15:51:17 -07:00
neutts_samples
…
__init__.py
…
ansi_strip.py
…
approval.py fix(approval): redact secrets in user-facing approval prompts 2026-06-30 17:29:11 -07:00
async_delegation.py style(profile): trim verbose comments to one or two lines 2026-06-30 15:30:06 -07:00
binary_extensions.py
…
blueprints.py
…
browser_camofox.py fix(camofox): auto-recover from stale tab 404 on navigate 2026-06-29 01:26:24 -07:00
browser_camofox_state.py
…
browser_cdp_tool.py
…
browser_dialog_tool.py
…
browser_supervisor.py
…
browser_tool.py fix(security): redact browser CDP endpoint logs 2026-06-29 04:25:26 -07:00
budget_config.py
…
checkpoint_manager.py refactor(windows): unify windowless spawn form across the touched sites 2026-06-28 17:44:47 -05:00
clarify_gateway.py fix: accept typed clarify choice replies 2026-06-28 04:13:19 -07:00
clarify_tool.py
…
close_terminal_tool.py feat(desktop): live agent terminals + agent-driven tab close 2026-06-28 21:15:14 -05:00
code_execution_tool.py fix(security): harden heredoc approval, NFKC homograph fold, env-var filter 2026-06-30 02:59:46 -07:00
computer_use_tool.py
…
credential_files.py fix(delegation): budget subagent summaries against parent context headroom 2026-06-30 03:07:40 -07:00
cronjob_tools.py
…
debug_helpers.py
…
delegate_tool.py fix(tools): prune acp_command from delegate_task schema when no ACP CLI is on PATH 2026-06-30 03:41:46 -07:00
discord_tool.py
…
env_passthrough.py fix(env-passthrough): fail closed when provider blocklist import fails 2026-06-28 02:05:43 -07:00
env_probe.py
…
fal_common.py
…
feishu_doc_tool.py
…
feishu_drive_tool.py
…
file_operations.py
…
file_state.py
…
file_tools.py fix(security): cover Move and no-space headers in patch_tool sensitive path check 2026-06-30 02:50:24 -07:00
fuzzy_match.py
…
homeassistant_tool.py
…
image_generation_tool.py
…
interrupt.py
…
kanban_tools.py fix(kanban): restrict goal_mode kanban_block to genuine external blockers 2026-06-30 14:29:42 -07:00
lazy_deps.py fix(memory): lazy-install supermemory + mem0 SDKs like honcho/hindsight 2026-06-29 00:25:36 -07:00
managed_tool_gateway.py
…
mcp_oauth.py fix(mcp): suppress interactive OAuth stdin prompts during background discovery (#35927) 2026-06-27 04:59:23 +05:30
mcp_oauth_manager.py fix(mcp-oauth): anchor 401 handler task to prevent GC mid-flight 2026-06-30 16:56:15 -07:00
mcp_tool.py fix(mcp): skip preflight content-type probe for OAuth servers 2026-06-28 04:47:39 -07:00
memory_tool.py fix(memory): degrade gracefully after repeated at-capacity consolidation failures (#42405) 2026-06-30 20:01:16 +05:30
microsoft_graph_auth.py
…
microsoft_graph_client.py
…
neutts_synth.py
…
openrouter_client.py
…
osv_check.py
…
patch_parser.py
…
path_security.py
…
process_registry.py fix(desktop): tree-kill Windows terminal descendants 2026-06-30 04:23:27 -05:00
project_tools.py
…
read_extract.py
…
read_terminal_tool.py
…
registry.py refactor(registry): drop dead toolset-check helpers after per-tool availability 2026-06-30 17:47:37 +05:30
schema_sanitizer.py
…
send_message_tool.py fix(telegram): chunk formatted messages with UTF-16 length accounting 2026-06-30 03:51:08 -07:00
session_search_tool.py fix(session_search): demote cron below interactive sessions in discover ranking (#53597) 2026-06-27 04:41:22 -07:00
skill_manager_tool.py fix(skills): require review forks to read before writing skills 2026-06-30 15:49:36 -07:00
skill_provenance.py
…
skill_usage.py
…
skills_ast_audit.py
…
skills_guard.py
…
skills_hub.py style(profile): trim verbose comments to one or two lines 2026-06-30 15:30:06 -07:00
skills_sync.py fix(skills): skip shadowing when external_dirs provides the skill 2026-06-27 21:07:53 -07:00
skills_tool.py fix(skills): require review forks to read before writing skills 2026-06-30 15:49:36 -07:00
slash_confirm.py
…
terminal_tool.py fix(terminal): require approval for host-bound Docker commands (#54483) 2026-06-29 11:35:41 +10:00
thread_context.py
…
threat_patterns.py fix(security): harden heredoc approval, NFKC homograph fold, env-var filter 2026-06-30 02:59:46 -07:00
tirith_security.py
…
todo_tool.py
…
tool_backend_helpers.py
…
tool_output_limits.py
…
tool_result_storage.py fix: keep persisted tool results inside their storage directory 2026-06-30 16:39:41 -07:00
tool_search.py
…
transcription_tools.py fix(windows): hide remaining backend console-flash legs missed on main 2026-06-28 10:19:21 -05:00
tts_tool.py fix(windows): hide remaining backend console-flash legs missed on main 2026-06-28 10:19:21 -05:00
url_safety.py
…
video_generation_tool.py feat(xai): Imagine public-URL storage, chaining & video edit/extend 2026-06-29 21:11:58 -07:00
vision_tools.py fix(vision): narrow the fan-out cap to the CPU encode burst only 2026-06-29 01:27:10 -07:00
voice_mode.py
…
web_tools.py fix(web_extract): bound stored full-text size + give concrete read_file offset 2026-06-30 00:19:49 -07:00
website_policy.py
…
write_approval.py
…
x_search_tool.py
…
xai_http.py feat(xai): Imagine public-URL storage, chaining & video edit/extend 2026-06-29 21:11:58 -07:00
xai_video_tools.py feat(xai): Imagine public-URL storage, chaining & video edit/extend 2026-06-29 21:11:58 -07:00
yuanbao_tools.py
…