QueryShield

How do I prevent prompt injection from causing database damage?

Prompt injection (OWASP LLM01) is the upstream cause; SQL damage is the downstream effect. You defend in depth at both ends:

The principle is identical to defense-in-depth web security: input validation *and* output encoding *and* parameterized queries *and* WAF. For LLM SQL, you need input filtering (prompt injection detection) *and* output validation (AST validator) *and* least-privilege DB roles *and* RLS.