Safeguard
Developer Tools•

Should security teams keep their docs in Git (docs as code)?

Docs as code puts security runbooks and standards in version control with review. See the benefits, what to keep out of Git, and how to start in a week.

Safeguard Security Team
4 min read

Often yes. Keeping runbooks, standards and FAQs as plain text in Git gives you review, history, owners and the ability to block changes that skip documentation. It suits engineering heavy teams, but keep sensitive material out and make editing easy for people who do not use Git.

What docs as code means

Write the Docs describes it as writing documentation with the same tools as code: issue trackers, version control, plain text markup such as Markdown, code review and automated tests. It lists benefits such as writers integrating better with development teams, developers often writing a first draft, and the option to block merging of new features that lack documentation.

Why it fits security docs

NeedWhat Git gives you
Know who changed a rule and whyCommit history and pull request discussion
Make sure a second person reviewsRequired reviews and code owners
Keep docs near what they describeDocs in the same repository as the service
Detect broken links and old pagesAutomated checks in CI
Track versions of a standardTags and releases

On code owners: GitHub documents that a CODEOWNERS file assigns responsible people or teams to paths, and that they are automatically requested for review on matching pull requests. See owners and review dates.

What to keep in Git, and what not

Keep in Git:

  • Runbooks, standards, guidelines and decision records.
  • FAQ entries and the glossary.
  • Templates, such as the service security card.

Keep out of Git, or in a restricted repository:

  • Credentials of any kind, even test ones.
  • Raw customer data and unredacted screenshots.
  • Details of unfixed flaws in named systems.

See what should never go in a security wiki. The same rules apply, and Git history is permanent, which makes mistakes harder to undo.

A week to start

  1. Day 1. Create a repository with a README, a template and a CODEOWNERS file.
  2. Day 2. Move five high traffic pages in as Markdown. Leave the old versions with a "moved" pointer.
  3. Day 3. Add a link checker and a spell check to CI.
  4. Day 4. Require one review on pull requests, with owners auto requested.
  5. Day 5. Publish the repository as a browsable site, and add front matter fields for owner and last reviewed.

Add a front matter check later that fails the build when a review date is more than a set age.

Lower the barrier for non engineers

Not everyone is comfortable with Git. Offer a web editor, a simple form that opens a pull request, or a suggestion channel so legal, HR and compliance colleagues can contribute without learning a command line.

Link docs to enforcement

When a doc says a rule applies to pull requests, link to the check that applies it. A written rule and a gate that matches it reinforce each other. See written rule or enforced check.

Sources

Where Safeguard fits

Repositories also hold your code, and Safeguard's dependency scanning, SBOM generation and policy gates apply to them. Start with the free scan at gold.safeguard.sh/scan.

Quick check

Is a wiki still fine?

Yes. A wiki is easier for broad editing. What matters is a single source of truth, an owner and a review date, whichever tool you use.

Does docs as code need a writer?

No. Engineers can write the first draft. A reviewer with an eye for clarity helps a lot.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.