db-shield
Skill1 starsChanged 5 days agoMITView on GitHub
Safety-first Database Guardrail & Sandboxing MCP Server for AI Coding Agents. Protects relational databases from destructive mutations, drops, locks, and PII leaks.
In this repository4 other files it gives its agents.
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- llms-full.txtllms.txt
- llms.txtllms.txt
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When interacting with databases, generating SQL, or executing migrations:
- Very specific: line 18
NEVER execute unconstrained UPDATE, DELETE, or DDL statements directly against production or staging databases.
- Very specific: line 28
Only execute db_commit using the verified commit_token returned by db_dry_run.
- Very specific: line 31
Avoid WHERE 1=1, WHERE 'a'='a', or self-referential conditions (WHERE id = id).
- Very specific: line 35
Always validate DDL scripts with db_validate_migration to check for unindexed foreign keys, table locks, and zero-downtime safety plans.
- Very specific: line 64
Add DBShield to your agent configuration (mcp.json or .cursor/mcp.json):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
🛡️ DBShield AI Skill
This skill equips autonomous AI coding agents (Antigravity, Claude Code, Cursor, Windsurf, Codex) with safety-first database guardrails, two-phase dry-run execution, virtual schema masking, and real-time PII sanitization.
Directives for AI Agents
When interacting with databases, generating SQL, or executing migrations:
- Always Use Two-Phase Mutation (
db_dry_runbeforedb_commit):- NEVER execute unconstrained
UPDATE,DELETE, or DDL statements directly against production or staging databases. - First invoke
db_dry_runto inspect simulated row impacts and obtain a cryptographic commit token:{ "tool": "db_dry_run", "arguments": { "query": "UPDATE users SET status = 'active' WHERE id = 42" } } - Only execute
db_commitusing the verifiedcommit_tokenreturned bydb_dry_run.
- NEVER execute unconstrained
- Never Write Tautological Queries:
- Avoid
WHERE 1=1,WHERE 'a'='a', or self-referential conditions (WHERE id = id). - DBShield's AST Tautology Trap intercepts and blocks these queries as critical violations.
- Avoid
- Validate Migrations Before Applying:
- Always validate DDL scripts with
db_validate_migrationto check for unindexed foreign keys, table locks, and zero-downtime safety plans.
- Always validate DDL scripts with
- Adhere to Virtual Schema Masking:
- Internal tables (
credentials,api_keys,admin_sessions) and restricted columns are automatically masked from agent introspection. Do not attempt to query system catalogs (information_schema,pg_catalog) to bypass masking.
- Internal tables (
🚀 CLI Commands & Quickstart
# Launch MCP Server on stdio (for Claude Desktop / Cursor / Antigravity)
npx @ritualdev-lab/dbshield start
# Launch PostgreSQL wire proxy on port 5433
npx @ritualdev-lab/dbshield proxy --port 5433
# Launch live query approval dashboard
npx @ritualdev-lab/dbshield dashboard --port 3100
# Generate SOC 2 compliance audit report
npx @ritualdev-lab/dbshield report --compliance soc2 --audit-pdf audit.pdf
# Auto-configure Claude Desktop
npx @ritualdev-lab/dbshield install-claude
# Auto-configure Cursor IDE
npx @ritualdev-lab/dbshield install-cursor🛸 Antigravity & MCP Configuration
Add DBShield to your agent configuration (mcp.json or .cursor/mcp.json):
{
"mcpServers": {
"dbshield": {
"command": "npx",
"args": ["-y", "@ritualdev-lab/dbshield", "start"],
"env": {
"DBSHIELD_DIALECT": "sqlite",
"DBSHIELD_STORAGE": "./dev.db",
"DBSHIELD_TIER": "BALANCED"
}
}
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

