Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesnpx agentmods add rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failuresWrote 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.
[](https://agentmods.dev/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures)<a href="https://agentmods.dev/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.06053 | $0.06053 |
| Opus 5 | $0.03027 | $0.03027 |
| Sonnet 5 | $0.01211 | $0.01211 |
| Haiku 4.5 | $0.00605 | $0.00605 |
Grade A, and why
javascript-security-logging-monitoring-failures 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 6d 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.
This is a copy
100% identical to javascript-security-logging-monitoring-failures — 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.
How it starts
The opening of the file, as written. The whole thing — 802 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Detect and prevent security logging and monitoring failures in JavaScript applications as defined in OWASP Top 10:2021-A09 globs: /.js, **/.jsx, /.ts, **/.tsx, !/node_modules/, !/dist/, !/build/, !/coverage/
JavaScript Security Logging and Monitoring Failures (OWASP A09:2021)
actions:
-
type: enforce conditions:
Pattern 1: Missing Error Logging
- pattern: "(?:try\s*{[^}]}\scatch\s*\([^)]\)\s{[^}]})(?|logger?\.(?:error|warn|log)|captureException))" message: "Error caught without proper logging. Implement structured error logging for security events."
Pattern 2: Sensitive Data in Logs
- pattern: "console\.(?:log|warn|error|info|debug)\s*\([^)](?:password|token|secret|key|credential|auth|jwt|session|cookie)" negative_pattern: "\\\|redact|mask|sanitize" message: "Potential sensitive data in logs. Ensure sensitive information is redacted before logging."
Pattern 3: Missing Authentication Logging
- pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authentication function without logging. Log authentication attempts, successes, and failures."
Pattern 4: Missing Authorization Logging
- pattern: "(?:authorize|checkPermission|hasAccess|isAuthorized|can)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authorization check without logging. Log access control decisions, especially denials."
Pattern 5: Insufficient Error Detail
- pattern: "(?:console\.error|logger?\.error)\s*\([^)](?:error|err|exception)\s\)" negative_pattern: "(?:error\.(?:message|stack|code|name)|JSON\.stringify\(error\)|serialize)" message: "Error logging with insufficient detail. Include error type, message, stack trace, and context."
Pattern 6: Missing Security Event Logging
- pattern: "(?:bruteForce|rateLimit|block|blacklist|suspicious|anomaly|threat|attack|intrusion|malicious)" negative_pattern: "(?:log|audit|record|track|monitor|alert|notify)" message: "Security event detection without logging. Implement logging for all security-relevant events."
Pattern 7: Inconsistent Log Formats
- pattern: "console\.(?:log|warn|error|info|debug)\s*\(" negative_pattern: "JSON\.stringify|structured|format" message: "Inconsistent log format. Use structured logging with consistent formats for easier analysis."
Pattern 8: Missing Log Correlation ID
- pattern: "(?:api|http|fetch|axios|request)\s*\([^)]*\)" negative_pattern: "(?:correlationId|requestId|traceId|spanId|context)" message: "API request without correlation ID. Include correlation IDs in logs for request tracing."
Pattern 9: Missing High-Value Transaction Logging
- pattern: "(?:payment|transaction|order|purchase|transfer|withdraw|deposit)\s*\([^)]*\)" negative_pattern: "(?:log|audit|record|track)" message: "High-value transaction without audit logging. Implement comprehensive logging for all transactions."
Pattern 10: Client-Side Logging Issues
- pattern: "(?:window\.onerror|window\.addEventListener\s*\(\s*['"]error['"])" negative_pattern: "(?:send|report|log|capture|track)" message: "Client-side error handler without reporting. Implement error reporting to backend services."
Pattern 11: Missing Log Levels
- pattern: "console\.log\s*\(" negative_pattern: "logger?\.(?:error|warn|info|debug|trace)" message: "Using console.log without proper log levels. Implement a logging library with appropriate log levels."
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.
- 6d ago First seen · 802 lines · 6,053 tokens per session scan A 0ff60ffa6eb7
javascript-security-logging-monitoring-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 6,053 tokens to every session, about $0.0303 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to javascript-security-logging-monitoring-failures, differing in 0 lines, and is treated as a copy.
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.
typescript-type-safety
Use when encountering TypeScript any types, type errors, or lax type checking - eliminates type holes and enforces strict type safety through proper interfaces, type guards, and module augmentation.
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.
project_structure
This is the file structure of the smart coding template.