← Back to all fieldnotes

When an AI-Written PR Title Becomes Executable Code

Last updated:

LLM10:2026 — Improper Output Handling

In a hypothetical workflow, Hermes opens a pull request. A GitHub Actions workflow inserts its generated PR title directly into an inline shell script using a GitHub expression. A crafted title can alter the script and execute commands on the runner.

Opening a PR alone does not cause this vulnerability. The failure is the workflow’s unsafe handling of PR metadata. This is a conventional script-injection weakness; AI generation does not make that metadata trustworthy.

Keep data separate from code

Do not interpolate PR titles or bodies directly into inline shell script source. Pass values through an intermediate environment variable and use quoted variable expansion as data. Do not subsequently evaluate that data with eval or equivalent execution mechanisms. Quoting a GitHub expression directly inside script source is not sufficient: expression substitution happens before shell parsing.

Use minimal workflow token permissions, avoid unnecessary secrets, and isolate runners. The impact depends on the workflow’s actual credentials and environment; not every PR workflow has access to production secrets.

Human merge approval does not prevent an affected workflow from executing before merge.

Scope

This is a hypothetical educational example, not an assessment of a specific organization’s workflows. In the OWASP 2026 list, this risk is LLM10: Improper Output Handling. LLM04 is Supply Chain.

Sources