Skip to content

Read a Function or Alias Shadowing timeout as No Bound in the Wait-Loop Check #2309

Closed as not planned

Description

@ptr727

Problem

The wait-loop check in host-setup/agent-safety/claude/gh-write-guard.py reads timeout and the command prefixes before a bash -c wrapper by name. A function or alias defined earlier in the same command can give either name another meaning, and the check still reads the run as bounded. Constructed example:

timeout() { command timeout -s 0 "$@"; }; timeout 900 bash -c 'until [ -f x ]; do sleep 60; done'

Bash calls the function, which sends signal 0, so the loop outlives the deadline. The same holds for a function shadowing a prefix such as nice, and for an alias set on an earlier line where the shell expands aliases. README requirement 7 does not declare this shape.

Done looks like

The check reads a run as no bound where the same command defines a function or alias named timeout or a prefix the run uses, with self-test rows, or README requirement 7 declares the shape not reached.

Found by a local strict review pass on #2117. It predates that pull request.

Activity

  1. 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions