Skip to content

Feature: Approval prompts should include the agent's contextual rationale (like Codex) #27604

@dbohman18

Description

@dbohman18

Problem

When Hermes requests approval for a dangerous command, the prompt currently shows only a static pattern label as the reason (e.g. "dangerous command", "service restart", "filesystem deletion").

Example of what the Telegram gateway shows:

⚠️ Command Approval Required

`hermes update`

Reason: dangerous command

The user has to infer from context WHY the agent wants to run this command — which is often unclear, especially when multiple things are happening in a session.

Desired Behavior (inspired by Codex)

Before presenting the approval prompt, the agent should include a brief contextual explanation of why the command is needed in the current task context. For example:

⚠️ Command Approval Required

I just installed a Hermes update that requires a gateway restart to take effect.

`systemctl --user restart hermes-gateway`

Reason: service restart

This makes approval decisions much easier — the user knows why the command is necessary before choosing Allow/Deny.

Suggested Implementation

  • Allow the agent / LLM to prepend a contextual explanation to the approval prompt
  • This could be:
    • An additional text field in prompt_dangerous_approval() (e.g. contextual_reason)
    • Or the agent writes the explanation as a normal message before the tool call, and the approval system preserves it
  • The static description from detect_dangerous_command() would remain as supplementary info

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardcomp/gatewayGateway runner, session dispatch, deliverytype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions