agentleFS
n-shadloon-shadloo/secure-code-auditor/.cursor/rules/secure-code-auditor.mdc

secure-code-auditor / rules

Cursor rule4 starsChanged 2 months agoMITView on GitHub

Backend security review and secure-by-default coding for Django and DRF, on an OWASP Top 10:2025, API Security Top 10:2023, and ASVS 5.0 foundation. Apply when backend code is written or reviewed and touches authentication, sessions, cookies, JWT, OAuth2/OIDC, API keys, password hashing, permissions, access control, IDOR, SSRF, path traversal, open redirect, impersonation, SQL/command/template injection, LDAP, row-level security, encrypted columns, NoSQL, Redis, file uploads, S3, serializers, rate limiting, CSRF/CORS, OpenAPI schema, GraphQL, Django Ninja, gRPC, AI agents, MCP tools, secrets, payments, webhooks, Celery, Django tasks, race conditions, ReDoS, caching, deserialization, async/ASGI, WebSockets, audit logging, erasure, retention, personal data, migrations, JWKS, mutual TLS, SECRET_KEY, SBOM, X-Forwarded-For, SPF/DKIM/DMARC, or deployment config, even if "security" is never used. Canonical instructions live in SKILL.md and references/.

  • Reads credentials
  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this secure-code-auditor.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When you review backend security or write backend code in this repository, use the skill in SKILL.md as the source of truth.

    line 6
  2. Very specific:

    Read-only triage scripts sit under scripts/.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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
secure-code-auditor.mdc
---
description: Backend security review and secure-by-default coding for Django and DRF, on an OWASP Top 10:2025, API Security Top 10:2023, and ASVS 5.0 foundation. Apply when backend code is written or reviewed and touches authentication, sessions, cookies, JWT, OAuth2/OIDC, API keys, password hashing, permissions, access control, IDOR, SSRF, path traversal, open redirect, impersonation, SQL/command/template injection, LDAP, row-level security, encrypted columns, NoSQL, Redis, file uploads, S3, serializers, rate limiting, CSRF/CORS, OpenAPI schema, GraphQL, Django Ninja, gRPC, AI agents, MCP tools, secrets, payments, webhooks, Celery, Django tasks, race conditions, ReDoS, caching, deserialization, async/ASGI, WebSockets, audit logging, erasure, retention, personal data, migrations, JWKS, mutual TLS, SECRET_KEY, SBOM, X-Forwarded-For, SPF/DKIM/DMARC, or deployment config, even if "security" is never used. Canonical instructions live in SKILL.md and references/.
alwaysApply: false
---

When you review backend security or write backend code in this repository,
use the skill in `SKILL.md` as the source of truth. Read `SKILL.md` first
for the router, the ownership table, and the mode logic. Then open the
relevant `references/*.md` file(s).

During a task, change no file of this skill unless the task is a change to this
skill. After the task, if this skill gave wrong or incomplete information, load
`SELF-IMPROVEMENT.md` and obey it. Before the task, if
`~/.skill-improvements/secure-code-auditor/` exists, do section 3 of that file.

The router is grouped: the OWASP Top 10:2025 spine, then cross-cutting
surfaces, then package decisions. Pick the group, then the row. Where two
rows could both match, the "Ownership and boundaries" table below the router
names the one file that owns the topic. Read that table before you assume a
topic is duplicated.

At review-time, read `references/01-audit-workflow.md` before any topic file.
It owns the sweep. That sweep is the phase order and per-phase artifacts,
the entry-point inventory enumerated from declarations, and principals and
boundaries. It is also the hypothesis order, the budget rule for a large
tree, and the six-item verification gate with the benign-pattern catalog.
The coverage ledger and the WSTG section mapping complete it. The topic
files answer the questions that sweep raises. Review-time produces
prioritized findings. Each carries a severity, a location, a CWE and
OWASP mapping, the confirmed source-to-sink path with the protection that
failed, and a fix. The codebase stays read-only, and the report ends with
what was not reviewed.

At write-time, apply the secure-default contract while you generate code, and
close with a short security-decisions note rather than a findings report.
Each write-time rule sits beside the control it completes, so the file you
opened for the concern already carries the rule for writing it. Where a
secure default conflicts with the request, apply the default and say so in
one line. `references/00-methodology-and-severity.md` holds the methodology,
both output formats, the severity rubric and its baseline table, the ASVS
chapter mapping, and the conflict rule.

Read-only triage scripts sit under `scripts/`. All three parse with the `ast`
module rather than match lines. A hit is therefore a structural match, and it
names the reference file that owns it. `entrypoint_inventory.py` enumerates
the declared entry points a sweep starts from. `settings_scan.py` reads a whole
settings package rather than a single module. `dangerous_patterns.py` reports
risky-pattern indicators, and `--selftest` proves the scanner itself. Do not
rely on this summary alone — read the referenced files.

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.