Skip to content

ci: add Copilot review instructions for GHA credential safety#58

Merged
thecodedrift merged 2 commits into
mainfrom
jakob/copilot-security-instructions
Jul 10, 2026
Merged

ci: add Copilot review instructions for GHA credential safety#58
thecodedrift merged 2 commits into
mainfrom
jakob/copilot-security-instructions

Conversation

@thecodedrift

Copy link
Copy Markdown
Member

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.md repo-wide, so this directs it to scrutinize workflow changes for the token-exfiltration classes we care about:

  • pull_request_target (or workflow_run) that checks out/builds PR code or exposes secrets to it
  • untrusted ${{ }} (PR title/body, commit message, branch name, issue/comment bodies) interpolated into run: — command injection
  • a credential sharing a job with untrusted/contributor content (prefer split jobs)
  • over-broad permissions: (missing top-level block; unjustified contents: write / id-token: write / packages: write / actions: write)
  • third-party actions unpinned from a commit SHA in credentialed workflows
  • dependency lifecycle scripts running under a live publish token/OIDC (prefer --ignore-scripts + explicit build)
  • long-lived stored tokens where OIDC trusted publishing would do

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.

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 thecodedrift added the skip-changeset PR intentionally ships no release note (bypasses the changeset requirement) label Jul 10, 2026
@thecodedrift
thecodedrift marked this pull request as ready for review July 10, 2026 19:31
Copilot AI review requested due to automatic review settings July 10, 2026 19:31

Copilot AI left a comment

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.

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.md with 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.

Comment thread .github/copilot-instructions.md Outdated
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>
@thecodedrift
thecodedrift merged commit 6c7c0ce into main Jul 10, 2026
4 checks passed
@thecodedrift
thecodedrift deleted the jakob/copilot-security-instructions branch July 10, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changeset PR intentionally ships no release note (bypasses the changeset requirement)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants