maui: Instructions file for GitHub Copilot

.github/instructions/ci-copilot-pipeline-security.instructions.md

maui ci-copilot-pipeline-security.instructions.md is an instructions file for GitHub Copilot from dotnet/maui. It costs 2,026 tokens per session, scanned A, original, MIT.

Security rules for a continuous-integration pipeline that reviews pull requests with Copilot. The pipeline runs code supplied by contributors while several powerful repository tokens may be available.

In plain words
What is it for?
Use it before editing the Copilot pull-request review pipeline, its checkout settings, token handling, trusted scripts, or build tasks.
Why use it?
It limits which credentials untrusted code can access and reduces the risk of a pull request stealing tokens or changing the repository through the build system.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is dotnet/maui's own configuration. It tells GitHub Copilot how to work on maui itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything maui configures →

About the project

.NET MAUI is a C# and XAML framework for building native mobile and desktop applications from one shared codebase. Developers use it to create apps for Android, iOS, iPadOS, macOS, and Windows. The catalogue entries provide skills, instructions, and agents for working with .NET MAUI.

dotnet/maui · 23,322 stars · on GitHub · dot.net

Reuse

Borrowing it

Nothing to install: this file belongs to dotnet/maui. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dotnet/maui/main/.github/instructions/ci-copilot-pipeline-security.instructions.md
Clone the repo
git clone --depth 1 https://github.com/dotnet/maui

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for maui ci-copilot-pipeline-security.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dotnet/maui/ci-copilot-pipeline-security/github.svg)](https://agentmods.dev/instructions/dotnet/maui/ci-copilot-pipeline-security)
Your own site
<a href="https://agentmods.dev/instructions/dotnet/maui/ci-copilot-pipeline-security"><img src="https://agentmods.dev/badge/instructions/dotnet/maui/ci-copilot-pipeline-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for maui ci-copilot-pipeline-security.instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dotnet/maui/ci-copilot-pipeline-security"><img src="https://agentmods.dev/badge/instructions/dotnet/maui/ci-copilot-pipeline-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,026 This file is loaded in full into every session.
When invoked 2,026 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02026 $0.02026
Opus 5.5 $0.00810 $0.00810
Sonnet 5.5 $0.00405 $0.00405
Haiku 4.5 $0.00203 $0.00203

Measured 10d ago against content hash 1e7dff97e0b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

maui ci-copilot-pipeline-security.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/ci-copilot-pipeline-security.instructions.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CI Copilot pipeline — security rules

This pipeline runs untrusted PR code on AzDO agents with these tokens in scope:

  • GH_COMMENT_TOKEN / GH_TOKEN — maui-bot PAT (post comments, labels, reviews on any PR)
  • COPILOT_GITHUB_TOKEN — Copilot CLI install token
  • AzDO GitHub service-connection PAT — repo contents, PRs, checks, workflows

Once the PR is merged into the worktree, the author controls every .csproj, Directory.Build.targets, source generator, analyzer, test, .ps1, and .yml the pipeline subsequently runs.

The hosted /review gate path runs only Setup, Gate, fresh-agent publication, and lock cleanup. Gate uses the immutable local snapshot with no GitHub/Copilot token in its task environment. The existing hosted /review retains the full review phases; the pipeline's GateOnly parameter defaults to false and selects the separate gate stages at compile time only when explicitly requested.

Rules

  1. Per-task env: scoping. Only put tokens in tasks that need them. The Copilot-agent task gets COPILOT_GITHUB_TOKEN only — never GH_TOKEN. Posting tasks run in separate Microsoft-hosted jobs and receive GH_COMMENT_TOKEN plus only the explicitly scoped publication token they need. Pass --secret-env-vars=GH_TOKEN,GITHUB_TOKEN,COPILOT_GITHUB_TOKEN to the Copilot CLI.

  2. persistCredentials: false on every checkout: self. Default checkout writes the service-connection PAT into .git/config as extraheader, readable by any subprocess. Do not extract or repurpose that checkout credential for API publication; use an explicitly scoped task secret instead.

  3. Trusted-copy scripts before merging the PR. Setup copies .github/scripts, .github/skills, and eng/scripts to $(Build.ArtifactStagingDirectory)/trusted-github/ before switching branches or merging the PR. Gate and CopilotReview invoke scripts through $ScriptsDir, $SkillsDir, and $EngScriptsDir, never from the merged worktree. New scripts used by those phases must be added to the Setup copy block.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago Changed · +6 lines · +125 tokens per session 1e7dff97e0b7
  2. 20d ago Changed · +2 lines · +118 tokens per session 5402bfa04058
  3. 1mo ago Changed · +10 lines · +390 tokens per session 7adccee0d7ce
  4. 1mo ago First seen · 53 lines · 1,393 tokens per session scan A 56bdaa3bc791

Subscribe to this mod's changes

maui ci-copilot-pipeline-security.instructions.md is an instructions file published in the GitHub repository dotnet/maui (23,322 stars, last pushed today), licensed MIT. It adds 2,026 tokens to every session, about $0.0081 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.