Sqlgate

•

Provides a deterministic, fail-closed write gate for LLM-generated SQL, ensuring safety and preventing unauthorized database modifications.

As LLM agents gain write access to production databases, delegating safety to the model itself becomes a critical vulnerability that a model can be prompted to circumvent. Sqlgate addresses this by offering a robust, deterministic, and fail-closed write gate for AI-generated SQL. It employs a multi-layered defense system, including a sqlglot AST whitelist engine, a read-only impact pre-check, and a pluggable ticketed executor, ensuring that dangerous or unapproved statements cannot be executed. This system prevents models from bypassing their own safety constraints, providing a secure method for managing automated database writes.

주요 기능

01Deterministic AST Whitelist Engine for hard rule and template-based SQL validation
02Caller-Side Idempotency Ledger to prevent duplicate execution of work items
030 GitHub stars
04Read-Only Impact Pre-check to measure statement impact with `SELECT COUNT(*)` before execution
05Pluggable Ticketed Executor with audit trail, rollback capabilities, and safe `dryrun` default
06Configurable Row-Count Gates for auto-execution or human review based on measured impact

사용 사례

01Securing LLM agents with write access to production databases
02Auditing and controlling automated database operations performed by AI
03Implementing stringent guardrails for AI-generated SQL queries