Project · AI tools · Data safety
One bad DELETE can wipe a table.
I let Claude run database commands for me, and I wanted a pause before the ones I can't undo. Query Guard reads each database command first. If it looks destructive or points at production, it holds the command and shows me what's at stake.
Try it: would Query Guard let this run?
Runs the real hooks/rules.ts in your browser
Why it exists
Claude Code already shows each command before it runs. But a long command is easy to skim, and after many approvals you stop reading closely. Database clients are just shell commands, so a forgotten WHERE or the wrong host can destroy data in a second.
How it works
- A
tool.callhook sees every Bash command; non-database commands pass straight through. - Each rule is a plain, tested function over the command text.
- On a match, the command is held and a pane shows the command, the reason, the target and the live row count (read-only).
- Proceed runs it unchanged; Cancel refuses it and tells Claude not to work around it.
What it holds
DROP TABLE / DATABASE / SCHEMA
TRUNCATE
DELETE without WHERE
UPDATE without WHERE
ALTER TABLE … DROP COLUMN
dbt --full-refresh
A prod / production target
Honest limits
It's a safety net, not a permission system. It reads only the command text, so SQL in files, scripts, aliases, or connection settings it can't see will get past it.
Connections
Linked tools & methods
- TypeScriptTyped JavaScript, used to build the Query Guard plugin.
- SQLThe language for querying relational databases; the core of most analysis work.Also in: VirtueSoft · Jabil · NextSquare · Senior · NextSquare · Analyst · Grocery Growth Drivers · Dashboard walkthrough · Lead Scoring
- dbtTransforms raw warehouse tables into tested, documented models with SQL.Also in: VirtueSoft · Ad Creative Pretest Lab · Grocery Growth Drivers · Dashboard walkthrough · dbt open source
- ClaudeAnthropic's AI model, used for plain-English data access and tooling.Also in: VirtueSoft