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/adobe/aem-desktop/security-global-sql-usagegit clone --depth 1 https://github.com/adobe/aem-desktopWhat 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.00020 | $0.00896 |
| Opus 5 | $0.00010 | $0.00448 |
| Sonnet 5 | $0.00004 | $0.00179 |
| Haiku 4.5 | $0.00002 | $0.00090 |
Grade A, and why
security-global-sql-usage 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.
This is a copy
100% identical to security-global-sql-usage — 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Secure SQL Usage
These rules apply to all code that interacts with SQL databases, regardless of language or framework, including generated code.
All violations must include a clear explanation of which rule was triggered and why, to help developers understand and fix the issue effectively.
Generated code must not violate these rules. If a rule is violated, a comment must be added explaining the issue and suggesting a correction.
1. Always Use Parameterized Queries and Prepared Statements
- Rule: Never construct SQL queries by concatenating or interpolating user input directly into the query string. Always use parameterized queries or prepared statements provided by your database library. Prepared statements ensure that user input is treated as data, not executable code, and are the most effective way to prevent SQL injection.
- Example (unsafe, Python):
cursor.execute(f"SELECT * FROM users WHERE username = '{username}'") - Example (safe, Python):
cursor.execute("SELECT * FROM users WHERE username = ?", (username,)) - Example (unsafe, PHP):
$query = "SELECT * FROM users WHERE username = '" . $_GET['username'] . "'"; $result = mysqli_query($conn, $query); - Example (safe, PHP - using prepared statements):
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ?"); $stmt->bind_param("s", $_GET['username']); $stmt->execute(); $result = $stmt->get_result();
2. Validate Inputs Before Query Use
- Rule: All external input used in query logic must be validated for type, length, format, and business constraints before use. Validation is defense in depth; it does not replace parameterized queries or prepared statements.
- Rule: Do not SQL-escape, quote, or otherwise encode input at collection or storage time. Keep values as data and pass them through parameterized query APIs at the point of database use.
3. Avoid Dynamic SQL Unless Absolutely Necessary
- Rule: Do not build dynamic SQL structure (e.g., table names, column names, schema names, sort directions, operators) from user-controlled strings unless there is no safe alternative.
- Rule: If dynamic SQL structure is unavoidable, user input may only select a key from a closed mapping or enum whose values are developer-defined SQL fragments. The user-provided string must never be inserted into the SQL text, even after validation or allow-list checks.
- Example (unsafe, Python - validated user string still enters SQL):
ALLOWED_COLUMNS = {"created_at", "email", "username"} if sort_column not in ALLOWED_COLUMNS: raise ValueError("invalid sort column") cursor.execute(f"SELECT * FROM users ORDER BY {sort_column}") - Example (safe, Python - user input selects a developer-defined literal):
SORT_COLUMNS = { "created": "created_at", "email": "email", "name": "username", } sort_sql_fragment = SORT_COLUMNS.get(requested_sort) if sort_sql_fragment is None: raise ValueError("invalid sort option") # Safe: sort_sql_fragment is a developer-defined literal, not user input. cursor.execute(f"SELECT * FROM users ORDER BY {sort_sql_fragment}")
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.
- yesterday First seen · 74 lines · 20 tokens per session scan A b2fcbc0a8c26
security-global-sql-usage is a cursor rule published in the GitHub repository adobe/aem-desktop (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 20 tokens to every session and 896 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to security-global-sql-usage, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.