Skip to content

The Guard's read Bound Ignores a Group's Input Redirection #2364

Closed as not planned

Description

@ptr727

Problem

The wait-loop rule credits a read loop with a bound only when the input redirection sits on that loop's own invocation, per requirement 7. A redirection on a group that holds the loop feeds the loop just the same, and bash ends the loop at end of file, but the guard denies it.

Reproduce (constructed)

Denied on develop, and ends at once under timeout 3 bash -c with a one-line file f (exit 0):

{ while read -r l; do sleep 1; done; } < f

The #2080 branch, which reads an eval's arguments as a payload, reads a redirection on the eval as one on a group around the payload, as decision #2139 chose. So the branch also denies eval 'while read -r l; do sleep 1; done' < f, which develop allows only because it never reads an eval.

Done looks like

Where a group's input redirection reaches a read loop inside it, the loop is credited with the same bound as one carrying that redirection itself, both commands above are allowed, and self-test rows pin them.

Found by the local strict review of the #2080 branch.

Activity

  1. added
    bug
    agents
    pre-existing
    on Oct 4, 2026
  2. ptr727 commented on Oct 6, 2026

    @ptr727
    OwnerAuthor

    The eval reading (#2080) meets this too. A redirection on an eval applies to the whole payload, so the guard reads the payload as a group with the redirection after it. A read loop given its input that way is denied:

    eval 'while read -r l; do sleep 1; done' < f

    The plain while read -r l; do sleep 1; done < f is allowed. This is a false deny, in the safe direction, and fixing this issue's group case fixes it too.

  3. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The guard backstops an agent's own mistakes, and this is a command shape built to defeat it rather than one an agent session writes, so a miss does not realistically occur. See #2517 for the per-issue reason.

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

    agentsbugpre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions