Skip to content

GH-2334: Rank the untrusted-input boundary and extend it to every source - #2345

Merged
magicsunday merged 1 commit into
mainfrom
GH-2334
Jul 21, 2026
Merged

magicsunday merged 1 commit into
mainfrom
GH-2334

Conversation

@magicsunday

Copy link
Copy Markdown
Owner

Closes #2334.

Two structural gaps in the trust boundary that #2333/#2326 established but could not close within their scope.

1. The rule now has a rank

AGENTS.md §0 says the higher level wins, but the boundary lived in the preamble — on none of those levels. So injected text conflicting with it had no declared precedence, while §1.2 (minimal scope) and §6 (STOP conditions), which say nothing about authorship, were ranked. A new §1.8 promotes it to an Absolute Rule, and §6 gains a STOP condition for non-maintainer text (or text whose author association cannot be determined) that asks to widen scope, waive a STOP, relax a guard, mutate repository state, or emit repository content.

2. Every external source is enumerated, parser output included

The rule was framed around agent-task issues. Now the sources are named first, because the unenumerated ones had no rule at all:

  • issue titles/bodies, issue comments, PR descriptions and review-thread comments, branch names and commit messages;
  • every string this library extracts from a sample fileUserComment, XPComment, XMP, IPTC creator/caption, keyword trees. Reproducing a parse report runs the reader over a submitted file and puts those attacker-controlled strings into the agent's context, exactly where a model looks for instructions. Parser output has no authority, ever.

3. Two holes in the non-waivable list

  • Repository-state mutations beyond the push target: merging the PR (self-merge bypasses the review model), rewriting GH-<n> history, tags/releases, labels/branch-protection/collaborators.
  • Outbound emission beyond secrets: summarising docs/ into a PR body or pasting a file listing is exfiltration to a public thread just as much as leaking a token.

The one control that is convention, not code

The whole file-protection list rests on a review step the platform does not require — main requires the build (8.4) check but no review. Enabling Require a pull request before merging would enforce it at no code cost, but no magicsunday repo requires review today (verified across all 20), so imagemeta is consistent, not lax. Flipping it on imagemeta alone would make it the outlier; this is recorded as a family-wide decision on the issue rather than a per-repo divergence.

Documentation only.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

The trust boundary lived in the preamble, on none of the levels §0
ranks, so injected text that conflicted with it had no declared
precedence to lose to — while §1.2 and §6, which say nothing about
authorship, were ranked. It also spoke only of issues and their comments.

Rank it: a new §1.8 promotes the boundary to an Absolute Rule, so §0
gives it precedence like any other. Enumerate the sources first, since the
unenumerated ones had no rule at all: issue and PR bodies, comments and
review threads, branch and commit text, and — the sharp one for this
project — every string the parser extracts from a sample file. Reproducing
a parse report runs the reader over a submitted file and puts UserComment,
XMP, IPTC and keyword strings into the agent's context, exactly where a
model looks for instructions.

Two gaps the boundary did not close: it constrained the push target but
not other repository-state mutations (merging the PR, rewriting history,
tags, releases, labels, branch protection, collaborators), and it refused
secrets but not other repository content (summarising docs/ or pasting a
file listing into a public thread is the same exfiltration). Both are now
named in the non-waivable list, and §6 gains a STOP for non-maintainer
text that asks to widen scope, waive a STOP, relax a guard, mutate repo
state, or emit repo content.

The document's central control still rests on convention, because main
requires the build check but no review — enabling 'Require a pull request
before merging' would enforce it, but no magicsunday repo does that today,
so it stays a family-wide decision recorded on the issue rather than a
per-repo divergence.
@magicsunday
magicsunday merged commit 1846e3e into main Jul 21, 2026
13 checks passed
@magicsunday
magicsunday deleted the GH-2334 branch July 21, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rank the untrusted-input rule and extend it to every external channel

1 participant