Skip to content

permissions: external read outside project never prompts in TUI prompt mode #55207

Closed as duplicate

Description

@sysstemlord

Summary

In v2.0.28 with default config and TUI session.permissions: prompt, agent reads of files outside the project (e.g. /etc/hosts, ~/.ssh/id_rsa) succeed silently — no external_directory prompt, no queue entries, no saved approvals. Includes sensitive paths: SSH private key readable with zero prompts.

Environment

  • opencode version: 2.0.28
  • OS: Linux 6.8.0-147-generic (linux x64)
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor (TUI)
  • Shell: /bin/bash
  • Install/channel: latest (release binary)
  • Active plugins: none found in config

Reproduction

  1. Empty project dir (tested both non-git and git inited) with empty global ~/.config/opencode/opencode.jsonc ($schema only) and no project config.
  2. TUI → Ctrl+P → Open settings → permissions = prompt (confirmed persisted as session.permissions: "prompt" in cli.json).
  3. In a session there, have the agent read /etc/hosts (also tried ~/.ssh/id_rsa, files under ~/.config).
  4. Observe: content returned, no prompt in TUI.
  5. Verify: GET /api/session/<id>/permission → {"data":[]}; GET /api/permission/saved → {"data":[]}; permission table 0 rows; no permission lines in opencode.log.

Expected Behavior

Per docs/permissions, a path outside the Location/worktree needs external_directory approval (default ask) before its read approval — TUI should prompt (once / always / reject).

Actual Behavior

Read succeeds silently. Consistently reproducible (~15 external reads, two sessions incl. fresh fork; sudo cat /etc/shadow and sudo ls /root also silent).

Additional Context

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the thorough report and the checks you ran.

    I think this is a duplicate of #54524. In v2.0.25, #53585 removed the built-in external_directory → ask rule on purpose. The default ruleset is now * → allow plus the *.env read prompts, so paths outside the project are read without a prompt. You can see this in your report: external reads are silent, .env reads still prompt, and nothing appears in the permission queue. The permissions docs were never updated and still list the old default, which is why this looks like a bug. #54524 is tracking the docs mismatch, the missing release note and requests to bring the old default back.

    Until that's settled, this config rule brings the prompts back. It covers reads, writes and other access outside the project:

    {
      "permissions": [
        { "action": "external_directory", "resource": "*", "effect": "ask" }
      ]
    }

    Possible duplicates and related issues, ordered by likelihood:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #54524, since there's been no reply in the past day explaining how it's different. The silent reads outside the project come from the default change in 2.0.25 (#53585), which removed the built-in external_directory → ask rule. Please follow #54524 for the docs fix and the discussion about bringing that default back.

    Until then, adding this rule to your config brings the prompts back:

    {
      "permissions": [
        { "action": "external_directory", "resource": "*", "effect": "ask" }
      ]
    }

    If you still don't get prompts with this rule, please reply here and we can reopen. Thanks again for the detailed report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions