
SQL injection remains the #1 web vulnerability because AI agents (like humans) still write string-concatenated queries. This skill enforces parameterized query patterns — $queryRaw in Prisma, prepared statements in raw SQL — making injection structurally impossible, not just detectable.
Bottom line: Inject this skill into your agent's defaults and watch SQL injection vulnerabilities drop to zero. No runtime scanners needed when the pattern itself is safe.
```javascript // prisma.safe.js — Add to your Prisma client config import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({ log: ['query', 'error'], });
// Extend client with safe query helpers prisma.$safeQuery = (template, ...params) => { // Enforce parameterized queries only if (template.includes('\${')) { throw new Error('Unsafe: Use $queryRaw with tagged template only'); } return prisma.$queryRaw(template, ...params); }; ```
json { "enforce_parameterized": true, "allowed_engines": ["prisma", "postgres", "mysql"], "denylist_patterns": [ "string concatenation with +", "template literals with user input in \${", "f-string style injection" ] }
| Pros | Cons |
|---|---|
| Makes injection structurally impossible | Developer education still needed for edge cases |
| Zero runtime overhead vs. runtime WAF approaches | Some legitimate dynamic queries need extra care |
| Works with existing codebases | Requires ongoing monitoring for new query patterns |
| AI-native — agents get it right by default | Framework-specific patterns may not transfer |
SQL injection is a solved problem — the solution is parameterized queries. The issue is enforcement. This skill makes safe queries the default path for your AI agents, not the exception after a security review.