Skip to content

Allow writes to /tmp by default without permission prompt #5386

Closed

Description

@remorses

Currently opencode prompts for permission when the model writes to /tmp. Models frequently use /tmp for temporary files during tasks, and requiring approval adds friction without meaningful security benefit since /tmp is ephemeral and outside the user's project.

Writes to /tmp (and $TMPDIR) should be allowed by default.

Related: #4743

Activity

  1. rekram1-node commented on Dec 11, 2025

    @rekram1-node
    Collaborator

    Yeah agree, lets allow it

  2. self-assigned this
    on Dec 11, 2025
  3. remorses commented on Dec 11, 2025

    @remorses
    ContributorAuthor

    I can open a PR if you want

  4. rekram1-node commented on Dec 11, 2025

    @rekram1-node
    Collaborator

    yeah ill merge it

    afk rn but when i get back ill look

  5. added a commit that references this issue on Dec 12, 2025
    ea53b55
  6. remorses commented on Jan 24, 2026

    @remorses
    ContributorAuthor

    Clsoing. Now you can pass in opencode.json

      "permission": {
        "edit": "allow",
        "bash": "allow",
        "external_directory": {
          "*": "ask",
          "/tmp": "allow",
          "/tmp/*": "allow",
          "/private/tmp": "allow",
          "/private/tmp/*": "allow",
          "env:$TMPDIR": "allow",
          "env:$TMPDIR/*": "allow"
        },
    
      },
    
  7. diegonix commented on Mar 8, 2026

    @diegonix

    Still an issue as of v1.2.21 (Mar 2026).
    My use case: a multi-agent writes a shared payload file to /tmp/ so that subagents can read it (avoids repeating large context inline). Subagents with "read": "allow" silently fail to read files under /tmp/ because external_directory defaults to "ask" — and subagents never surface the permission prompt.
    Workaround: explicitly setting "external_directory": { "/tmp/**": "allow" } per subagent in opencode.json. Works, but verbose.
    +1 for a first-class $TMPDIR / /tmp allow option — or at minimum, making external_directory: "ask" actually prompt for subagents instead of silently blocking.

  8. djtuBIG-MaliceX commented on Sep 3, 2026

    @djtuBIG-MaliceX

    Also it's $TEMP or %TEMP% in some platforms. should be env:$TEMP/**

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