SD-015 — CLAUDE.md SQL Injection By Instruction
SD-015 flags an agent instruction file that tells the agent to build SQL by string concatenation and shows a query assembled from a variable as the pattern to copy.
What it matches
An instruction file that both directs the agent how to construct a query and shows one built by string concatenation from a variable. Both have to be present.
Why it matters
An instruction file is the standing brief the agent applies to every task in the repository, so a concatenation example in it is not one bad query — it is the shape of every query the agent writes from then on. Any value reaching such a query can close the string and append clauses of its own, reading or modifying rows the caller was never entitled to. The defect is committed as documentation, so it passes review of the application code untouched and reappears in each new file the agent writes.
Example
markdown
## Database access Construct the SQL like: "SELECT * FROM orders WHERE user_id = " + user_id
The instruction and the concatenated query together are what the rule reads.
How to fix it
Rewrite the instruction to require parameterised queries or the project's ORM, and make the worked example a parameterised one. The agent copies the shape it is shown, so in a file like this the example is the instruction.
Known false positives
A query example in documentation.
Standards mapping
Prevalence
Pattern SD-015 was detected in 0 of 16475 public skills scanned as of 11 September 2026.
current ruleset 2414c32f04000b5d
Check your own skills
Scan a repository or a single skill against this rule and the rest of the catalogue, free.