ci: add Copilot review instructions for GHA credential safety#58
Merged
Conversation
Make security review of GitHub Actions a standing, per-PR control rather
than something we remember to ask for. Copilot code review reads
.github/copilot-instructions.md repo-wide; this directs it to scrutinize
workflow changes for the token-exfiltration classes we care about:
pull_request_target with PR code/secrets, untrusted ${{ }} interpolated
into run:, credentials sharing a job with untrusted content, over-broad
permissions, unpinned actions, lifecycle scripts under a live credential,
and long-lived tokens where OIDC would do. Plus a short general
secrets-in-code note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thecodedrift
marked this pull request as ready for review
July 10, 2026 19:31
Contributor
There was a problem hiding this comment.
Pull request overview
Adds repo-wide GitHub Copilot code review instructions focused on GitHub Actions credential safety, to make workflow-security scrutiny a standing per-PR control.
Changes:
- Introduces
.github/copilot-instructions.mdwith specific checks for common GitHub Actions token/secret exfiltration risks. - Adds general guidance for spotting secrets exposure in code/logging.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot review on #58: GitHub's default GITHUB_TOKEN scope varies by repo/org settings and is often read-only, so encoding "defaults are broad" as repo-wide review guidance bakes in a potentially wrong assumption. Reframe to the accurate, intent-preserving guidance: prefer an explicit least-privilege permissions block over relying on the implicit default (which may grant more than the job needs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes security review of GitHub Actions a standing, per-PR control instead of something we remember to request. GitHub Copilot code review reads
.github/copilot-instructions.mdrepo-wide, so this directs it to scrutinize workflow changes for the token-exfiltration classes we care about:pull_request_target(orworkflow_run) that checks out/builds PR code or exposes secrets to it${{ }}(PR title/body, commit message, branch name, issue/comment bodies) interpolated intorun:— command injectionpermissions:(missing top-level block; unjustifiedcontents: write/id-token: write/packages: write/actions: write)--ignore-scripts+ explicit build)Plus a short general secrets-in-code note (hardcoded secrets, logging tokens, never read
.env/.dev.vars/.secrets).Companion to the release-workflow PR (#57): that PR is the first thing these instructions would guard, and per our discussion this is the "target security / key extraction on any GHA exposing tokens" control we said we should have anyway.
Draft for review of the wording/scope — no code impact.