Agent skill · security · aj-geddes

sql-injection-prevention

Prevent SQL injection attacks using prepared statements, parameterized queries, and input validation. Use when building database-driven applications securely.

Why this skill is useful

Provides specific implementation patterns and best practices for preventing SQL injection that the AI wouldn't reliably generate on its own.

What it needs

About 1k tokens when loaded. Last updated 2026-03-04. 307 stars on the source repository.

What this skill does

SQL Injection Prevention Table of Contents Overview When to Use Quick Start Reference Guides Best Practices 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: Reference Guides Detailed implementations in the references/ directory: Guide Contents --- --- Node.js with PostgreSQL Node.js with PostgreSQL Python with SQLAlchemy ORM Python with SQLAlchemy ORM Java JDBC with Prepared Statements Java JDBC with Prepared Statements Input Validation & Sanitization Input Validation & Sanitization Best Practices ✅ DO Use prepared statements ALWAYS Use ORM frameworks properly Validate all user inputs Whitelist dynamic values Use least privilege DB accounts Enable query logging Regular security audits Use parameterized queries ❌ DON'T Concatenate user input Trust client-side validation Use string formatting for queries Allow dynamic table/column names Grant excessive DB permissions Skip input validation

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aj-geddes/sql-injection-prevention

View the source on GitHub

Browse the @skills marketplace