copilot-setting: Instructions file for GitHub Copilot

.github/instructions/security.instructions.md

copilot-setting security.instructions.md is an instructions file for GitHub Copilot from zexion7873/copilot-setting. It costs 1,095 tokens per session, scanned B, original, MIT.

Security rules for Java and JSP web applications using Spring Security 3.2 and Hibernate 4.2, based on common OWASP web risks.

In plain words
What is it for?
Use them when writing or auditing authentication, permissions, forms, sessions, cookies, password handling, URLs, file paths, or external requests.
Why use it?
They help prevent problems such as broken access checks, CSRF, weak password storage, exposed secrets, unsafe URLs, and command injection.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

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

Reuse

Borrowing it

Nothing to install: this file belongs to zexion7873/copilot-setting. 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/zexion7873/copilot-setting/main/.github/instructions/security.instructions.md
Clone the repo
git clone --depth 1 https://github.com/zexion7873/copilot-setting

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 copilot-setting security.instructions.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/zexion7873/copilot-setting/security"><img src="https://agentmods.dev/badge/instructions/zexion7873/copilot-setting/security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,095 This file is loaded in full into every session.
When invoked 1,095 The same file — it is already loaded in full.
Security scan B 1 finding. 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.01095 $0.01095
Opus 5.5 $0.00438 $0.00438
Sonnet 5.5 $0.00219 $0.00219
Haiku 4.5 $0.00110 $0.00110

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

Security

Grade B, and why

copilot-setting security.instructions.md scanned grade B with 1 finding 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 1mo 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.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

- Block private IP ranges, loopback, and link-local (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `127.0.0.0/8`, `169.254.0.0/16` — link-local, covers the `169.254.169.254` cloud-metadata endpoint; IPv6 `::1` and `fc

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.github/instructions/security.instructions.md · 67 lines

How it starts

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

Security Rules

Secure by default. State what risk is mitigated when writing security code. SQL injection: instructions/sql.instructions.md. XSS: instructions/jsp.instructions.md.

A01 Broken Access Control

  • Deny by default; explicitly check rights per resource
  • Authentication ≠ authorization: a logged-in user still needs an explicit role/permission check per endpoint — "logged in" never means "allowed"
  • Allow-list for user-supplied URLs/paths; prevent path traversal
  • CSRF: all state-changing POST forms must carry a CSRF token; Spring Security 3.2: configure <csrf> in security namespace; without Spring Security: manual double-submit cookie or synchronizer token
  • State-changing operations via POST/PUT/DELETE only — never GET; restrict handlers with @RequestMapping(method = ...) (a mapping without method matches every verb and bypasses POST-form CSRF tokens)

A02 Cryptographic Failures

  • Passwords: bcrypt (BCryptPasswordEncoder, built-in to Spring Security crypto since 3.1, present in 3.2) or Argon2 (needs argon2-jvm — no native SS 3.2 encoder); never MD5/SHA-1. Data at rest: AES-256; transit: HTTPS
  • No hardcoded secrets — env vars or secret store

A03 Injection

  • SQL: PreparedStatement with ? only
  • OS command: ProcessBuilder with an argument list — never Runtime.exec(String) or sh -c with user input; no shell-string concatenation
  • XSS: <c:out> in JSP; context-aware encoding
  • XXE: disable DTDs and external entities on every XML parser, using each API's own switch (they differ — setFeature/disallow-doctype-decl exists only on the first pair); critical in this XML-heavy stack:
    • DocumentBuilderFactory / SAXParserFactory: setFeature("http://apache.org/xml/features/disallow-doctype-decl", true) plus FEATURE_SECURE_PROCESSING
    • XMLInputFactory (StAX): setProperty(XMLInputFactory.SUPPORT_DTD, false) and setProperty("javax.xml.stream.isSupportingExternalEntities", false) — it has no setFeature
    • JAXB Unmarshaller: no DTD switch of its own — unmarshal via a SAXSource wrapping a hardened XMLReader configured as above

Read the full file on GitHub · 67 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. 1mo ago Changed · +14 tokens per session 392e828ab56c
  2. 1mo ago Changed · -11 lines · -177 tokens per session 5414e272f9bf
  3. 2mo ago First seen · 78 lines · 1,258 tokens per session scan B c400b2e4d278

Subscribe to this mod's changes

copilot-setting security.instructions.md is an instructions file published in the GitHub repository zexion7873/copilot-setting (1 stars, last pushed 1mo ago), licensed MIT. It adds 1,095 tokens to every session, about $0.0044 per session on Opus 5.5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

copilot-setting security.instructions.md compared with instructions from other repositories

copilot-setting security.instructions.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
copilot-setting security.instructions.mdzexion7873/copilot-settingInstructions file11mo agoMITB1,095GitHub Copilot
ai-agent-rules-generator copilot.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA3,431GitHub Copilot
ai-agent-rules-generator agent-observations.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA1,787GitHub Copilot
ai-agent-rules-generator task.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA1,703GitHub Copilot
ai-agent-rules-generator doc-sync.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA1,652GitHub Copilot
ai-agent-rules-generator browsetools.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA490GitHub Copilot
ai-agent-rules-generator devtools.instructions.mdsavedpixel/ai-agent-rules-generatorInstructions file86mo agoMITA399GitHub Copilot