[FEATURE]: allow /tmp or $TMPDIR folder access option #3116

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

Originally created by @jiyeol-lee-kds on GitHub (Nov 25, 2025).

Originally assigned to: @rekram1-node 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

Can we have an option to allow write access under /tmp or $TMPDIR to when they are outside of current project directory? Or we can also make the external_directory more extensible like the following

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "external_directory": {
      "env:$TMPDIR": "allow",
      "/tmp": "allow",
      "*": "allow",
    }
  }
}

What do you guys think?

Originally created by @jiyeol-lee-kds on GitHub (Nov 25, 2025). Originally assigned to: @rekram1-node 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 Can we have an option to allow write access under /tmp or $TMPDIR to when they are outside of current project directory? Or we can also make the `external_directory` more extensible like the following ```json { "$schema": "https://opencode.ai/config.json", "permission": { "external_directory": { "env:$TMPDIR": "allow", "/tmp": "allow", "*": "allow", } } } ``` What do you guys think?
yindo added the discussion label 2026-02-16 17:38:42 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 25, 2025):

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

  • #4642: Permission system broken - discusses limitations with external_directory restrictions and sandboxing
  • #4667: Limiting access for tools in a safer way - proposes read/write path configurations for sandboxing
  • #4605: OpenTUI respecting TMPDIR issue - related to /tmp directory access problems

Feel free to ignore if this is specifically about the feature to configure /tmp access via config options.

@github-actions[bot] commented on GitHub (Nov 25, 2025): This issue might be a duplicate of existing issues. Please check: - #4642: Permission system broken - discusses limitations with external_directory restrictions and sandboxing - #4667: Limiting access for tools in a safer way - proposes read/write path configurations for sandboxing - #4605: OpenTUI respecting TMPDIR issue - related to /tmp directory access problems Feel free to ignore if this is specifically about the feature to configure /tmp access via config options.
Author
Owner

@jiyeol-lee-kds commented on GitHub (Nov 25, 2025):

slightly similar request like https://github.com/sst/opencode/issues/4667

@jiyeol-lee-kds commented on GitHub (Nov 25, 2025): slightly similar request like https://github.com/sst/opencode/issues/4667
Author
Owner

@rekram1-node commented on GitHub (Nov 25, 2025):

Yeah we need better more granular permissions setup

@rekram1-node commented on GitHub (Nov 25, 2025): Yeah we need better more granular permissions setup
Author
Owner

@camAtGitHub commented on GitHub (Nov 30, 2025):

The environment variable BUN_TMPDIR might be what you're looking for. See this comment for reference: https://github.com/sst/opencode/issues/4605#issuecomment-3592949933.

Setting BUN_TMPDIR to a directory on a partition mounted with the exec option helped resolve my "Failed to initialize OpenTUI render library: Failed to open library" error. Although you didn't specify your exact use case, it should function similarly to TMPDIR.

@camAtGitHub commented on GitHub (Nov 30, 2025): The environment variable `BUN_TMPDIR` might be what you're looking for. See this comment for reference: https://github.com/sst/opencode/issues/4605#issuecomment-3592949933. Setting `BUN_TMPDIR` to a directory on a partition mounted with the `exec` option helped resolve my "Failed to initialize OpenTUI render library: Failed to open library" error. Although you didn't specify your exact use case, it should function similarly to `TMPDIR`.
Author
Owner

@Mattwmaster58 commented on GitHub (Feb 7, 2026):

from my reading, it definitely seems like https://github.com/anomalyco/opencode/issues/5386 is the same as this, and that issue has been fixed

@Mattwmaster58 commented on GitHub (Feb 7, 2026): from my reading, it definitely seems like https://github.com/anomalyco/opencode/issues/5386 is the same as this, and that issue has been fixed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3116