agentleFS
joaoguimaraesprojoaoguimaraespro/personal-finance/.cursor/rules/common-security.mdc

personal-finance / rules

Cursor rule1 starsChanged todayMITView on GitHub

Security checks before every commit, secret handling, data handling and what to do when an issue is found

  • Reads credentials

The file

We split this common-security.mdc into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Stop the current change.

    line 27
  2. Very specific:

    Use the security-reviewer agent on the affected code.

    line 28
  3. Distinctive:

    Look for the same pattern elsewhere in the codebase.

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
common-security.mdc
---
description: "Security checks before every commit, secret handling, data handling and what to do when an issue is found"
globs: 
alwaysApply: true
---
<!-- Generated by armature from core/rules/common/security.md. Edit the source rule, not this file. -->
# Security (all languages)

## Before every commit
- [ ] No hardcoded secrets (keys, passwords, tokens, connection strings); no `.env` committed
- [ ] All external input validated; queries parameterised (no string-built SQL)
- [ ] Output encoded for its context (HTML, shell, SQL, logs)
- [ ] Authentication and authorisation checked on the server, per request; tenant taken from the token, not from
      a header, query or route
- [ ] Error messages and logs leak no secrets, tokens or personal data
- [ ] New dependencies are maintained, pinned, and from the official registry

## Secrets
- Environment variables or a secret manager only. Check required secrets at startup and fail fast.
- Local development values are clearly fake (e.g. prefixed `local-only-`). Rotate anything that may have leaked.

## Data
- Synthetic data only in the repo, tests, specs, issues and commits. No client data, no real organisation names.
- Least privilege for every service account, token and database user.

## When you find an issue
1. Stop the current change.
2. Use the `security-reviewer` agent on the affected code.
3. Fix CRITICAL issues before anything else; rotate exposed secrets.
4. Look for the same pattern elsewhere in the codebase.

<!-- Adapted from affaan-m/ECC rules/common/security.md (MIT) at d2ef268; merged with the owner's no-client-data and tenant-from-token rules. -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.