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/python-logging-monitoring-failuresgit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWrote 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/python-logging-monitoring-failures)<a href="https://agentmods.dev/rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/python-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 | $0.00000 | $0.03895 |
| Opus 5 | $0.00000 | $0.01947 |
| Sonnet 5 | $0.00000 | $0.00779 |
| Haiku 4.5 | $0.00000 | $0.00390 |
Grade A, and why
python-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 5d 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 python-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 — 444 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Security Logging and Monitoring Failures Standards (OWASP A09:2021)
This rule enforces security best practices to prevent security logging and monitoring failures in Python applications, as defined in OWASP Top 10:2021-A09.
actions:
-
type: enforce conditions:
Pattern 1: Missing logging in authentication functions
- pattern: "def\s+(login|authenticate|signin|logout|signout).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Authentication function without logging detected. Always log authentication events, especially failures, for security monitoring."
Pattern 2: Missing logging in authorization functions
- pattern: "def\s+(authorize|check_permission|has_permission|is_authorized|require_permission).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Authorization function without logging detected. Always log authorization decisions, especially denials, for security monitoring."
Pattern 3: Missing logging in security-sensitive operations
- pattern: "def\s+(create_user|update_user|delete_user|reset_password|change_password).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Security-sensitive user operation without logging detected. Always log security-sensitive operations for audit trails."
Pattern 4: Missing logging in exception handlers
- pattern: "except\s+[^:]+:[^\n]*?(?!.*logging\.(warning|error|critical|exception))" message: "Exception handler without logging detected. Always log exceptions, especially in security-sensitive code, for monitoring and debugging."
Pattern 5: Logging sensitive data
- pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?(password|token|secret|key|credential|auth)" message: "Potential sensitive data logging detected. Avoid logging sensitive information like passwords, tokens, or keys."
Pattern 6: Insufficient log level in security context
- pattern: "logging\.debug\([^)]*?(auth|login|permission|security|attack|hack|exploit|vulnerability)" message: "Debug-level logging for security events detected. Use appropriate log levels (INFO, WARNING, ERROR) for security events."
Pattern 7: Missing logging configuration
- pattern: "import\s+logging(?!.*logging\.basicConfig|.*logging\.config)" message: "Logging import without configuration detected. Configure logging properly with appropriate handlers, formatters, and levels."
Pattern 8: Insecure logging configuration
- pattern: "logging\.basicConfig\([^)]?level\s=\s*logging\.DEBUG" message: "Debug-level logging configuration detected. Use appropriate log levels in production to avoid excessive logging."
Pattern 9: Missing request/response logging in web frameworks
- pattern: "@app\.route\(['"][^'"]+['"]|@api_view\(|class\s+\w+\(APIView\)|class\s+\w+\(View\)" message: "Web endpoint without request logging detected. Consider logging requests and responses for security monitoring."
Pattern 10: Missing correlation IDs in logs
- pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?(?!.*request_id|.*correlation_id|.*trace_id)" message: "Logging without correlation ID detected. Include correlation IDs in logs to trace requests across systems."
Pattern 11: Missing error handling for logging failures
- pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?\)" message: "Logging without error handling detected. Handle potential logging failures to ensure critical events are not missed."
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.
- 5d ago First seen · 444 lines · 3,895 tokens per session scan A c51098a7b89c
python-logging-monitoring-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,895 tokens. A static security scan graded it A with 0 findings. It is 100% identical to python-logging-monitoring-failures, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
010-python-tooling
Python tooling and dependency conventions for plugin-eval and tools/.
pyspark-etl-best-practices-cursorrules-prompt-file
Cursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
python-flask-json-guide-cursorrules-prompt-file
Cursor rules for Python Flask development with JSON guide.
python-llm-ml-workflow-cursorrules-prompt-file
Cursor rules for Python LLM & ML development with workflow integration.
python-github-setup-cursorrules-prompt-file
Cursor rules for Python development with GitHub setup integration.
py-fast-api
Cursor rules for Python FastAPI backend development and best practices.