{"repo":"mautbach/dbastion","free":true,"listed":false,"github":"https://github.com/mautbach/dbastion","clone":"git clone https://github.com/mautbach/dbastion.git","description":"Governed database access for AI agents","language":"Python","stars":14,"topics":["ai-agents","bigquery","cli","database","duckdb","postgres","python","sql","clickhouse","snowflake"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"dbastion A bastion for your database. AST-based SQL validation, cost estimation, and execution control for AI agents. What it does dbastion parses every SQL statement into an AST before it reaches the database. - Classifies statements: read, dml, ddl, admin - Blocks dangerous patterns: DELETE without WHERE, cartesian joins, WHERE 1=1 , multi-statement, admin commands - Injects LIMIT on unbounded SELECTs - Dry-runs queries for cost estimation (BigQuery bytes/$, Snowflake partitions, Postgres EXPLAIN) - Returns a decision: allow , ask , or deny Query + Approve model dbastion query handles all SQL. Reads execute directly. Writes and expensive queries return decision: ask — pipe through dbastion approve to execute: In agent harnesses (Claude Code, Codex), allow query freely and set approve to prompt: This configures permissions so query and schema run freely; approve always prompts the human with the full SQL visible for review. Examples Read (executes) Write (needs approval) Dangerous (blocked) Install Also available via pip: Both dbastion and dbast (short alias) work after install. Supported databases Database Dry-run Cost estimation ------------ --------- ----------------- PostgreSQL EXPLAIN (JSON) row estimates BigQuery native dry-run bytes scanned, USD Snowflake EXPLAIN USING JSON partitions, bytes ClickHouse EXPLAIN ESTIMATE rows, bytes DuckDB EXPLAIN query plan Safety checks Code Check Action ------ ------- -------- Q0201 DELETE without WHERE blocked Q0203 UPDATE without W","default_branch":null,"files":null,"tree":[],"storefront":"/r/mautbach","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mautbach/dbastion/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}