copilot-security-instructions
Copilot instructions42 starsChanged 10 months agoApache-2.0View on GitHub
These instructions apply when you create or edit any of the following files:
In this repository10 other files it gives its agents.
- copilot-instructions.mdCopilot instructions
- markdown-customizationsSkill
- access-control-reviewSkill
- dependency-cve-triageSkill
- genai-acceptance-reviewSkill
- input-validation-hardeningSkill
- secrets-and-logging-hygieneSkill
- secure-code-reviewSkill
- secure-fix-validationSkill
- threat-modelSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use ATX headings (#, ##, ###) and keep a clean hierarchy (one # at top).
- Distinctive: line 13
Prefer short paragraphs and bullet lists.
- Very specific: line 14
Use fenced code blocks for any code or config.
- Distinctive: line 15
Never place YAML frontmatter anywhere except the very top of the file.
- Very specific: line 16
Always separate YAML frontmatter from body with a blank line after the closing ---.
- Distinctive: line 17
Keep instructions unambiguous, testable, and scoped:
- Distinctive: line 18
Use “MUST / SHOULD / MAY” for requirements.
- Distinctive: line 19
Add acceptance criteria when helpful.
- Distinctive: line 20
Avoid contradictions across files.
- Very specific: line 24
Use --- on the first line and --- to close the frontmatter block.
- Very specific: line 25
Prefer quoted strings when values contain special characters (:, *, {}, #, @, etc.).
- Very specific: line 26
Use lower-kebab-case for identifiers (e.g., name: markdown-authoring).
- Distinctive: line 43
Keep the agent prompt focused on a single domain (e.g., “authoring Copilot customization files”).
- Distinctive: line 51
Start with the goal in one sentence.
- Very specific: line 52
Use ${input:<name>:<prompt>} placeholders for required parameters.
- Very specific: line 54
Ensure the prompt can be invoked as /<filename-without-.prompt.md>.
- Very specific: line 78
When proposing changes, output the full file contents in a single fenced md code block.
- Distinctive: line 79
If editing an existing file, describe the minimal set of changes before showing the updated file.
- Distinctive: line 80
Never invent tool names, file paths, or capabilities—use what exists in the repo.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot authoring guidelines for customization Markdown files
These instructions apply when you create or edit any of the following files:
agents/*.agent.mdprompts/*.prompt.mdinstructions/*.instructions.mdskills/**/SKILL.md
General Markdown rules
- Use ATX headings (
#,##,###) and keep a clean hierarchy (one#at top). - Prefer short paragraphs and bullet lists; avoid overly long blocks of text.
- Use fenced code blocks for any code or config. Label the fence language (
yaml,bash,json,md, etc.). - Never place YAML frontmatter anywhere except the very top of the file.
- Always separate YAML frontmatter from body with a blank line after the closing
---. - Keep instructions unambiguous, testable, and scoped:
- Use “MUST / SHOULD / MAY” for requirements.
- Add acceptance criteria when helpful.
- Avoid contradictions across files. If two instruction files could both apply, ensure they agree.
YAML frontmatter conventions
- Use
---on the first line and---to close the frontmatter block. - Prefer quoted strings when values contain special characters (
:,*,{},#,@, etc.). - Use lower-kebab-case for identifiers (e.g.,
name: markdown-authoring).
Authoring standards per file type
A) Custom agent profiles: agents/*.agent.md
- Frontmatter MUST include:
description(required)name(recommended; otherwise filename is used)
- Frontmatter MAY include:
tools(list of tool names/aliases)model(IDE-supported)target(vscodeorgithub-copilot), if you want environment-specific availability
- Body MUST:
- Define the agent’s role, boundaries, and output format expectations.
- State what the agent should do when missing info (ask concise questions or propose safe defaults).
- Include formatting rules for produced Markdown (headings, lists, code fences, links).
- Keep the agent prompt focused on a single domain (e.g., “authoring Copilot customization files”).
B) Prompt files: prompts/*.prompt.md
- Frontmatter SHOULD include:
description(short, action-oriented)agent(when you want agent mode behavior)
- Body MUST:
- Start with the goal in one sentence.
- Use
${input:<name>:<prompt>}placeholders for required parameters. - Specify a deterministic output structure (headings + bullet lists).
- Ensure the prompt can be invoked as
/<filename-without-.prompt.md>.
C) Path-specific instructions: instructions/*.instructions.md
- Frontmatter MUST include:
applyTo: "<glob pattern(s)>"
- Frontmatter MAY include:
excludeAgent: "code-review"or"coding-agent"if only one should read it
- Body MUST:
- Describe exactly what to do for files matching
applyTo. - Contain rules that are compatible with repo-wide instructions.
- Describe exactly what to do for files matching
D) Skills: skills/<skill-dir>/SKILL.md
- File MUST be named
SKILL.md. - Frontmatter MUST include:
name(lowercase, hyphenated)description(when to use this skill)
- Body MUST:
- Provide step-by-step guidance, examples, and “do/don’t” lists.
- Include any scripts/resources in the same directory by relative path.
Output requirements when generating/editing these files
- When proposing changes, output the full file contents in a single fenced
mdcode block. - If editing an existing file, describe the minimal set of changes before showing the updated file.
- Never invent tool names, file paths, or capabilities—use what exists in the repo.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

