Skip to content

File and command permissions in OpenCode #16914

Closed as not planned
Closed as not planned

Description

@SebastienTs

Question

I understand that it is probably way more difficult to achieve on Windows than on Linux but how can I restrict my agent to not be able to access (that is no read, write but ALSO no listing whatsoever) any file outside the current project folder and ALSO prevent any bash command to target any file outside the same scope without asking?

Currently I have:

{ "$schema": "https://opencode.ai/config.json", "permission": { "bash": { "*": "ask", "* D:/OpenCode_Projects/*": "allow", }, "external_directory": {"*": "ask"} } }

But it is not ideal. Is there a wildcard for files inside the current project folder?

What if the agent write a script overcoming these restrictions and run it inside the project folder?

Also, when asked to accept a command it would be very useful to have an option "Always (Exact Same)" to only accept future execution of the exact same command, including all arguments (for instance activate a conda env and run a Python script) but not any other command.

Activity

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

    @github-actions
    Contributor

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

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. mathstuf commented on Jun 15, 2026

    @mathstuf

    jai might be something you're looking for? Or perhaps matchlock?

  5. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Collaborator

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

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