Skip to content

feat(plugins): add pre_tool_call "approve" action and plugin mode #11812

@vaddisrinivas

Description

@vaddisrinivas

Summary

Extend the pre_tool_call hook system to support an {"action": "approve"} directive, allowing plugins to override built-in approval checks (e.g., dangerous command detection).

Changes

  • hermes_cli/plugins.py:

    • Rename get_pre_tool_call_block_message()get_pre_tool_call_directive()
    • Return tuple (directive, message) where directive is "block", "approve", or None
  • tools/terminal_tool.py:

    • Check for "approve" directive before security checks
    • Skip dangerous-command guard when plugin approves
  • tools/approval.py:

    • Add "plugin" to approval modes
    • Return early with {"approved": True, "plugin_mode": True} when in plugin mode

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstool/terminalTerminal execution and process managementtype/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