Why You Shouldn't Use LLMs to Generate SQL (Security Risks)
“Just let the LLM write the SQL.” It sounds powerful. A user types a question in plain English, the model generates a query, the system runs it against the database, and the answer comes back. No SQL knowledge required. No BI tools. No waiting for the data team. It works beautifully in demos. And it is a serious engineering mistake in production. Direct SQL generation from LLMs combines two things that should never be combined: untrusted code generation and privileged execution.