Tip: never assign GitHub Copilot to an issue until you've edited the comment and minimized copilot-setup-steps.yml
- Reveal hidden markdown: open Edit (or Copy Markdown) on every issue comment before assigning Copilot. HTML comments and Copilot XML wrappers are invisible in the rendered view.
- Minimize
copilot-setup-steps.yml: dropcontents: writeandid-token: writeunless you truly need them; every permission there becomes a retrievable Actions token inside the agent runtime. - Keep workflow-run approval on (default) so a planted workflow on a
copilot/branch cannot self-escalate. - Agent secrets: prefer short-lived, repo-scoped secrets; avoid org-wide high-value keys; rotate after suspicious Copilot runs.
- OIDC: pin cloud trust-policy
subto a specific branch/environment, notrepo:ORG/*. - Prefer private/internal repos for Copilot coding agent; require an extra human reviewer on Copilot-authored PRs.
Sources: BeyondTrust Copilot agent-takeover post (mitigations section)