Skip to content

The Guard Has No Bound on Its Own Running Time, So a Large Command Outlasts the Hook Timeout #2451

Closed as not planned

Description

@ptr727

Problem

The guard's wait-loop rule has no bound on its own running time. A PreToolUse hook that runs past its timeout (60s by default in Claude Code) does not block the command, so any command large enough to make the scan exceed the timeout runs unjudged, an unbounded loop in it included.

Develop reaches this without any eval. Its cost on nested loops around many bash -c payloads grows with loops times payloads:

  • K nested while [ $i -lt 3 ]; do ...; done loops around P copies of bash -c 'grep -e x w w ...', followed by ; while true; do sleep 1; done.
  • K=100, P=1000 (103 KB): 5.7s. K=200, P=2000 (206 KB): 22.9s.
  • At that rate develop crosses 60s at about 330 KB.

Done looks like

The guard bounds its own work, for example by denying a command past a size or step limit with a message saying why, so a timeout can never be the outcome. A self-test row pins the limit.

Found while weighing timing findings on the #2080 branch, whose own slowdowns (filed beside this issue) only move the size at which this happens.

Activity

  1. added
    bug
    agents
    on Oct 6, 2026
  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The hook timeout is reached only at about 330 KB of command text, which agent commands do not reach.

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

    agentsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions