Skip to content

tools config deny rules silently overridden by "*": "ask" in permission config #15664

Closed as not planned

Description

@Gamezar

Description

Can't disable tools from mcp server that I don't use. I listed "": "ask" in my permissions config - opus found out that this is the issue - I verified that without "": "ask" exclusion works.

Here is short summary:
- Root cause: config.ts:215 — mergeDeep(perms, result.permission) places tools-derived deny rules before the catch-all ask rule, and disabled() at next.ts:252
uses findLast which returns the catch-all instead of the more specific rule
- Fix suggestion: Either use specificity-based matching in disabled(), or reverse the merge order to mergeDeep(result.permission, perms) so deny rules come after
the catch-all

Plugins

No response

OpenCode version

1.2.15

Steps to reproduce

  1. Create a global config at ~/.config/opencode/opencode.json with both a tools section (deny rules using glob patterns) and a permission section containing a
    "*": "ask" catch-all:

{
tools: {
some_tool_*: false
},
permission: {
*: ask,
read: allow
}
}

  1. Have an MCP server registered that provides tools matching the glob pattern (e.g., some_tool_foo, some_tool_bar)

  2. Restart OpenCode

  3. Ask the agent to list its available tools — the denied tools still appear

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 2, 2026
  2. github-actions commented on Mar 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from the above, please add a comment clarifying how it differs.

  3. Gamezar commented on Mar 2, 2026

    @Gamezar
    Author

    Not well-versed with opencode to understand similarity.

    For me it seems like different issue, but maybe similar symptomps

  4. assigned and unassigned on Apr 26, 2026
  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions