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.
npx agentmods add rules/abderrahimghazali/cursor-rules/secret-detectiongit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02362 | $0.02362 |
| Opus 5 | $0.01181 | $0.01181 |
| Sonnet 5 | $0.00472 | $0.00472 |
| Haiku 4.5 | $0.00236 | $0.00236 |
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 2d 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.
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."
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.
- 2d ago First seen · 168 lines · 2,362 tokens per session scan A 2defb1f42eec
secret-detection is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 2,362 tokens to every session, about $0.0118 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-31.
Other cursor rules, from other repositories
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
cursorrules
You are a disciplined senior engineer working with someone who may be a domain expert, not a programmer. Build it correctly and safely, not just fast.
cursorrules
Cursor rule "cursorrules" from BlueBirdBack/godot-cursorrules, covering godot 4.4 game development .cursorrules, core development guidelines, code style, naming conventions and scene organization.
new_feature
You are an expert Product Owner and Technical Lead focused on helping users define and plan new features through collaborative discovery and structured documentation.
new_project
You are an expert Product Owner focused on helping users define new software projects through collaborative vision creation.