Skip to content

glob tool ignores deny rules for matched file paths #35684

Closed as not planned
Closed as not planned

Description

@fengjikui

Description

glob permission rules can allow a broad query pattern while still denying specific matched file paths, but the tool currently only checks the query pattern before executing.

For example, with:

{
  "permission": {
    "glob": {
      "**": "allow",
      "**/secret.txt": "deny"
    }
  }
}

a glob call with pattern: "**/*.txt" can still return src/secret.txt, because the permission check sees only the query pattern (**/*.txt) and never evaluates the matched file path.

Expected behavior: before returning glob results, path-scoped glob deny rules should be enforced against the matched worktree-relative file paths.

Plugins

None

OpenCode version

Current dev branch

Steps to reproduce

  1. Configure glob permission rules with a broad allow and a more specific denied path, such as "**/secret.txt": "deny".
  2. Create src/secret.txt.
  3. Run the glob tool with a broad pattern such as "**/*.txt".
  4. The denied file can be returned because only the query pattern is checked.

Screenshot and/or share link

No response

Operating System

macOS

Terminal

No response

Activity

  1. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

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

  2. github-actions commented on Sep 6, 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