jmmana/sqlguardllm
Policy-based SQL firewall for LLM SQL
What it solves
Without it, LLM-written SQL can be manipulated by prompt injection to read unauthorized tables, columns, or rows.
- Syntax-tree validation and rewrite
- Read-only, allowlists, row filters
- Supports 30+ SQL dialects
Works with
- claude-desktop
- cursor
- vscode
- cline
- cli
Install
pip install sqlguardllm uvx --with "psycopg[binary]" --from "sqlguardllm[mcp]==1.1.0" sqlguardllm mcp --policy policy.yaml --db "$READ_ONLY_URL" --write-db "$WRITE_URL" --ledger ledger.db pip install langchain-sqlguardllm==0.1.0a2 pip install "sqlguardllm[yaml]" Security flags
- Needs API key: Not stated
- Runs locally: Yes
- Network access: Yes
- Needs root: No
Maintenance
| Last commit | 2026-12-05(0d) |
|---|---|
| Stars | 24 |
| Open issues | 1 |
| License | Apache-2.0 |
| Archived | No |
| Data fetched | 2026-12-06 |
Source excerpt
Verbatim README excerpt, unedited, so you can check the summary above.
The SQL firewall for LLM apps and agents.