Skip to content

intake-triage: give the model a read-only token; move label writes to a model-free job #804

Closed

Description

@kyle-sexton

Summary

In intake-triage.yml, the job that runs the model (both the key job and, after #803, the subscription job) holds issues: write. That job passes GH_TOKEN: ${{ github.token }} to the run-claude-cli step so the model can run read-only gh queries. The CLI's subprocess environment scrub leaves GitHub tokens in place, so the model's tool calls hold a token that can write to issues. Today only fixed read-only gh rules are allowed under dontAsk, so this is defense in depth.

Proposal

  • Give the model a read-only token: run the model in a job whose GITHUB_TOKEN has issues: read (and contents: read).
  • Move the label, comment and Issue Type writes into a downstream job with no model in it. It validates the model job's structured output, received as a job output or a checked artifact, and applies it.

Related

Activity

  1. added
    needs-triage
    on Oct 20, 2026
  2. kyle-sexton commented on Oct 20, 2026

    @kyle-sexton
    MemberAuthor

    Agent-ready brief (triaged 2026-10-20)

    • Decision: Split intake triage into read-only model jobs and one model-free apply job. The model gets no gh tools and its leg holds only the Claude credential; a single apply job with needs: [claude, subscription] validates a minimal job output and does every write. Land this first in the intake-triage trust work; fix(intake-triage): pass the model only comments from write-access authors #782 follows it.

    • Current state (origin/main 834f4e1):

    • Scope:

      • Model jobs (claude, subscription): permissions at most contents: read and issues: read; job-level cache-mode: none; the run-claude-cli step env holds only the Claude credential (no GH_TOKEN); no Bash(gh ...) rule in the allowed tools.
      • Because the model loses gh, a script step (no model) fetches what the model reads today and hands it over inside the checkout (the model's reads are confined to the checkout). Pass the title, body and comments as today; fix(intake-triage): pass the model only comments from write-access authors #782 adds the author filter to the comments. Duplicate search also moves to the script step (for example a bounded list of open issue numbers and titles); the implementer picks the bound and states it in the PR.
      • Each model job exposes a minimal job output: the validated structured fields the apply step needs (labels, type, proposed class, comment text, escalation flag, result subtype, error flag, denial count). Nothing else crosses jobs.
      • One new apply job, no run-claude-cli step, needs: [claude, subscription], issues: write. It takes the subscription leg's output when that leg ran, otherwise the key leg's, and re-validates every value itself:
        • labels kept only when they are in the caller's allowlist and exist in the repository;
        • Issue Type and proposed class checked against the enums it recomputes;
        • the issue number taken from the event payload (issues event) or the issue-number workflow input, never from model output, as in Anthropic's edit-issue-labels.sh;
        • all model output dropped on an escalated run (existing rules kept).
      • Delete the duplicated apply block; one copy remains.
      • Update the SECURITY MODEL header and the canonical caller block. The caller's grant stays contents: read, issues: write; the reusable workflow narrows it per job.
    • Out of scope: the comment author filter (fix(intake-triage): pass the model only comments from write-access authors #782); the fallback-reason token (report-lane-outcome: record a key-to-subscription fallback as a lane-record token #806); changes to the author gate or the skipped job.

    • Acceptance criteria:

      • Neither claude nor subscription grants issues: write; each has at most contents: read and issues: read.
      • Both model jobs set cache-mode: none.
      • The run-claude-cli step in both model jobs receives no GH_TOKEN or other GitHub token; the only secret in its env is the Claude credential.
      • The allowed-tools list in both jobs contains no Bash(gh rule, and the prompt no longer tells the model to run gh.
      • Exactly one job applies labels, comment, Issue Type and floor; it contains no run-claude-cli step, has needs: [claude, subscription] and holds issues: write.
      • A test feeds the apply logic a label outside the allowlist, a label that does not exist in the repository, an unknown type and an issue number in the model output; none is applied, and the issue number used is the event's.
      • A credit-stop run applies the triage exactly once, from the subscription leg (test).
      • Existing apply tests (node --test .github/scripts/*.test.cjs) pass, and the two model jobs stay step-equal under .github/scripts/intake-triage-legs.test.cjs.
      • A live run in claude-code-plugins after the repin shows labels, Issue Type and floor applied, linked in the PR.
    • Sequencing / dependencies: after #744 merges; before #782, which filters the comments this change starts pre-fetching. #806 touches the subscription job's report step; no conflict, but rebase whichever lands second. Related done work: #799, #803.

    • Evidence:

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

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions