Skip to content

[FEATURE]: Workspace Trust Dialog & Universal Permission Hooks (Mitigating Supply Chain RCE) #15234

Closed

Description

@n24q02m

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Description:
Currently, OpenCode auto-loads local .opencode.json configs and MCP servers without explicit consent, leading to potential arbitrary command execution (as reported in #6361). Recently, Anthropic's Claude Code faced a similar critical vulnerability (CVE-2025-59536) where attackers achieved RCE and token exfiltration via malicious project configs.

Additionally, users often experience "prompt fatigue" when the permission system asks for confirmation on harmless read-only operations.

Proposal:
Implement a comprehensive revamp of the initialization and permission system to match the new standards set by Claude Code:

  1. Workspace Trust Dialog:

    • Defer all local tool, hook, and MCP initializations until the user explicitly confirms "Trust Workspace" for unrecognized directories.
    • Store trusted paths globally (e.g., in globalSync.data.config.trustedWorkspaces).
  2. Universal Permission Hooks:

    • Auto-approve Safe Tools: Automatically allow read-only operations (e.g., read, list, search, get, glob) to reduce prompt fatigue.
    • Strict Prompts for Destructive Tools: Always require explicit approval for state-mutating operations (e.g., write, bash, execute, delete), regardless of agent intent.

Impact:
Secures OpenCode against supply-chain attacks via malicious repositories while vastly improving UX by eliminating unnecessary permission prompts for read tasks.

Activity

  1. added
    core
    on Feb 26, 2026
  2. n24q02m commented on Apr 2, 2026

    @n24q02m
    Author

    Closing — I'm no longer actively using OpenCode. Thank you for triaging.

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

Metadata

Metadata

Assignees

Labels

core

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions