opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: allow writes to /tmp by default without permission prompt

Open remorses opened this issue 2 weeks ago • 6 comments

Add Filesystem.isAllowedPath() helper that allows access to project directory, os.tmpdir(), and /tmp without prompting for external directory permission.

Fixes #5386 Fixes #4743

remorses avatar Dec 11 '25 16:12 remorses

/review

rekram1-node avatar Dec 12 '25 06:12 rekram1-node

Can we make it optional for this from the configuration like the following?

"permission": {
  "external_directory": {
    "env:$TMPDIR/test": "allow",
    "*": "deny",
  }
}

jiyeol-lee avatar Dec 12 '25 21:12 jiyeol-lee

yeah that's prolly fine

rekram1-node avatar Dec 12 '25 22:12 rekram1-node

@jiyeol-lee Why would you like to make it optional? Do you want to prevent the LLM to write to /tmp?

remorses avatar Dec 12 '25 22:12 remorses

that's what I was wondering too but letting people override that perm in general makes sense, best done in separate pr tho

rekram1-node avatar Dec 12 '25 22:12 rekram1-node

@jiyeol-lee Why would you like to make it optional? Do you want to prevent the LLM to write to /tmp?

@remorses @rekram1-node Yes, I don't want LLM to write, especially read /tmp. I usually have multiple credentials in there temporary and I don't want LLM read things that I didn't expect to do. It would be amazing if we make it configurable by the individual user unless it's a project directory.

jiyeol-lee avatar Dec 13 '25 01:12 jiyeol-lee