Sql Injection Prevention
Prevention guide for SQL injection covering prepared statements, parameterized queries, ORM use, and input validation.
- CCM score
- 40 of 100
- skills.sh installs
- 538
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Node.js with PostgreSQL, Python with SQLAlchemy ORM, and Java JDBC prepared statements, plus input validation and sanitization
- Includes a Quick Start
SecureDatabaseclass usingpgpooling with parameterized queries and environment-based connection settings - Enforces a do and don't list: no concatenated user input, no dynamic table or column names, and least-privilege database accounts
- Designed for developers building database-driven applications or reviewing legacy code during a security audit
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill sql-injection-prevention -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
SQL Injection Prevention
Table of Contents
Overview
Implement comprehensive SQL injection prevention using prepared statements, parameterized queries, ORM best practices, and input validation.
When to Use
- Database query development
- Legacy code security review
- Security audit remediation
- API endpoint development
- User input handling
- Dynamic query generation
Quick Start
Minimal working example:
// secure-db.js
const { Pool } = require("pg");
class SecureDatabase {
constructor() {
this.pool = new Pool({
host: process.env.DB_HOST,
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000,
});
}
/**
* ✅ SECURE: Parameterized query
*/
async getUserById(userId) {
const query = "SELECT * FROM users WHERE id = $1";
const values = [userId];
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Security, Databases
- First seen
- Jun 3, 2026
Questions
What does the sql-injection-prevention skill do?
The sql-injection-prevention skill guides an agent to prevent SQL injection attacks using prepared statements, parameterized queries, and input validation. It fits database-driven applications where user input reaches queries, and it covers Node.js with PostgreSQL, Python with SQLAlchemy ORM, and Java JDBC examples.
How do I install the sql-injection-prevention skill?
Run npx -y skills add aj-geddes/useful-ai-prompts --skill sql-injection-prevention -y in your project. That command installs the sql-injection-prevention skill into the project so the agent can apply its parameterized query and validation guidance.
Which skills does sql-injection-prevention sit alongside in the Security category?
sql-injection-prevention is listed in the Security category on Claude Marketplaces, alongside azure-compliance, entra-agent-id, firebase-security-rules-auditor, security-audit and cloudflare-one. It differs from those by focusing on query construction and input handling in database code.
Does sql-injection-prevention need database access or any keys?
The skill's example code reads its database host, name, user and password from environment variables, so your project needs those set for the Node.js example to connect. Its best practices also advise using least privilege database accounts.
More from aj-geddes/useful-ai-prompts
All 258- Anomaly Detection534
- Gap Analysis534
- Grpc Service Development533
- Network Debugging533
- Kpi Dashboard Design531
- Payment Gateway Integration531
- Progressive Web App531
- Microservices Architecture530
- Sql Query Optimization529
- Neural Network Design524
- ML Model Training523
- Security Headers Configuration523
- Exploratory Data Analysis522
- Prometheus Monitoring519
- Frontend Testing516
- Api Error Handling514
- Interaction Design511
- Technical Debt Assessment511
- Computer Vision510
- Feature Engineering510
- React Native App510
- Webhook Development510
- Api Gateway Configuration509
- Stakeholder Communication509
Similar to Sql Injection Prevention
More Securitysql-code-reviewgithub/awesome-copilot15.8K installsUniversal SQL code review guide covering injection prevention, access control, performance, and anti-pattern detection across databases.
sql-injection-testingsickn33/agentic-awesome-skills382 installsCatalog summary of a dual-use SQL injection testing skill that gates all probing behind explicit written authorization.
sql-best-practicesmindrally/skills847 installsOpinionated SQL style guide covering formatting, joins, indexing, transactions, and injection safety for query writing.
sqli-sql-injectionyaklang/hack-skills4.5K installsPlaybook for advanced SQL injection, covering per-database exploitation, out-of-band exfiltration, and filter evasion for authorized testing.
supabase-postgres-best-practicessupabase/agent-skills496.8K installsPostgres best-practices guide covering query performance, connections, RLS, schema, locking, and advanced features.
input-validation-sanitization-auditorpatricio0312rev/skills293 installsSafe input handling guide covering XSS escaping, parameterized SQL queries, and Zod validation schemas.