Skip to content

The Guard's eval Reading Ends Its Payload at a Quoted Newline #2363

Closed as not planned

Description

@ptr727

Problem

The guard's eval reading (#2080) ends an eval's payload at a newline token without consulting the quote mask. An argument that is a quoted newline alone is one of the arguments, and bash joins it into the payload, so the loop in a later argument is never read.

Reproduce (constructed)

Allowed by the guard, and loops under timeout 3 bash -c until the timeout kills it. The second argument is a single-quoted newline:

eval true '
' 'until false; do sleep 1; done'

Done looks like

Where the quote mask is known, an eval's payload ends only at an unquoted newline. The command above is denied, and a self-test row pins it.

Found by the third local strict review of the #2080 branch and split out per decision #2208. Develop allows this command too, since it reads no eval argument at all.

Activity

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

    @ptr727
    OwnerAuthor

    The same gap has a second form where the quote mask is unknown, which this issue's known-mask scope does not cover. A word such as x"a b" earlier in the payload leaves the mask unknown. A quoted ";<newline>" or "&&<newline>" then reads as the operator token that ends the eval's line, so the payload stops at until false. A bare quoted newline does the same. Constructed, allowed by the feature/auto-2080 branch at 549b8e3, and looping under timeout 3 bash -c until the timeout kills it:

    bash -c 'echo x"a b"; eval until false ";
    " do sleep 1 ";" done'

    Develop allows this too, since it reads no eval argument at all. Where the quoting is unknown, nothing tells a quoted operator token from a real one, so a fix here probably needs that distinction before it can be anything other than a guess. Found by the local strict review of the #2080 branch.

  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

    agentsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions