Skip to content

Remote auto-approve safe tools uses inconsistent tool names #258

@MicroMilo

Description

@MicroMilo

Summary

Remote autoApproveSafeTools promises to auto-approve safe tools such as file reads and browser operations, but the remote validator compares a display/tool name against a case-sensitive safelist that uses different names. As a result, minimal safe-tool inputs such as read and navigate_page are not auto-approved, while Task is auto-approved even though the UI copy does not describe delegation/subagent tools as safe.

Minimal Reproduction

  1. Enable remote control with autoApproveSafeTools=true.
  2. Send these tool names through the same remote auto-approve check used by remote-manager.ts:
    • read
    • navigate_page
    • Task

Current result:

  • read does not match the safelist entry Read.
  • navigate_page does not match the safelist entry mcp__Chrome__navigate_page.
  • Task matches the safelist and is auto-approved.

Evidence

  • src/renderer/components/remote/AdvancedConfigStep.tsx:63-83 renders the autoApproveSafeTools toggle.
  • src/renderer/i18n/locales/en.json:840-841 describes the feature as auto-approving safe tools such as file reads and browser operations.
  • src/main/remote/remote-manager.ts:618-655 performs auto-approval with safeTools.includes(toolName).
  • src/main/remote/remote-manager.ts:621-648 includes Read, Chrome MCP canonical-looking names such as mcp__Chrome__navigate_page, and Task in the safelist.
  • src/main/claude/agent-runner.ts:979-982 passes displayName to requestPermission(...), not the canonical toolName.
  • src/main/claude/agent-runner.ts:1021-1042 can serialize MCP tools to names such as navigate_page.
  • src/main/config/permission-rules-store.ts:18-28 and src/renderer/store/index.ts:207-214 use lowercase local default tool names such as read, glob, grep, and ls.

Actual Behavior

The remote auto-approve path is name-sensitive and receives names that do not match the safelist. Safe file/browser operations are not reliably auto-approved. Task is auto-approved although the user-facing description does not include delegation/subagent capability in the safe-tool boundary.

Expected Behavior

Remote auto-approval should use one canonical tool-name contract. User-visible display names can be used in UI messages, but authorization should not depend on display names or case variants.

The Task entry should either be removed from the default safe list or explicitly documented in the UI as an auto-approved capability.

Existing Issue / PR Coverage

Checked open and closed issues/PRs with:

  • autoApproveSafeTools safeTools remote permission Task
  • requestPermission displayName remote safe tools

No direct coverage was found.

Related but not covering this bug:

Proposed Fix

  • Carry both canonical tool name and display name in permission request payloads.
  • Base remote auto-approval on canonical names only.
  • Keep display names only for user-facing feedback.
  • Add a normalization helper for MCP names, casing, originalName, and display names.
  • Re-evaluate whether Task should be in the default safe list.

Suggested Tests

  • With autoApproveSafeTools=true, read, glob, grep, and ls are auto-approved through canonical matching.
  • Chrome MCP browser tools are auto-approved regardless of display-name serialization.
  • Task behavior is explicitly tested: either not auto-approved, or documented and intentionally auto-approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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