GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — grep tool ignores per-pattern deny permission rules · Issue #35503 · anomalyco/opencode

grep tool ignores per-pattern deny permission rules #35503

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
grep tool ignores per-pattern deny permission rules#35503
Copy link
Assignees
kitlangton

Description

@CryptoSiD
CryptoSiD
opened on Jul 6, 2026
Issue body actions

Description

Per-pattern permission rules defined under "grep" in opencode.json are not enforced.
Files set to "deny" in the grep rules still return their content when matched. The same pattern-based rules work correctly under "read" and "glob".

Expected behavior: grep should block matches inside files matching denied patterns, showing a permission denied message — the same way read and glob do.

Additional context: "read" and "glob" per-pattern rules work as expected with identical pattern syntax. The file include filter on grep appears to bypass the permission check entirely.

Plugins

None

OpenCode version

1.17.13

Steps to reproduce

  1. Create a project with .opencode/opencode.json:
    {
    "permission": {
    "grep": {
    "": "allow",
    "
    /config.php": "deny"
    }
    }
    }
  2. Create config.php with any content
  3. Run: grep with "pattern": "any-string", "include": "config.php"
  4. The config.php content is returned — no permission block

Screenshot and/or share link

No response

Operating System

Ubuntu 26.10

Terminal

Tabby

Reacted by Mac Moneysac

Activity

  1. github-actions
    assigned
    kitlangton
    on Jul 6, 2026
  2. github-actions commented on Jul 6, 2026

    @github-actions
    github-actionsBot
    on Jul 6, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Granular read permission deny rules don't block file access (patterns never match) #28150: Granular per-pattern deny rules don't block file access for read, glob, and grep tools
    • The Read, Glob, and Grep tools do not verify these rules before execution. #29674: The Read, Glob, and Grep tools do not verify permission rules before execution

    These issues report the same or closely related behavior where pattern-based deny rules in the permission config are not enforced at the tool level.

  3. Mac-Moneysac commented on Aug 18, 2026

    @Mac-Moneysac
    Mac-Moneysac
    on Aug 18, 2026
    More actions

    I hope that this fix/feature will be implemented somehow. Analogously to other agentic tools, read permissions could influence grep permissions implicitly, e.g. by filtering matches afterwards.

    However, permissions based on grep patterns is rather useless IMHO.

  4. neriousy commented on Oct 1, 2026

    @neriousy
    neriousy
    on Oct 1, 2026
    Member
    More actions

    Closing as a duplicate of #17073, which tracks grep and glob not applying per-file permission rules. Permissions for these tools are checked against the search pattern, not against each matched file, so deny rules for specific files don't filter results. Please follow and 👍 there.

  5. neriousy
    closed this as a duplicateof [FEATURE]: Protect .env files in grep/glob results, not just direct read #17073 on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.