secret-detection

secret-detection is a cursor rule for Cursor from ivangrynenko/cursorrules. It costs 2,362 tokens per session, scanned A, original, MIT.

A set of rules that looks for API keys, access tokens, cloud credentials, and other sensitive values in code.

In plain words
What is it for?
It helps identify hardcoded credentials and points developers toward environment variables, SDK credential providers, or a secrets manager.
Why use it?
It warns about secrets that could be committed to a repository or exposed to other people.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It helps identify hardcoded credentials and points developers toward environment variables, SDK credential providers, or a secrets manager.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ivangrynenko/cursorrules/secret-detection
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/ivangrynenko/cursorrules

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 secret-detection

README.md
[![agentmods](https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/secret-detection/github.svg)](https://agentmods.dev/rules/ivangrynenko/cursorrules/secret-detection)
Your own site
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/secret-detection"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/secret-detection/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 secret-detection

Your own site · 80×15
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/secret-detection"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/secret-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,362 This file is loaded in full into every session.
When invoked 2,362 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 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.1 $0.02362 $0.02362
Opus 5.5 $0.00945 $0.00945
Sonnet 5.5 $0.00472 $0.00472
Haiku 4.5 $0.00236 $0.00236

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

Security

Grade A, and why

secret-detection 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 2mo 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

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/secret-detection.mdc · 168 lines

How it starts

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

Secret Detection and Warning Rule

This rule helps identify potential secrets, credentials, and sensitive data in code files to prevent accidental exposure or leakage. It provides warnings when secrets are detected and suggests best practices for secure secret management.

actions:

  • type: enforce conditions:

    Generic API Keys, Tokens, and Credentials

    • pattern: "(?i)(api[-]?key|apikey|api[-]?secret|apisecret|app[-]?key|appkey|app[-]?secret|access[-]?key|accesskey|access[-]?token|auth[-]?key|authkey|client[-]?secret|consumer[-]?key|consumer[-]?secret|oauth[_-]?token|token)[\s][=:]\s'\"{16,}['\"]" message: "Potential API key or secret detected. Consider using environment variables or a secure secrets manager instead of hardcoding sensitive values."

    AWS Keys and Tokens

    • pattern: "(?i)(aws[-]?access[-]?key|aws[-]?secret[-]?key|aws[-]?account[-]?id)[\s][=:]\s'\"{16,}['\"]" message: "Potential AWS key detected. AWS credentials should be stored securely using AWS SDK credential providers, environment variables, or a secrets manager."

    Google Cloud and Firebase

    • pattern: "(?i)(google[-]?api[-]?key|google[-]?cloud[-]?key|firebase[-]?api[-]?key)[\s][=:]\s'\"{16,}['\"]" message: "Potential Google Cloud or Firebase key detected. Use environment variables or a secure secrets manager to store these credentials."

    Azure and Microsoft

    • pattern: "(?i)(azure[-]?key|azure[-]?connection[-]?string|microsoft[-]?key)[\s][=:]\s'\"{16,}['\"]" message: "Potential Azure or Microsoft key detected. Use Azure Key Vault, environment variables, or a secure secrets manager instead of hardcoding credentials."

    Database Connection Strings and Credentials

    • pattern: "(?i)(jdbc:|mongodb[\+]?://|postgres://|mysql://|database[-]?url|connection[-]?string)[^\n]{10,}(password|pwd)[^\n]{3,}" message: "Potential database connection string with credentials detected. Use environment variables or a secure configuration manager for database connections."

    Database Credentials

    • pattern: "(?i)(db[-]?password|mysql[-]?password|postgres[-]?password|mongo[-]?password|database[_-]?password)[\s][=:]\s['\"][^\s]{3,}['\"]" message: "Potential database password detected. Store database credentials in environment variables or use a secure configuration manager."

    Private Keys and Certificates

    • pattern: "(?i)-----(BEGIN|END) (RSA |DSA |EC )?(PRIVATE KEY|CERTIFICATE)-----" message: "Private key or certificate material detected. Never include these directly in code - store them securely and reference them from protected locations."

    SSH Keys

    • pattern: "(?i)ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3}" message: "SSH key detected. SSH keys should be managed securely and never included directly in code files."

    Passwords

    • pattern: "(?i)(password|passwd|pwd|secret)[\s][=:]\s['\"][^\s]{3,}['\"]" message: "Potential password detected. Never hardcode passwords in code files. Use environment variables or a secure secrets manager."

    OAuth Tokens

    • pattern: "(?i)(bearer|oauth|access[-]?token)[\s][=:]\s['\"][\w\d\-.]{30,}['\"]" message: "Potential OAuth token detected. Store tokens securely and consider implementing proper token rotation."

    JWT Tokens

    • pattern: "(?i)ey[a-zA-Z0-9]{20,}\.ey[a-zA-Z0-9\-]{20,}\.[a-zA-Z0-9\-]{20,}" message: "JWT token detected. Never hardcode JWT tokens directly in your code."

Read the full file on GitHub · 168 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. 2mo ago First seen · 168 lines · 2,362 tokens per session scan A 2defb1f42eec

Subscribe to this mod's changes

secret-detection is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 1y ago), licensed MIT. It adds 2,362 tokens to every session, about $0.0094 per session on Opus 5.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-09-03.

Related

secret-detection compared with cursor rules from other repositories

secret-detection next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
secret-detectionivangrynenko/cursorrulesCursor rule881y agoMITA2,362Cursor
cross-tool-confignedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA24Cursor
angularnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA988Cursor
djangonedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA1,072Cursor
vuenedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA866Cursor
gonedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA1,028Cursor
javanedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA1,083Cursor