security

security is a cursor rule for Cursor from nedcodes-ok/cursor-doctor. It costs 957 tokens per session, scanned A, a copy of security, MIT.

Security rules for validating input, protecting accounts and data, encoding output safely, hashing passwords, and securing sessions.

In plain words
What is it for?
Use them when designing or reviewing server-side validation, authentication, password handling, rate limits, cookies, database access, or output encoding.
Why use it?
They reduce common risks such as malformed input, injection, weak password storage, credential attacks, and unsafe authentication sessions.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use them when designing or reviewing server-side validation, authentication, password handling, rate limits, cookies, database access, or output encoding.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/nedcodes-ok/cursor-doctor/security
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.

Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctor

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 security

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/security/github.svg)](https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/security)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/security"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/security/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 security

Your own site · 80×15
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/security"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 957 This file is loaded in full into every session.
When invoked 957 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00957 $0.00957
Opus 5.5 $0.00383 $0.00383
Sonnet 5.5 $0.00191 $0.00191
Haiku 4.5 $0.00096 $0.00096

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

Security

Grade A, and why

security scanned grade A with 0 findings 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 3mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to security — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

pro-kit/templates/practices/security.mdc · 45 lines

How it starts

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

Security Rules

Input Validation

  • Validate ALL user input on the server — type, length, format, range. Client-side validation is UX, not security
  • Allowlists over denylists: define what IS allowed, not what isn't. Denylists always miss something
  • Context-aware output encoding: HTML entities for HTML context, parameterized queries for SQL, shell escaping for commands. The same input needs different escaping in different outputs
  • Zod, Joi, Pydantic, or similar for structured validation — don't write regex for every field. Schema validation catches entire classes of malformed input at once
  • Reject unexpected fields, don't just ignore them. If your API accepts { name, email } and receives { name, email, isAdmin: true }, the extra field should cause an error or be stripped explicitly

Authentication

  • bcrypt (cost 12+) or Argon2id for password hashing — never MD5, SHA-256, or single-pass algorithms. If an attacker gets the database, bcrypt makes brute-force take years instead of hours
  • Rate limit auth endpoints: 5-10 attempts per IP per minute. After lockout, require CAPTCHA or temporary block — without this, credential stuffing is trivial
  • Session cookies: httpOnly (no JS access), secure (HTTPS only), sameSite: strict or lax (prevents CSRF). Missing any of these is a real vulnerability, not a nice-to-have
  • Implement actual logout: invalidate the session/token server-side. Just deleting the client cookie means a captured token still works
  • JWTs are not sessions: they can't be revoked until they expire. For applications that need instant revocation (admin ban, password change), use server-side sessions or a token blocklist

Authorization

  • Check permissions on every request server-side — hiding a button in the UI is not access control. Every API endpoint must verify the caller has permission
  • Object-level authorization: verifying a user is authenticated is not enough. Verify they own or have access to the specific resource: WHERE user_id = auth.uid() AND id = :requestedId
  • IDOR (Insecure Direct Object Reference) is the most common authorization bug: user changes /api/orders/123 to /api/orders/124 and sees someone else's order. Always verify ownership
  • Fail closed: if the permission check errors or is ambiguous, deny access. if (!hasPermission) deny not if (hasPermission) allow else maybe allow
  • Principle of least privilege: give each component/user/service the minimum access it needs. Database users for the app shouldn't have DROP TABLE permissions

Read the full file on GitHub · 45 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. 3mo ago First seen · 45 lines · 957 tokens per session scan A ff9ffb6717b3

Subscribe to this mod's changes

security is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (10 stars, last pushed 8mo ago), licensed MIT. It adds 957 tokens to every session, about $0.0038 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to security, differing in 0 lines, and is treated as a copy.

Related

security compared with cursor rules from other repositories

security next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
securitynedcodes-ok/cursor-doctorCursor rule108mo agoMITA957Cursor
test-patternstugkanboz/awesome-cursorrulesCursor rule242mo agoMITA2,177Cursor
testing-fundamentalstugkanboz/awesome-cursorrulesCursor rule242mo agoMITA26Cursor
componentskensaurus/cursor-kenjiCursor rule92mo agoMITA0Cursor
minimax-m3-self-evolutionmadebyaris/advance-minimax-m3-cursor-rulesCursor rule1265mo agoMITA26Cursor
skill-authoringmadebyaris/advance-minimax-m3-cursor-rulesCursor rule1265mo agoMITA42Cursor
gitkensaurus/cursor-kenjiCursor rule92mo agoMITA5Cursor