Skip to content

Read Only Real GH_REPO Setters as Unread in the Write Guard #3286

Closed

Description

@ptr727

Context

Raised by Copilot on #3283, against _gh_repo_unread_export in host-setup/agent-safety/claude/gh-write-guard.py. It was raised after that pull request's second fix round, so it is filed here under the drive's stop rule.

A False Deny

_gh_repo_unread_export fails closed when a _GH_REPO_SETTERS word names GH_REPO among its operands. It does not check whether the builtin and its options actually set the variable. So a command that only reads it, or names it as text, makes a later gh write that takes GH_REPO fail closed. These are constructed examples, origin example/repo:

  • declare -p GH_REPO; gh pr comment 5 -b x prints the variable.
  • printf GH_REPO; gh pr comment 5 -b x uses it as a format string, with no -v.
  • builtin echo GH_REPO; gh pr comment 5 -b x echoes it.

Each is denied as a write taking its repository from a GH_REPO a builtin may set, where each should be allowed. The denial is deny-ward, so it opens no cross-owner write.

Possible Direction

Require -v for printf, read the builtin builtin delegates to, and leave a query-only declare -p or typeset -p alone. Keep failing closed on any form the reader cannot place, and check the change with a develop-versus-branch differential that shows no allow-flip on a cross-owner write.

🤖 Generated with Claude Code

Activity

  1. added
    introduced
    script
    on Oct 20, 2026
  2. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    introducedscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions