git-safety

git-safety is a skill for Cursor from cam-douglas/agent-instructions. It costs 23 tokens per session (638 once invoked), scanned C, original, MIT.

A Git safety control that sets an anonymous author identity and blocks secrets from Git operations. Git is the system used to track code changes and share them with others.

In plain words
What is it for?
It is for checking commits, merges, rebases, cherry-picks, tags, pushes, staging, and repository hooks before they run.
Why use it?
It prevents private email addresses from appearing in commits and helps stop passwords, tokens, and other sensitive files from being staged, committed, or pushed.

Skill for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit It is for checking commits, merges, rebases, cherry-picks, tags, pushes, staging, and repository hooks before they run.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cam-douglas/agent-instructions/git-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cam-douglas/agent-instructions --skill git-safety
Clone the repo
git clone --depth 1 https://github.com/cam-douglas/agent-instructions

Made for: Cursor.

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 git-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/cam-douglas/agent-instructions/git-safety/github.svg)](https://agentmods.dev/skills/cam-douglas/agent-instructions/git-safety)
Your own site
<a href="https://agentmods.dev/skills/cam-douglas/agent-instructions/git-safety"><img src="https://agentmods.dev/badge/skills/cam-douglas/agent-instructions/git-safety/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 git-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/cam-douglas/agent-instructions/git-safety"><img src="https://agentmods.dev/badge/skills/cam-douglas/agent-instructions/git-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 638 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00023 $0.00638
Opus 5.5 $0.00009 $0.00255
Sonnet 5.5 $0.00005 $0.00128
Haiku 4.5 $0.00002 $0.00064

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

Security

Grade C, and why

git-safety scanned grade C 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.

The scan reads SKILL.md. This mod also ships 6 executable files (payloads/bootstrap.sh, payloads/policy.mjs, payloads/policy.test.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

4. Do not stage, commit, or push `.env*`, keys, credential JSON, `.netrc`, `.npmrc`, `.pypirc`, or files whose contents match secret patterns.
.cursor/skills/git-safety/SKILL.md · 79 lines

How it starts

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

Git safety

Purpose

Prevent private-email git attribution and keep secrets out of git in every project that uses this control plane.

When to use

  • Any git commit, merge, rebase, cherry-pick, pull that can create a commit, annotated tag, note, or push
  • Any staging command that might include secret-bearing files
  • Before installing or validating repository hooks

Inputs

  • Repository root
  • Intended git command

Tools used

  • scripts/git-safety.mjs
  • scripts/git-safety.test.mjs
  • payloads/policy.mjs
  • payloads/policy.test.mjs
  • payloads/bootstrap.sh
  • payloads/validate-agent-config.mjs
  • payloads/cli.json
  • payloads/git-privacy-and-secrets.mdc
  • payloads/agent-governance.yml
  • Repository .githooks/pre-commit, .githooks/commit-msg, and .githooks/pre-push

Procedure

  1. Never run git config to set user.name or user.email.
  2. Never use the host private email. Always export the Cursor anonymous identity:
GIT_AUTHOR_NAME='Cursor Agent' \
GIT_AUTHOR_EMAIL='[email protected]' \
GIT_COMMITTER_NAME='Cursor Agent' \
GIT_COMMITTER_EMAIL='[email protected]' \
git commit -m "message"
  1. A GitHub noreply address (*@users.noreply.github.com) is also allowed. Any other email is forbidden.
  2. Do not stage, commit, or push .env*, keys, credential JSON, .netrc, .npmrc, .pypirc, or files whose contents match secret patterns.
  3. If bootstrap has not copied hooks yet, copy .githooks/* into .git/hooks/ without changing git config.
  4. If a hook or policy denies the command, stop. Do not weaken the hook.

Expected outcome

Every agent-created git object uses [email protected] or a GitHub noreply address, and no secret value or secret-bearing file enters git.

Validation

node --test .cursor/skills/git-safety/scripts/git-safety.test.mjs
node --test .cursor/hooks/policy.test.mjs

Failure modes / cautions

  • Host user.email is not an authorization signal. If it is a personal inbox, ignore it.
  • Do not print secret values when a scan fails. Report only the path and rule id.
  • Do not use --no-verify or rewrite hooks to bypass this skill.

Read the full file on GitHub · 79 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 First seen · 79 lines · 23 tokens per session scan C aa6021d938d4

Subscribe to this mod's changes

git-safety is a skill published in the GitHub repository cam-douglas/agent-instructions (2 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 638 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.