How are you giving AI agents access to postgress?

3 points by Eapz_06 ↗ HN
I mean we can either let llm generate sql but that's risky right or should we do defined operations?

I mean for both reads and write.

But whether it's llm generate or we define we have to do the manual work of writing determistic guards right...

4 comments

[ 2.9 ms ] story [ 20.5 ms ] thread
Do you really need to provide AI full access for postgres? I rather created a small set of fixed tools, rather then raw sql. Each tool has bunch of predefined params and limited context. Each has own purpose: query explain and analize, db monitoring, slow log queries, db healthcheck, backups, etc.