A safe way to let coding agents interact with your database (without prod write access)

Posted by National_Purpose5521@reddit | programming | View on Reddit | 15 comments

A lot of teams try to make coding agents safe by blocking SQL writes, adding command allowlists, or inserting approval dialogs.

In practice, this doesn’t work.

If an agent has any general execution surface (shell, runtime, filesystem), it will eventually route around those restrictions to complete the task. We’ve repeatedly seen agents generate their own scripts and modify state even when only read-only DB tools were exposed.

I put together a tutorial showing a safer pattern: