Skip to content

[FEATURE] Add safety approval before executing any command #5

Closed

Description

@edenreich

Summary

This is essential in order to keep the operating system safe.

Every time the LLM wants to execute a tool, prompt the user back to confirmation with a drop down that they can either say yes for this particular command or yes for the entire chat session or completely reject the execution.

Acceptance Criteria

  • When a tool call is about to get executed the user is prompted
  • The prompt will contain a drop down with Yes, Yes, and don't ask again, No
  • If chosen Yes the command will be executed
  • if chosen Yes, and don't ask again the command and subsequent commands will be executed without a prompt
  • if chosen No the command will be ignore / not executed

Activity

  1. added
    enhancement
    on Aug 10, 2025
  2. edenreich commented on Aug 10, 2025

    @edenreich
    ContributorAuthor

    @claude Can you work on this one ?

  3. claude commented on Aug 10, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-5-20250810-1438 • Create PR ➔


    ✅ Safety approval system implemented successfully!

    I've successfully implemented the safety approval feature that prompts users before executing any command with the requested dropdown options.

    Todo List:

    • Analyze current codebase and tool execution flow
    • Design confirmation prompt system with dropdown options
    • Implement session-based approval tracking
    • Update configuration to support safety settings
    • Modify command execution flow to include safety checks
    • Add commands to manage safety settings
    • Test implementation with project task commands
    • Commit changes and create PR

    ✨ Implementation Summary:

    Core Features Implemented:

    • Safety Approval Prompt: Interactive prompt with three options as requested:
      1. "Yes" - Execute this command
      2. "Yes, and don't ask again" - Execute this and all future commands in the session
      3. "No" - Cancel command execution
    • Session-based Approval: Tracks approval decisions to avoid repeated prompts
    • Configuration Integration: New tools.safety.require_approval setting (enabled by default)

    New CLI Commands:

    • infer tools safety status - Show current safety approval status
    • infer tools safety enable - Enable safety approval requirement
    • infer tools safety disable - Disable safety approval requirement

    Technical Implementation:

    • Added SafetyConfig struct in config/config.go
    • Created ApprovalSession system in internal/safety.go
    • Integrated approval checks into ToolEngine.ExecuteBash() method
    • All commands tested successfully ✅
    • Code formatted and linted ✅

    Configuration Example:

    tools:
      enabled: true
      safety:
        require_approval: true  # Prompt user before executing any command

    The safety approval system is now active and will prompt users before executing any tool command, providing the exact dropdown options requested in the acceptance criteria.


  4. inference-gateway-releaser commented on Aug 10, 2025

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.3.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions