Assume the end-user can write arbitrary SQL and LLM is just an interface for that.
Creating a read-only Postgres user with limited access might be a good workaround.
Not sure about avoiding infinite loops, CPU loads, etc. Curious to get an expert’s input on this.