Skip to main content
In this lesson we’ll create a repository security policy that tells contributors and users how to report vulnerabilities in your project. A clear security policy makes it easier for reporters to contact you, reduces noise, and speeds up coordinated disclosures.

What is SECURITY.md?

A security policy is a plain-text file named SECURITY.md that lives either in the repository root or in the .github directory. It should explain:
  • Which project versions receive security updates.
  • How to report a vulnerability and which channels to use.
  • Expected response timelines and how triage will be communicated.
  • Whether encrypted reports are accepted and how to submit them.
  • Any confidentiality expectations and contact details.
Create the file as SECURITY.md and commit it to your repository’s default branch (for example, main).
Prefer storing SECURITY.md in the .github directory for consistency across repositories and easier discovery. Placing it in the repository root is also supported.
A straightforward structure helps reporters find the information they need quickly. Typical sections include:
  • Title (e.g., “Security Policy”)
  • Supported Versions (clear table for supported/unsupported versions)
  • Reporting a Vulnerability (preferred contact channel, PGP for encrypted reports, response expectations)
  • Confidentiality and disclosure timeline
  • Links to security advisories or issue trackers (if applicable)
Example table of placement options:

Example SECURITY.md

Below is an example you can adapt. Copy this into SECURITY.md and customize the contact details, supported versions, and response expectations.
Commit the file to your default branch. If your repository uses branch protection rules, follow your workflow and bypass protection only when appropriate.
A screenshot of a GitHub repository page in dark mode showing the .github directory and its files (ISSUE_TEMPLATE, CODEOWNERS, PULL_REQUEST_TEMPLATE.md, SECURITY.md, dependabot.yml) with recent commit messages. The left sidebar also lists other project files like README.md, app.js and package.json.

How GitHub surfaces SECURITY.md

When present on the default branch, GitHub displays the SECURITY.md contents on the repository’s Security Policy page. This makes the policy highly visible to anyone looking for reporting guidance — for example, the Supported Versions table and Reporting a Vulnerability section will be rendered for quick reference.
A screenshot of a GitHub repository showing the "Security Policy" page with a "Supported Versions" table and a "Reporting a Vulnerability" section. The right sidebar lists repo details like contributors, releases, and language usage.

Coordinated fixes and Security Advisories

You can create private Security Advisories in GitHub to coordinate fixes and notify affected parties. Use SECURITY.md to tell reporters how to contact you so you can move the conversation into a private advisory when appropriate.
If you accept encrypted vulnerability reports, never commit private keys or sensitive decryption material to the repository. Provide only public PGP keys or secure instructions for submitting encrypted reports.

Quick checklist before publishing

  • Put SECURITY.md in .github/ or the repository root.
  • Provide at least one preferred contact method (email or issue tracker).
  • State supported versions and expected response times.
  • Explain whether encrypted reports are accepted and how to provide them.
  • Link to your Security Advisories or incident response resources if available.
Use the example above as a starting point and tailor the content to match your project’s maturity, risk profile, and preferred reporting practices.

Watch Video