Skip to content

Judge heredocs, command substitution, loops, and redirections structurally #174

Closed

Description

@furedea-agent

Since ADR-0034 deployed, about 90 percent of the remaining hook escalations are syntax (313 of 354 since 2026-10-15 12:00 UTC): quoted heredocs fed to python3, command substitution, for loops, and redirections. Workers stopped on python3 - <<EOF and for f in $(ls). These are all contained by the sandbox. Planned: (1) parse quoted or static heredocs as standard input, and parse a heredoc fed to a shell as a script, refusing only dynamic shell heredocs; (2) allow command, process, and arithmetic substitution and loop or conditional clauses, judging every inner command on its own and treating substituted words as run-time words; (3) judge precise rules on command words only, so redirections into files no longer escalate, since the sandbox confines writes; (4) treat python, python3, and node as sandbox-contained programs that take any argument, and accept any arguments after uv run python. Deny prefixes, forbidden patterns, and the dangerous-Git guard keep applying to every inner command.

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