sql-safety

Rules for writing and operating a database access layer safely. They cover parameterized SQL, input checks, schema migrations, connection pools, read replicas, and untrusted data.

In plain words
What is it for?
Use them when implementing database queries, validating request data, creating migrations, managing connections, routing reads and writes, and monitoring replica delay.
Why use it?
They reduce common risks such as SQL injection, unsafe schema changes, inefficient connections, and accidental use of invalid or untrusted input.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/edenfunf/promptc/sql-safety
Any agent
npx skills add edenfunf/promptc --skill sql-safety
Clone the repo
git clone --depth 1 https://github.com/edenfunf/promptc

Made for: Claude Code, Codex.

Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 283 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.00283
Opus 5 $0.00006 $0.00142
Sonnet 5 $0.00003 $0.00057
Haiku 4.5 $0.00001 $0.00028

Measured 2d ago against content hash 63daff6c2c16, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sql-safety 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 2d ago.

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.

examples/bloated-demo/.claude/skills/sql-safety/SKILL.md · 44 lines

What it actually says

SQL Safety

Parameterized queries

Always use parameterized queries for every database access. Never concatenate user-provided strings into SQL statements directly. This includes dynamic WHERE clauses, ORDER BY clauses, and table names.

Migration discipline

All schema migrations go through the migrations/ directory and run in the deploy pipeline; never modify the production schema by hand. Each migration is reversible — pair every up with a tested down.

Connection pooling

Use connection pools sized to peak concurrent load divided by average query latency. Never open and close a fresh connection per request in a hot path; the handshake cost dominates everything else under load.

Read replicas

Route read-only queries to read replicas. Writes always go to primary. Track replication lag and surface it on dashboards.

Input validation

Validate and sanitize all user-provided data at the system boundary before it enters business logic. Reject inputs that do not match the expected shape, range, or type.

Boundary discipline

Treat any data that crossed a network or process boundary as untrusted until proven otherwise. Apply the same scrutiny to data from other internal services as you would to data from the public internet. The threat model assumes lateral movement; act accordingly across every service-to-service hop in the system.

Changes

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.

  1. 2d ago First seen · 44 lines · 13 tokens per session scan A 63daff6c2c16

Subscribe to this mod's changes

sql-safety is a skill published in the GitHub repository edenfunf/promptc (2 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 283 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.