maui 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 1,393 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

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,317 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dotnet/maui/ci-copilot-pipeline-security
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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,393 This file is loaded in full into every session.
When invoked 1,393 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01393 $0.01393
Opus 5 $0.00696 $0.00696
Sonnet 5 $0.00279 $0.00279
Haiku 4.5 $0.00139 $0.00139

Measured 5d ago against content hash 56bdaa3bc791, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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 · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 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_TOKENmaui-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.

Rules

  1. Per-task env: scoping. Only put tokens a task needs. The Copilot-agent task gets COPILOT_GITHUB_TOKEN only — never GH_TOKEN. Pass --secret-env-vars=GH_TOKEN,GITHUB_TOKEN,COPILOT_GITHUB_TOKEN to the Copilot CLI.

  2. persistCredentials: false on every checkout: self unless the task pushes. Default checkout writes the service-connection PAT into .git/config as extraheader, readable by any subprocess.

  3. Trusted-copy scripts before merging the PR. Setup task (still on main) copies .github/scripts, .github/skills, eng/scripts to $(Build.ArtifactStagingDirectory)/trusted-github/, then chmod -R a-w. Later tasks invoke scripts from $TRUSTED/..., never from the merged worktree. In PowerShell use $ScriptsDir / $SkillsDir / $EngScriptsDir (canonical impl in Review-PR.ps1). New post-merge scripts must be added to the Setup copy block.

  4. Strip tokens before invoking PR-controlled code. Wrap every dotnet build|test|run|pack, msbuild, dotnet cake, BuildAndRun*.ps1, Run-DeviceTests.ps1, Invoke-UITestWithRetry.ps1 in Invoke-WithoutGhTokens { ... } (defined in Review-PR.ps1 and verify-tests-fail.ps1 — saves/clears/restores GH_TOKEN, GITHUB_TOKEN, COPILOT_GITHUB_TOKEN). Wrap as close to the subprocess as possible, not at the outer trusted-script boundary — a trusted script may itself need gh for metadata (e.g., verify-tests-fail.ps1 calls Detect-TestsInDiff.ps1 which uses gh api), so wrapping the whole script breaks its detection path. Wrap only the line that launches the PR-controlled process. Exception: scripts that ONLY call gh for PR metadata (Detect-TestsInDiff.ps1, Find-RegressionRisks.ps1, detect-ui-test-categories.ps1) don't need wrapping at all — they keep the token.

Read the full file on GitHub · 53 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. 5d 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,317 stars, last pushed 5d ago), licensed MIT. It adds 1,393 tokens to every session, about $0.0070 per session on Opus 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.

Related

Other instructions, from other repositories