[FEATURE]: Limit tool (e.g. write, edit) permissions to specific folders #3945

Open
opened 2026-02-16 17:42:02 -05:00 by yindo · 2 comments
Owner

Originally created by @driebe on GitHub (Dec 28, 2025).

Originally assigned to: @thdxr on GitHub.

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

Hi opencode team,

I love your product and have a suggestion on how to improve secure interaction with the agents. It would be great if some of the tools (primarily write & edit) could be limited to certain project folders in the project.

For example: I want to limit my tester.md to only be able to create files in my ____tests_____ folders or edit files which have test in the filename - but no other files.

This could potentially look like this:

permission:
  write:
    "*/*test*": allow
    "*": deny
  edit:
    "*/*test*": allow
    "*": deny

Thanks for your consideration!

Originally created by @driebe on GitHub (Dec 28, 2025). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Hi opencode team, I love your product and have a suggestion on how to improve secure interaction with the agents. It would be great if some of the tools (primarily write & edit) could be limited to certain project folders in the project. For example: I want to limit my tester.md to only be able to create files in my `____tests_____` folders or edit files which have `test` in the filename - but no other files. This could potentially look like this: ``` permission: write: "*/*test*": allow "*": deny edit: "*/*test*": allow "*": deny ``` Thanks for your consideration!
yindo added the discussion label 2026-02-16 17:42:02 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 28, 2025):

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

  • #5529: [FEATURE]: Add per-agent filesystem boundaries (allow/deny paths) + optional run-as user for bash - This is the most comprehensive and directly related issue, proposing allow/deny filesystem path patterns per-agent with extensive discussion on implementation
  • #4667: Limiting access for tools in a safer way - Proposes sandbox-style security contexts with read/write path restrictions and allowed executables
  • #3585: Add pattern-based directory access restrictions to prevent verbose per-tool configurations - Requests global pattern-based exclusion rules for sensitive files
  • #2242: Is there a way to sandbox the agent? - General sandboxing request with discussion about restricting access outside the working directory

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 28, 2025): This issue might be a duplicate of existing issues. Please check: - #5529: [FEATURE]: Add per-agent filesystem boundaries (allow/deny paths) + optional run-as user for bash - This is the most comprehensive and directly related issue, proposing allow/deny filesystem path patterns per-agent with extensive discussion on implementation - #4667: Limiting access for tools in a safer way - Proposes sandbox-style security contexts with read/write path restrictions and allowed executables - #3585: Add pattern-based directory access restrictions to prevent verbose per-tool configurations - Requests global pattern-based exclusion rules for sensitive files - #2242: Is there a way to sandbox the agent? - General sandboxing request with discussion about restricting access outside the working directory Feel free to ignore if none of these address your specific case.
Author
Owner

@driebe commented on GitHub (Dec 28, 2025):

Your github actions search is way more comprehensive than the GitiHub search :(. I will close this for #5529

@driebe commented on GitHub (Dec 28, 2025): Your github actions search is way more comprehensive than the GitiHub search :(. I will close this for #5529
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3945