safety

A set of mandatory safety rules for coding-agent sessions, covering destructive commands, blocked operations, secrets, passwords, input validation, and dependencies. Destructive commands can erase data or change shared systems.

In plain words
What is it for?
Use it to govern commands involving deletion, database changes, deployment, publishing, production data, credentials, dependency review, and blocked file or process operations.
Why use it?
It prevents risky actions and requires confirmation or stopping when an operation could cause damage or bypass a safety restriction.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/gosha70/code-copilot-team/safety
Clone the repo
git clone --depth 1 https://github.com/gosha70/code-copilot-team

Made for: Cursor.

Per session 529 This file is loaded in full into every session.
When invoked 529 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
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 $0.00529 $0.00529
Opus 5 $0.00264 $0.00264
Sonnet 5 $0.00106 $0.00106
Haiku 4.5 $0.00053 $0.00053

Measured 2d ago against content hash 7e113e061753, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Any destructive command: rm -rf, DROP TABLE, TRUNCATE, git reset --hard, git push --force.
adapters/cursor/.cursor/rules/safety.mdc · 53 lines

How it starts

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

Agent Safety Rules

Non-negotiable safety constraints for all sessions.

Confirmation Required Before

  • Any destructive command: rm -rf, DROP TABLE, TRUNCATE, git reset --hard, git push --force.
  • Any deployment or publish action.
  • Any command that modifies production data.
  • Any command with side effects outside the working directory.

Blocked Operations — Stop, Don't Improvise

When the normal path for an operation is blocked (lock files, permission errors, sandbox restrictions), the correct response is to stop and explain the blockage to the user — not to improvise a workaround using low-level flags or environment variables.

Specific prohibitions:

  • Never set GIT_INDEX_FILE, GIT_DIR, or other git environment variables to route around lock files or index problems.
  • Never use --no-verify, --no-gpg-sign, or similar flags to bypass pre-commit hooks or signing unless the user explicitly requests it.
  • Never bypass sandbox restrictions, file permission checks, or process locks by manipulating environment variables or creating alternate state files.

Why: A real incident demonstrated this failure mode — using GIT_INDEX_FILE to bypass .git/index.lock created a commit with an empty tree that appeared to delete every file in the repository. The copilot pattern-matched "bypass the lock" without reasoning about the consequence (an empty alternate index). The correct move was to explain that the lock file was blocking the commit and ask the user to remove it.

Secrets & Credentials

  • Never hard-code API keys, tokens, passwords, or connection strings in source.
  • Strip secrets from all output before displaying.
  • Never commit .env files or credential files.
  • If a secret is found in code, flag it immediately.

Password Storage

  • Never store plain passwords in the database.
  • Always hash passwords before storing using bcrypt, argon2, or equivalent.
  • Consider passwordless auth (magic links, OAuth, passkeys) to avoid password storage entirely.

Read the full file on GitHub · 53 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. 2d ago First seen · 53 lines · 529 tokens per session scan C 7e113e061753

Subscribe to this mod's changes

safety is a cursor rule published in the GitHub repository gosha70/code-copilot-team (6 stars, last pushed 2d ago), licensed MIT. It adds 529 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.