maf-doctor: Instructions file for GitHub Copilot

.github/instructions/maf-constraints.instructions.md

maf-doctor maf-constraints.instructions.md is an instructions file for GitHub Copilot from joslat/maf-doctor. It costs 1,608 tokens per session, scanned A, original, MIT.

Version-aware rules for upgrading Microsoft Agent Framework, a toolkit for building AI agents. They define security requirements, migration steps, and checks that apply across supported releases.

In plain words
What is it for?
Use it to plan MAF version upgrades, preserve session state, choose production credentials, protect prompts and tool arguments, and verify migration work.
Why use it?
It prevents unsafe upgrades and common production mistakes, such as storing session data in the wrong place, using developer credentials in production, or exposing sensitive diagnostic data.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is joslat/maf-doctor's own configuration. It tells GitHub Copilot how to work on maf-doctor 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 maf-doctor configures →

Reuse

Borrowing it

Nothing to install: this file belongs to joslat/maf-doctor. 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/joslat/maf-doctor/main/.github/instructions/maf-constraints.instructions.md
Clone the repo
git clone --depth 1 https://github.com/joslat/maf-doctor

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 maf-doctor maf-constraints.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/joslat/maf-doctor/maf-constraints/github.svg)](https://agentmods.dev/instructions/joslat/maf-doctor/maf-constraints)
Your own site
<a href="https://agentmods.dev/instructions/joslat/maf-doctor/maf-constraints"><img src="https://agentmods.dev/badge/instructions/joslat/maf-doctor/maf-constraints/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 maf-doctor maf-constraints.instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/joslat/maf-doctor/maf-constraints"><img src="https://agentmods.dev/badge/instructions/joslat/maf-doctor/maf-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,608 This file is loaded in full into every session.
When invoked 1,608 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.01608 $0.01608
Opus 5 $0.00804 $0.00804
Sonnet 5 $0.00322 $0.00322
Haiku 4.5 $0.00161 $0.00161

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

Security

Grade A, and why

maf-doctor maf-constraints.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/maf-constraints.instructions.md · 116 lines

How it starts

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

MAF Migration Constraints

These rules apply across the tracked MAF release chain. Version-specific API recipes belong in the ordered per-version guides and registry; do not promote a single release's syntax into a timeless global rule.

Hard Constraints (Never Violate)

  • ALWAYS identify the exact source and target package versions and call MafMigrationPath(currentVer, targetVer) for a multi-version upgrade. Apply every returned step in ascending order.
  • NEVER store session-specific state in AIContextProvider or ChatHistoryProvider instance fields. Use the framework's session-state mechanism for the selected version, such as ProviderSessionState<T>, and persist the session when continuity must outlive a process or top-level call.
  • NEVER use DefaultAzureCredential in production code. Prefer an explicit production credential such as ManagedIdentityCredential; keep developer credential chains in development-only composition.
  • NEVER enable EnableSensitiveData = true outside a development-only, access-controlled diagnostic boundary. Provider errors, prompts, tool arguments, session state, and model output can contain secrets or personal data.
  • NEVER treat model-generated code or shell commands as sandboxed. LocalCodeAct, Python child processes, and Tools.Shell require a real container/VM boundary, minimal filesystem mounts, restricted credentials and egress, resource limits, and explicit tool/policy composition.
  • NEVER derive file-memory roots, shell paths, callback destinations, or tenant storage folders directly from untrusted input. Validate and authorize them against an application-owned boundary.
  • NEVER expose raw hosted-provider failure detail by default. Preserve server-side diagnostics in access-controlled telemetry; enable exception details only for trusted callers.
  • ALWAYS pin dotnet-inspect to exact v0.9.1 in this repository. Reject a missing, mismatched, truncated, or structurally invalid report. Use MafRunCs0618Hunt and the compiler as ground truth for overload resolution, transitive obsoletions, and project-local [Obsolete] attributes.
  • ALWAYS preserve the published maturity/version of each package. Stable, preview, RC, and alpha packages in one train are not interchangeable. Do not invent an aligned version for an externalized or independently shipped package.
  • ALWAYS restore, build, and run focused behavior tests after migration. An empty public API diff cannot detect persistence, streaming, checkpoint, redaction, tool-approval, or workflow-routing behavior changes.

Read the full file on GitHub · 116 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 First seen · 116 lines · 1,608 tokens per session scan A 12f5177d22a8

Subscribe to this mod's changes

maf-doctor maf-constraints.instructions.md is an instructions file published in the GitHub repository joslat/maf-doctor (14 stars, last pushed 23d ago), licensed MIT. It adds 1,608 tokens to every session, about $0.0080 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.