Skip to content

Preview issue triage prompt changes#20352

Open
ewdurbin wants to merge 14 commits into
mainfrom
codex/issue-triage-preview
Open

Preview issue triage prompt changes#20352
ewdurbin wants to merge 14 commits into
mainfrom
codex/issue-triage-preview

Conversation

@ewdurbin

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #20340.

Add a pull-request workflow that previews changes to agents/prompts/triage-issue.md against the five most recently created issues. Each issue is triaged independently with read-only repository access, then the results are consolidated into a single marked PR comment that is updated on subsequent runs.

The preview is restricted to same-repository PRs, leaves the Codex action's write-access actor restriction in place, and grants write permission only to the final PR-comment job. It does not modify issues or invoke release workflows.

Validation

  • npx prettier@3.9.0 --check .github/workflows/issue-triage-preview.yml
  • Verified the GitHub search query returns the five newest issues.
  • Exercised summary rendering for related issue/PR and empty-result cases, including newline and mention handling.
  • git diff --cached --check

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Issue triage preview

The issue triage preview is available in the workflow run summary.

@astral-sh-bot

astral-sh-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR no longer changes the tests when compared with the main base revision.

Comment on lines +58 to +61
uses: ./.github/workflows/issue-triage.yml # zizmor: ignore[secrets-inherit] Required for environment secrets in reusable workflows.
with:
issue: ${{ matrix.issue }}
secrets: inherit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not run PR-controlled workflows with environment secrets

This local reusable workflow is resolved from the pull request revision, and its triage job enters the unprotected automations environment and receives OPENAI_API_KEY. Consequently, anyone able to push a same-repository branch can modify the called workflow or its Codex configuration and expose or misuse that credential before review. The same-repository check only excludes forks; it does not establish that the executed revision is trusted. Keep this preview secretless, or move the credentialed stage to protected default-branch workflow code behind an exact-SHA-bound approval and environment protection.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is legitimate?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same repo branch == a maintainer's branch, so, likely not?

Comment on lines +52 to +55
uses: ./.github/workflows/issue-triage.yml # zizmor: ignore[secrets-inherit] Required for environment secrets in reusable workflows.
with:
issue: ${{ matrix.issue }}
secrets: inherit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Prevent PR-controlled workflows from receiving automation secrets

This pull_request workflow invokes a repository-local reusable workflow from the pull request revision and passes secrets: inherit; that called workflow enters the automations environment and consumes OPENAI_API_KEY. A same-repository branch writer can therefore change any listed prompt/schema to trigger the run while also changing .github/workflows/issue-triage.yml, causing unreviewed code to receive or exfiltrate the environment credential before merge. The head-repository check blocks forks but does not establish that the branch author is entitled to environment secrets. Keep the PR stage secretless, or move API-backed processing behind an explicitly authorized stage that runs trusted default-branch code and treats PR content only as data.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add some notes to the threat-model about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automations Related to internal automations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants