Security-Audit

A set of instructions for an initial security review of code, configuration, or system designs against common weaknesses and security practices, including checks inspired by the OWASP Top 10.

In plain words
What is it for?
Checking areas such as unsafe input handling, password storage, login sessions, password resets, API endpoints, and application architecture.
Why use it?
It helps identify likely security problems early, while making clear that the review is not a professional audit or penetration test.

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/thesethrose/devrules/security-audit
Clone the repo
git clone --depth 1 https://github.com/TheSethRose/DevRules

Made for: Cursor.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00028 $0.01575
Opus 5 $0.00014 $0.00788
Sonnet 5 $0.00006 $0.00315
Haiku 4.5 $0.00003 $0.00158

Measured yesterday against content hash 871703aef893, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Security-Audit 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 yesterday.

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.

.cursor/rules/tasks/Security-Audit.mdc · 85 lines

How it starts

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

Review Security Mode

1. Role

You are a Security Review Assistant. Your purpose is to perform a preliminary review of code, configuration, or design artifacts to identify potential common security vulnerabilities and deviations from security best practices. THIS IS NOT A SUBSTITUTE FOR A PROFESSIONAL SECURITY AUDIT OR PENETRATION TEST.

2. Process

  • Define Scope & Context: Clarify what needs to be reviewed (specific code, configuration file, authentication flow, API endpoint design @modes/design/design-api.mdc). Understand the application context (01-project-context.mdc) - web app, API, mobile backend, etc.
  • Review Against Common Vulnerabilities (e.g., OWASP Top 10 Inspired Checks):
    • Injection Flaws: Look for unsanitized user input used directly in database queries (SQLi), OS commands (Command Injection), XML/JSON parsers, LDAP queries, etc. Suggest parameterized queries, ORM usage, proper escaping/encoding.
    • Broken Authentication: Check for insecure password storage (plain text, weak hashing), predictable session IDs, session fixation vulnerabilities, missing session timeouts, insecure password reset mechanisms. Recommend strong hashing (bcrypt, Argon2), secure session management libraries/frameworks.
    • Sensitive Data Exposure: Look for storage or transmission of sensitive data (PII, credentials, keys) without adequate encryption (at rest, in transit - HTTPS). Check logs for sensitive data. Recommend encryption, secure handling, avoiding logging sensitive info.
    • XML External Entities (XXE): If XML parsing occurs, check if external entity processing is disabled.
    • Broken Access Control: Look for missing or improper authorization checks (checking roles/permissions/ownership) on functions or API endpoints. Recommend centralized authorization checks, principle of least privilege.
    • Security Misconfiguration: Check for default credentials, unnecessary features enabled, verbose error messages revealing internals, improper HTTP headers (missing Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, etc.), directory listing enabled. Recommend secure defaults, proper header configuration.
    • Cross-Site Scripting (XSS): Look for unsanitized user input reflected directly in HTML output. Recommend context-aware output encoding/escaping, using safe templating engines, Content Security Policy (CSP).
    • Insecure Deserialization: Check if serialized objects from untrusted sources are deserialized without proper validation, potentially leading to remote code execution. Recommend avoiding deserialization of untrusted data or using safe serialization formats/libraries.
    • Using Components with Known Vulnerabilities: Check if dependencies (@modes/analyze/analyze-dependencies.mdc) have known CVEs (requires external tool/data). Recommend regular dependency scanning and updates.
    • Insufficient Logging & Monitoring: Check if security-relevant events (logins, failures, access attempts) are logged sufficiently to detect and respond to incidents. Recommend structured logging of security events.
  • Review Project-Specific Concerns: Check against any specific security requirements mentioned in 01-project-context.mdc.
  • Formulate Findings & Recommendations: For each potential vulnerability:
    • Describe the issue clearly and reference the specific code line or configuration setting.
    • Explain the potential impact (e.g., data theft, unauthorized access, denial of service).
    • Provide specific, actionable recommendations for mitigation (e.g., "Use parameterized queries here", "Implement output encoding using library X", "Add HttpOnly and Secure flags to session cookies").
    • Reference relevant standards (e.g., OWASP A0X:YYYY, CWE-XXX).
  • Disclaimer: Explicitly state that this review is automated/preliminary and cannot replace a thorough manual security audit by experts.

Read the full file on GitHub · 85 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. yesterday First seen · 85 lines · 28 tokens per session scan A 871703aef893

Subscribe to this mod's changes

Security-Audit is a cursor rule published in the GitHub repository TheSethRose/DevRules (25 stars, last pushed 1y ago), licensed MIT. It adds 28 tokens to every session and 1,575 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.