Ask your database questions without handing AI a delete button
You should be able to ask your database a question without giving an AI assistant the job of changing it. That is the problem Bufflehead is built for: a native, read-only bridge from AI tools to existing structured data.
“Which orders were completed yesterday?” needs a query and an answer. It does not need permission to delete orders, update customers or drop a table. Bufflehead is designed around that distinction.
Read-only is a connection setting, not just an instruction to the model
For PostgreSQL, Bufflehead v0.30.0 sets this session default when it opens a connection:
SET default_transaction_read_only = on;
If setting read-only fails, the connection setup returns an error instead of continuing. This applies to the direct Postgres path and the tunnel connection path. In a read-only transaction, PostgreSQL rejects changes such as deleting rows from ordinary persistent tables. The database enforces that restriction; it does not depend on the AI interpreting a request correctly.
Bufflehead's PostgreSQL query path also runs the supplied query inside a result-count query and a paginated query. Its purpose is to retrieve results, rather than provide a general database administration console. Those query wrappers are not a substitute for database permissions or a complete SQL security parser.
How the other connections work
- MySQL: Bufflehead configures transaction_read_only=ON through the driver's connection parameters. The driver reapplies it when opening a new connection, including after a pool reconnect.
- SQLite database files: the connection URI sets mode=ro and query_only(1), combining a read-only file opening mode with a SQL-level write restriction.
- DuckDB database files: Bufflehead opens them with access_mode=read_only. This describes existing DuckDB database files, not a claim that every file or S3 access path uses the same mechanism.
- BigQuery: there is no equivalent session switch in Bufflehead's implementation. It checks the beginning of the query before submitting it, accepting prefixes such as SELECT and WITH. This is a lightweight application check, not a full proof that arbitrary scripts or function calls cannot have side effects. Scope the Google Cloud identity's permissions accordingly.
Give the connection a login that can only do its job
For a production PostgreSQL connection, pair Bufflehead's read-only session with a dedicated, restricted database login. Grant access to the tables or views it needs, without table ownership, write privileges or unnecessary privileged functions. Test that exact login against disposable data before connecting an agent.
A session default can be changed; an overprivileged credential should not be treated as safe merely because read-only is initially enabled. Database permissions provide a separate boundary. Bufflehead does not automatically configure those grants for you.
The practical result is a narrower job for the AI: read the allowed data and help you understand it. Keep migrations, cleanup and other changes in a separate workflow with the permissions and review they need.
Further reading
The Stack Underflow's Postgres/MCP lab video describes the difference between read-only settings and database privileges. We reviewed its description and chapters; its transcript did not load and its lab was not reproduced here. Earlier related videos from Do Incredible and The Modern SDE explore the same practical concern. These links are educational references, not endorsements of Bufflehead.
This explanation was checked against Bufflehead v0.30.0 source and current main 8b6ffba. It is a source review, not a new end-to-end or adversarial test. Read-only access does not decide which sensitive data the AI should see or guarantee the accuracy of its answer.
Source: Bufflehead's released connection implementations and PostgreSQL's transaction access rules.